hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2025.07.04. 14:47



Jelenlévő felhasználók

Jelenleg 391 felhasználó van jelen :: 1 regisztrált, 0 rejtett és 390 vendég

A legtöbb felhasználó (2761 fő) 2025.01.09. 20:06-kor tartózkodott itt.

Regisztrált felhasználók: Bing [Bot]az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása Hozzászólás a témához  [3 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Specinfo 1.3.1
HozzászólásElküldve:2012.07.31. 13:53 
Offline
Őstag
Avatar

Csatlakozott:2012.02.14. 15:09
Hozzászólások:1423
Megköszönték neki: 2 alkalommal
Valaki kiszedné a Specinfo 1.3.1 szöveget a néző lista aljáról ?
Kód:
  1. /*

  2. SpecInfo v1.3.1

  3. Copyright (C) 2007-2008 Ian (Juan) Cammarata

  4.  

  5. This program is free software: you can redistribute it and/or modify

  6. it under the terms of the GNU Affero General Public License as

  7. published by the Free Software Foundation, either version 3 of the

  8. License, or (at your option) any later version.

  9.  

  10. This program is distributed in the hope that it will be useful,

  11. but WITHOUT ANY WARRANTY; without even the implied warranty of

  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

  13. GNU Affero General Public License for more details.

  14.  

  15. You should have received a copy of the GNU Affero General Public License

  16. along with this program.  If not, see <http://www.gnu.org/licenses/>.

  17. --------------------------------------------------------------------------------


  18. Jan 05 17:39

  19.  

  20.  

  21. Description:

  22. This plugin displays a list of spectators currently viewing the live player.

  23. This list is visible to the living player as well as other players currently

  24. spectating that player.  Also spectators can see which movement commands the

  25. the live player is using.                

  26.  

  27.  

  28. Commands:

  29. say /speclist   :       Toggle viewing list of spectators.

  30. say /speckeys   :       Toggle viewing keys of player you are spectating.

  31. say /spechide : Immune admins toggle whether or not they're hidden from list.

  32. say /showkeys : View your own keys on screen while alive.

  33.  

  34.  

  35. Cvars (First value is default):

  36. si_enabled <1|0> : Enables all plugin functionality.

  37.  

  38. si_list_enabled <1|0> : Enables spectator list.

  39. si_keys_enabled <1|0> : Enables spectator key view.

  40. si_list_default <1|0> : Default on/off state for spec list when a client joins.

  41. si_keys_default <1|0> : Default on/off state for key view when a client joins.

  42.  

  43. si_immunity <0|1> : Enables admin immunity; Admins won't show on spec list.

  44.  

  45. si_msg_r <45|...> : HUD message red value.

  46. si_msg_g <89|...> : HUD message green value.

  47. si_msg_b <116|...> : HUD message blue value.

  48.  

  49.  

  50. Notes:

  51. Make sure you place the specinfo.txt file in addons\amxmodx\data\lang

  52.  

  53.  

  54. Supported Languages:

  55. English (100%)

  56. Spanish (100%) - Thanks to Mely for checking these.

  57. German (63%) - Thanks to [S]killer for this translation.

  58.  

  59.  

  60. Change Log:

  61. Key (+ added | - removed | c changed | f fixed)

  62.  

  63. v1.3.1 (Jan 5, 2008)

  64. f: Eliminated a bug introduced in 1.3 as well as the occasional index out of bounds error it caused.

  65.  

  66. v1.3 (Nov 21, 2007)

  67. +: Command "/showkeys" to view your own keys.

  68. c: Minor code optimizations.

  69.  

  70. v1.2 (Jul 14, 2007)

  71. +: Command "say /spechide" for immune to toggle hidden state.

  72. c: Lots of code optimizations.

  73. f: Always showing keys even when disabled.

  74. f: Hud messaged getting messed up when too many names are on the list. (No seriously, for real this time.)

  75.  

  76. v1.1 (Jul 06, 2007)

  77. +: Show number of people spectating.

  78. c: Names truncated shorter than 20 chars when lots of players on the list.

  79. c: Spectator list moved further right. (Even further when you're alive.)

  80. f: Hud messaged getting messed up when too many names are on the list. (Same as last time, but it's fixed for good.)

  81.  

  82. v1.0.1 (June 07, 2007)

  83. f: Hud messaged getting messed up when too many names are on the list.

  84.  

  85. v1.0 (June 02, 2007)

  86. !Initial Release

  87. */

  88. #include <amxmodx>

  89. #include <amxmisc>

  90. #include <engine>

  91. #include <fakemeta>

  92.  

  93. new const VERSION[ ] = "1.3.1"

  94. new const TRKCVAR[ ] = "specinfo_version"

  95. #define IMMUNE_FLAG ADMIN_IMMUNITY

  96.  

  97. #define KEYS_STR_LEN 31

  98. #define LIST_STR_LEN 610

  99. #define BOTH_STR_LEN KEYS_STR_LEN + LIST_STR_LEN

  100.  

  101. //cl_prefs constants

  102. #define FL_LIST    ( 1 << 0 )

  103. #define FL_KEYS    ( 1 << 1 )

  104. #define FL_OWNKEYS ( 1 << 2 )

  105. #define FL_HIDE    ( 1 << 3 )

  106.  

  107. //cvar pointers

  108. new p_enabled, p_list_enabled, p_keys_enabled, p_list_default, p_keys_default;

  109. new p_red, p_grn, p_blu, p_immunity;

  110.  

  111. //data arrays

  112. new cl_keys[33], cl_prefs[33];

  113. new keys_string[33][KEYS_STR_LEN + 1], list_string[33][LIST_STR_LEN + 1]

  114. new cl_names[33][21], spec_ids[33][33];

  115.  

  116. public plugin_init( )

  117. {

  118.         register_plugin( "SpecInfo", VERSION, "Ian Cammarata" );

  119.         register_cvar( TRKCVAR, VERSION, FCVAR_SERVER );

  120.         set_cvar_string( TRKCVAR, VERSION );

  121.  

  122.         p_enabled = register_cvar( "si_enabled", "1" );

  123.         p_list_enabled = register_cvar( "si_list_enabled", "1" );

  124.         p_keys_enabled = register_cvar( "si_keys_enabled", "1" );

  125.         p_list_default = register_cvar( "si_list_default", "1" );

  126.         p_keys_default = register_cvar( "si_keys_default", "1" );

  127.         p_immunity = register_cvar( "si_immunity", "1" );

  128.         p_red = register_cvar( "si_msg_r", "45" );

  129.         p_grn = register_cvar( "si_msg_g", "89" );

  130.         p_blu = register_cvar( "si_msg_b", "116" );

  131.  

  132.         register_clcmd( "say /speclist", "toggle_list", _, "Toggle spectator list." );

  133.         register_clcmd( "say /speckeys", "toggle_keys", _, "Toggle spectator keys." );

  134.         register_clcmd( "say /showkeys", "toggle_ownkeys", _, "Toggle viewing own keys." );

  135.         register_clcmd( "say /spechide", "toggle_hide", IMMUNE_FLAG, "Admins toggle being hidden from list." );

  136.  

  137.         set_task( 1.0, "list_update", _, _, _, "b" );

  138.         set_task( 0.1, "keys_update", _, _, _, "b" );

  139.  

  140.         register_dictionary( "specinfo.txt" );

  141. }

  142.  

  143. public client_connect( id )

  144. {

  145.         cl_prefs[id] = 0;

  146.         if( !is_user_bot( id ) )

  147.         {

  148.                 if( get_pcvar_num( p_list_default ) ) cl_prefs[id] |= FL_LIST;

  149.                 if( get_pcvar_num( p_keys_default ) ) cl_prefs[id] |= FL_KEYS;

  150.         }

  151.         get_user_name( id, cl_names[id], 20 );

  152.         return PLUGIN_CONTINUE;

  153. }

  154.  

  155. public client_infochanged( id )

  156. {

  157.         get_user_name( id, cl_names[id], 20 );

  158.         return PLUGIN_CONTINUE;

  159. }

  160.  

  161. public list_update( )

  162. {

  163.         if( get_pcvar_num( p_enabled ) && get_pcvar_num ( p_list_enabled ) )

  164.   {

  165.                 new players[32], num, id, id2, i, j;

  166.                 for( i = 1; i < 33; i++ ) spec_ids[i][0] = 0;

  167.  

  168.                 get_players( players, num, "bch" );

  169.                 for( i = 0; i < num; i++ )

  170.     {

  171.                         id = players[i];

  172.                         if( !( get_user_flags( id ) & IMMUNE_FLAG && get_pcvar_num( p_immunity ) && cl_prefs[id] & FL_HIDE ) )

  173.                         {

  174.                                 id2 = pev( id, pev_iuser2 );

  175.                                 if( id2 )

  176.                                 {

  177.                                         spec_ids[ id2 ][ 0 ]++;

  178.                                         spec_ids[ id2 ][ spec_ids[ id2 ][ 0 ] ] = id;

  179.                                 }

  180.                         }

  181.                 }

  182.                 new tmplist[ LIST_STR_LEN + 1 ], tmpstr[41];

  183.                 new count, namelen, tmpname[21];

  184.                 for( i=1; i<33; i++ )

  185.     {

  186.                         count = spec_ids[i][0];

  187.                         if( count )

  188.                         {

  189.                                 namelen = ( LIST_STR_LEN - 10 ) / count;

  190.                                 clamp( namelen, 10, 20 );

  191.                                 format( tmpname, namelen, cl_names[i] );

  192.                                 formatex( tmplist, LIST_STR_LEN - 1, "^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t(%d) %s %s:^n", count, "%L", tmpname);

  193.                                 for( j=1; j<=count; j++ )

  194.         {

  195.                                         format( tmpname, namelen, cl_names[spec_ids[i][j]]);

  196.                                         formatex( tmpstr, 40, "^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t%s", tmpname );

  197.                                         if( strlen( tmplist ) + strlen( tmpstr ) + ( 11 - j ) < ( LIST_STR_LEN - 1 ) )

  198.                                                 format( tmplist, LIST_STR_LEN - 10, "%s%s^n", tmplist, tmpstr );

  199.                                         else

  200.           {

  201.                                                 format( tmplist, LIST_STR_LEN, "%s...^n", tmplist );

  202.                                                 break;

  203.                                         }

  204.                                 }

  205.                                 if( count < 10 )

  206.           format( tmplist, LIST_STR_LEN,

  207.                                                 "%s^n^n^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^tSpecInfo v%s^n",

  208.                                                 tmplist, VERSION

  209.                                         );

  210.                                 for( j+=0; j<10; j++ )

  211.           format( tmplist, LIST_STR_LEN, "%s%s", tmplist, "^n" );

  212.                                 list_string[i] = tmplist;

  213.                         }

  214.                 }

  215.                 get_players( players, num, "ch" );

  216.                 for( i=0; i<num; i++ ) clmsg( players[i] );

  217.         }

  218.         return PLUGIN_HANDLED;

  219. }

  220.  

  221. public keys_update( )

  222. {

  223.         if( !get_pcvar_num( p_enabled ) && !get_pcvar_num( p_keys_enabled ) ) return;

  224.  

  225.         new players[32], num, id, i;

  226.         get_players( players, num, "a" );

  227.         for( i = 0; i < num; i++ )

  228.   {

  229.                 id = players[i];

  230.                 formatex( keys_string[id], KEYS_STR_LEN, " ^n^t^t%s^t^t^t%s^n^t%s %s %s^t^t%s",

  231.                         cl_keys[id] & IN_FORWARD ? "W" : " .",

  232.                         "%L",

  233.                         cl_keys[id] & IN_MOVELEFT ? "A" : ".",

  234.                         cl_keys[id] & IN_BACK ? "S" : ".",

  235.                         cl_keys[id] & IN_MOVERIGHT ? "D" : ".",

  236.                         "%L"

  237.                 );

  238.  

  239.                 //Flags stored in string to fill translation char in clmsg function

  240.                 keys_string[id][0] = 0;

  241.                 if( cl_keys[id] & IN_JUMP ) keys_string[id][0] |= IN_JUMP;

  242.                 if( cl_keys[id] & IN_DUCK ) keys_string[id][0] |= IN_DUCK;

  243.  

  244.                 cl_keys[id] = 0;

  245.         }

  246.  

  247.         new id2;

  248.         get_players( players, num, "ch" );

  249.         for( i=0; i<num; i++ )

  250.   {

  251.                 id = players[i];

  252.                 if( is_user_alive( id ) )

  253.                 {

  254.                         if( cl_prefs[id] & FL_OWNKEYS ) clmsg( id );

  255.                 }

  256.                 else

  257.                 {

  258.                         id2 = pev( id, pev_iuser2 );

  259.                         if( cl_prefs[id] & FL_KEYS && id2 && id2 != id ) clmsg( id );

  260.                 }

  261.         }

  262.  

  263. }

  264.  

  265. public server_frame( )

  266. {

  267.         if( get_pcvar_num( p_enabled ) && get_pcvar_num( p_keys_enabled ) )

  268.   {

  269.                 new players[32], num, id;

  270.                 get_players( players, num, "a" );

  271.                 for( new i = 0; i < num; i++ )

  272.                 {

  273.                         id = players[i];

  274.                         if( get_user_button( id ) & IN_FORWARD )

  275.                                 cl_keys[id] |= IN_FORWARD;

  276.                         if( get_user_button( id ) & IN_BACK )

  277.                                 cl_keys[id] |= IN_BACK;

  278.                         if( get_user_button( id ) & IN_MOVELEFT )

  279.                                 cl_keys[id] |= IN_MOVELEFT;

  280.                         if( get_user_button( id ) & IN_MOVERIGHT )

  281.                                 cl_keys[id] |= IN_MOVERIGHT;

  282.                         if( get_user_button( id ) & IN_DUCK )

  283.                                 cl_keys[id] |= IN_DUCK;

  284.                         if( get_user_button( id ) & IN_JUMP )

  285.                                 cl_keys[id] |= IN_JUMP;

  286.                 }

  287.         }

  288.         return PLUGIN_CONTINUE

  289. }

  290.  

  291. public clmsg( id )

  292. {

  293.         if( !id ) return;

  294.  

  295.         new prefs = cl_prefs[id];

  296.  

  297.         new bool:show_own = false;

  298.         if( is_user_alive( id ) && prefs & FL_OWNKEYS ) show_own = true;

  299.  

  300.         if( is_user_alive( id ) && !show_own )

  301.   {

  302.                 if( prefs & FL_LIST && spec_ids[id][0] && get_pcvar_num( p_list_enabled ) )

  303.                 {

  304.                         set_hudmessage(

  305.         get_pcvar_num( p_red ),

  306.         get_pcvar_num( p_grn ),

  307.         get_pcvar_num( p_blu ),

  308.         0.7, /*x*/

  309.         0.1, /*y*/

  310.         0, /*fx*/

  311.         0.0, /*fx time*/

  312.         1.1, /*hold time*/

  313.         0.1, /*fade in*/

  314.         0.1, /*fade out*/

  315.         3 /*chan*/

  316.                         );

  317.                         show_hudmessage( id, list_string[id], id, "SPECTATING" );

  318.                 }

  319.         }

  320.         else

  321.   {

  322.                 new id2;

  323.                 if( show_own ) id2 = id;

  324.                 else id2 = pev( id, pev_iuser2 );

  325.                 if( !id2 ) return;

  326.  

  327.                 if( prefs & FL_LIST || prefs & FL_KEYS || show_own )

  328.     {

  329.                         set_hudmessage(

  330.         get_pcvar_num( p_red ),

  331.         get_pcvar_num( p_grn ),

  332.         get_pcvar_num( p_blu ),

  333.         0.48, /*x*/

  334.         0.14, /*y*/

  335.         0, /*fx*/

  336.         0.0, /*fx time*/

  337.         prefs & FL_KEYS || show_own ? 0.1 : 1.1, /*hold time*/

  338.         0.1, /*fade in*/

  339.         0.1, /*fade out*/

  340.         3 /*chan*/

  341.                         );

  342.                         new msg[BOTH_STR_LEN + 1];

  343.                         if( prefs & FL_LIST && get_pcvar_num( p_list_enabled ) && spec_ids[id2][0] )

  344.         formatex(msg,BOTH_STR_LEN,list_string[id2],id,"SPECTATING");

  345.                         else msg ="^n^n^n^n^n^n^n^n^n^n^n^n";

  346.                         if( get_pcvar_num( p_keys_enabled ) && ( prefs & FL_KEYS || show_own ) )

  347.       {

  348.         format( msg, BOTH_STR_LEN, "%s%s", msg, keys_string[id2][1] );

  349.         format( msg, BOTH_STR_LEN, msg,

  350.                                         id, keys_string[id2][0] & IN_JUMP ? "JUMP" : "LAME",

  351.                                         id, keys_string[id2][0] & IN_DUCK ? "DUCK" : "LAME"

  352.                                 );

  353.       }

  354.                         show_hudmessage( id, msg );

  355.                 }

  356.         }

  357. }

  358.  

  359. public set_hudmsg_flg_notify( )

  360. {

  361.         set_hudmessage(

  362.                 get_pcvar_num( p_red ),

  363.                 get_pcvar_num( p_grn ),

  364.                 get_pcvar_num( p_blu ),

  365.                 -1.0, /*x*/

  366.                 0.8, /*y*/

  367.                 0, /*fx*/

  368.                 0.0, /*fx time*/

  369.                 3.0, /*hold time*/

  370.                 0.0, /*fade in*/

  371.                 0.0, /*fade out*/

  372.                 -1 /*chan*/

  373.         );

  374. }

  375.  

  376. public toggle_list( id )

  377. {

  378.         set_hudmsg_flg_notify( );

  379.         cl_prefs[id] ^= FL_LIST;

  380.         show_hudmessage( id, "%L", id, cl_prefs[id] & FL_LIST ? "SPEC_LIST_ENABLED" : "SPEC_LIST_DISABLED" );

  381.         return PLUGIN_HANDLED;

  382. }

  383.  

  384. public toggle_keys( id )

  385. {

  386.         set_hudmsg_flg_notify( );

  387.         cl_prefs[id] ^= FL_KEYS;

  388.         show_hudmessage( id, "%L", id, cl_prefs[id] & FL_KEYS ? "SPEC_KEYS_ENABLED" : "SPEC_KEYS_DISABLED" );

  389.         return PLUGIN_HANDLED;

  390. }

  391.  

  392. public toggle_ownkeys( id )

  393. {

  394.         set_hudmsg_flg_notify( );

  395.         cl_prefs[id] ^= FL_OWNKEYS;

  396.         show_hudmessage( id, "%L", id, cl_prefs[id] & FL_OWNKEYS ? "SPEC_OWNKEYS_ENABLED" : "SPEC_OWNKEYS_DISABLED" );

  397.         return PLUGIN_HANDLED;

  398. }

  399.  

  400. public toggle_hide( id, level, cid )

  401. {

  402.         if( cmd_access( id, level, cid, 0 ) )

  403.         {

  404.                 set_hudmsg_flg_notify( );

  405.                 cl_prefs[id] ^= FL_HIDE;

  406.                 show_hudmessage( id, "%L", id, cl_prefs[id] & FL_HIDE ? "SPEC_HIDE_ENABLED" : "SPEC_HIDE_DISABLED" );

  407.         }

  408.         return PLUGIN_HANDLED;

  409. }

  410.  

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Specinfo 1.3.1
HozzászólásElküldve:2012.07.31. 18:52 
Offline
Developer
Avatar

Csatlakozott:2011.06.01. 21:11
Hozzászólások:7966
Megköszönt másnak: 295 alkalommal
Megköszönték neki: 537 alkalommal
Langot is postlod pls!

_________________
http://www.easyrankup.eu


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Specinfo 1.3.1
HozzászólásElküldve:2012.07.31. 19:05 
Offline
Őstag
Avatar

Csatlakozott:2012.02.14. 15:09
Hozzászólások:1423
Megköszönték neki: 2 alkalommal
Kód:
  1. [en]

  2. SPECTATING = Nezok

  3. JUMP = ugras

  4. DUCK = guggolas

  5. LAME =   -

  6. SPEC_LIST_DISABLED = Nezo lista kikapcsolva.

  7. SPEC_LIST_ENABLED = Nezo lista bekapcsolva.

  8. SPEC_KEYS_DISABLED = Billentyu lista kikapcsolva.

  9. SPEC_KEYS_ENABLED = Billentyu lista bekapcsolva.

  10. SPEC_HIDE_DISABLED = Rejtett admin mod kikapcsolva.

  11. SPEC_HIDE_ENABLED = Rejtett admin mod bekapcsolva.

De már nem fontos xd

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése: Rendezés 
Új téma nyitása Hozzászólás a témához  [3 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 5 vendég


Nyithatsz új témákat ebben a fórumban.
Válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole