hlmod.hu
https://hlmod.hu/

Ebbe mi a hiba?
https://hlmod.hu/viewtopic.php?f=24&t=5431
Oldal: 1 / 1

Szerző:  Delicious [2012.07.26. 20:08 ]
Hozzászólás témája:  Ebbe mi a hiba?

Kód:
  1. #include <amxmodx>

  2. #include <fun>

  3. #include <cstrike>

  4. #include <engine>

  5.  

  6. #define PLUGIN "Advanced Resetscore"

  7. #define VERSION "1.0"

  8. #define AUTHOR "Silent"

  9.  

  10. #define USE_CC 1

  11.  

  12. #if defined USE_CC

  13.         #include <colorchat>

  14. #endif

  15.  

  16. #define ADMIN_NEED ADMIN_KICK

  17.  

  18. new cvar_enable;

  19.  

  20. new cvar_showall, cvar_showalladmin;

  21. new cvar_log, cvar_logadmin;

  22.  

  23. public plugin_init() {

  24.         register_plugin(PLUGIN, VERSION, AUTHOR);

  25.  

  26.         cvar_enable = register_cvar("ars_enable", "1");

  27.         cvar_showall = register_cvar("ars_showall", "0");

  28.         cvar_showalladmin = register_cvar("ars_showall_admin", "1");

  29.         cvar_log = register_cvar("ars_log", "0");

  30.         cvar_logadmin = register_cvar("ars_log_admin", "1");

  31.  

  32.         register_clcmd("say /rs", "resetscore_player");

  33.         register_clcmd("say /resetscore", "resetscore_player");

  34.         register_clcmd("say !rs", "resetscore_player");

  35.         register_clcmd("say !resetscore", "resetscore_player");

  36.         register_clcmd("resetscore", "resetscore_player");

  37.  

  38.         register_clcmd("amx_resetscore", "resetscore_admin");

  39.         register_clcmd("say amx_resetscore", "resetscore_admin");

  40. }

  41.  

  42. public resetscore_player(id)

  43. {

  44.         if(!get_pcvar_num(cvar_enable))

  45.         return PLUGIN_CONTINUE;

  46.  

  47.         if(!is_user_connected(id))

  48.         return PLUGIN_HANDLED;

  49.  

  50.         set_user_frags(id, 0);

  51.         cs_set_user_deaths(id, 0);

  52.         set_user_frags(id, 0);

  53.         cs_set_user_deaths(id, 0);

  54.  

  55.         new name[32]; get_user_name(id, name, 31);

  56.  

  57.         if(get_pcvar_num(cvar_showall))

  58.         {

  59.                 #if defined USE_CC

  60.                         ColorChat(0, YELLOW, "[^x04JAILBREAK^x01]^x04 %s ^x03nullazta a statisztikajat.", name);

  61.                 #else

  62.                         client_print(0, print_chat, "%s nullazta a statisztikajat.", name);

  63.                 #endif

  64.         }

  65.         else

  66.         {

  67.                 #if defined USE_CC

  68.                         ColorChat(id, YELLOW, "[^x04JAILBREAK^x01] ^x03Sikeresen nullaztad a statisztikadat.");

  69.                 #else

  70.                         client_print(id, print_chat, "Sikeresen nullaztad a statisztikadat.");

  71.                 #endif

  72.         }

  73.  

  74.         if(get_pcvar_num(cvar_log))

  75.         {

  76.                 log_amx("%s nullazta a statisztikajat", name);

  77.         }

  78.         return PLUGIN_HANDLED;

  79. }

  80.  

  81. public resetscore_admin(id)

  82. {

  83.         if(!get_pcvar_num(cvar_enable))

  84.         return PLUGIN_CONTINUE;

  85.  

  86.         if(!is_user_connected(id))

  87.         return PLUGIN_HANDLED;

  88.  

  89.         if(!(get_user_flags(id) & ADMIN_NEED))

  90.         return PLUGIN_HANDLED;

  91.  

  92.         new menu = menu_create("\rValaszd ki a jatekost:", "menu_handler");

  93.         new players[32], pnum, tempid;

  94.         new szName[32], szTempid[10];

  95.         get_players(players, pnum);

  96.         for( new i; i<pnum; i++ )

  97.         {

  98.                 tempid = players[i];

  99.                 get_user_name(tempid, szName, charsmax(szName));

  100.                 num_to_str(tempid, szTempid, charsmax(szTempid));

  101.                 menu_additem(menu, szName, szTempid, 0);

  102.         }

  103.         menu_display(id, menu, 0);

  104.  

  105.  

  106.  

  107.  

  108.  

  109.  

  110.         return PLUGIN_HANDLED;

  111. }

  112.  

  113.  

  114.  

  115.  

  116.  

  117. public menu_handler(id, menu, item)

  118. {

  119.         if(item == MENU_EXIT)

  120.         {

  121.                 menu_destroy(menu);

  122.                 return PLUGIN_HANDLED;

  123.         }

  124.         new data[6], szName[64];

  125.         new access, callback;

  126.         menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback);

  127.         new tempid = str_to_num(data);

  128.         if(is_user_connected(tempid))

  129.         {

  130.                 set_user_frags(tempid, 0);

  131.                 cs_set_user_deaths(tempid, 0);

  132.                 set_user_frags(tempid, 0);

  133.                 cs_set_user_deaths(tempid, 0);

  134.  

  135.                 new name[32], tempname[32]; get_user_name(id, name, 31); get_user_name(tempid, tempname, 31);

  136.  

  137.                 if(get_pcvar_num(cvar_showalladmin))

  138.                 {

  139.                         #if defined USE_CC

  140.                                 ColorChat(0, YELLOW, "[^x04JAILBREAK^x01]^x04 %s^x03 nullazta ^x04%s^x03 statisztikajat.", name, tempname);

  141.                         #else

  142.                                 client_print(0, print_chat, "[JAILBREAK] %s nullazta %s statisztikajat.", name, tempname);

  143.                         #endif

  144.                 }

  145.                 else

  146.                 {

  147.                         #if defined USE_CC

  148.                                 ColorChat(id, YELLOW, "[^x04JAILBREAK^x01]^x03 Sikeresen nullaztad ^x04%s^x03 statisztikajat.", tempname);

  149.                                 ColorChat(tempid, YELLOW, "[^x04JAILBREAK^x01]^x04 %s^x03 nullazta a statisztikadat.", name);

  150.                         #else

  151.                                 client_print(id, print_chat, "[JAILBREAK] Sikeresen nullaztad %s statisztikajat.", tempname);

  152.                                 client_print(tempid, print_chat, "[JAILBREAK] %s nullazta a statisztikadat.", name);

  153.                         #endif

  154.                 }

  155.  

  156.                 if(get_pcvar_num(cvar_logadmin))

  157.                 {

  158.                         log_amx("%s admin nullazta %s jatekos statisztikajat.", name, tempname);

  159.                 }

  160.         }

  161.         menu_destroy(menu);

  162.         return PLUGIN_HANDLED;

  163. }

Szerző:  DeteCT0R [2012.07.26. 20:14 ]
Hozzászólás témája:  Re: Ebbe mi a hiba?

Varj!Majd a Jedi Erommel megnezem^>^>^>^>^>OOOO SZOMANENO OOOOOO.
Eredmeny: Aszhiszed gondolat olvasok vagyunk?Ha leirtad mi a hiba editelek ezen a hozzaszolason.

Szerző:  IrOn [2012.07.26. 20:17 ]
Hozzászólás témája:  Re: Ebbe mi a hiba?

a témanév

Szerző:  Silent [2012.07.26. 20:19 ]
Hozzászólás témája:  Re: Ebbe mi a hiba?

Mi a hiba? (Mit írtál át rajta?)

Oldal: 1 / 1 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/