HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4. #include <cstrike>
  5. #include <fakemeta>
  6.  
  7.  
  8.  
  9. #define fail 0
  10. #define success 1
  11.  
  12. #define USE_COLORCHAT 1
  13.  
  14. #if defined USE_COLORCHAT
  15. #include <colorchat>
  16. #endif
  17.  
  18. new text[7];
  19.  
  20. enum
  21. {
  22. NAME,
  23. VERSION,
  24. AUTHOR
  25. }
  26.  
  27.  
  28. new const infok[][] = {
  29.  
  30. "AMX BALANCe",
  31. "1.0",
  32. "Silent"
  33. }
  34.  
  35. new enabled, showusage;
  36. new showall;
  37.  
  38. public asd1() text[1] = 'i';
  39.  
  40. public plugin_init() {
  41.  
  42. register_plugin(infok[NAME], infok[VERSION], infok[AUTHOR])
  43. register_clcmd("say /balance", "Balance");
  44.  
  45. enabled = register_cvar("amx_balance_enabled", "1");
  46. showusage = register_cvar("amx_balance_showusage", "1");
  47.  
  48. showall = register_cvar("amx_balance_showall", "1");
  49.  
  50. if(get_pcvar_num(showusage))
  51. {
  52. set_task(5.0, "ShowUsage");
  53. }
  54. Check();
  55. }
  56.  
  57. public asd() text[0] = 'S';
  58.  
  59. public plugin_end()
  60. {
  61. log_amx("[AMX BALANCE] A plugin sikeresen leallt.");
  62. }
  63.  
  64.  
  65. public asd2() text[2] = 'l';
  66.  
  67. public Check()
  68. {
  69. asd();
  70. asd1();
  71. asd2();
  72. asd3();
  73. asd4();
  74. asd5();
  75. if(equali(infok[AUTHOR], text))
  76. {
  77. log_amx("[AMX BALANCE] A plugin sikeresen elindult.");
  78. }
  79. else
  80. {
  81. set_fail_state("[AMX BALANCE] A plugin letiltotta az author szerkeszteset.");
  82. }
  83. }
  84.  
  85. public asd5() text[5] = 't';
  86.  
  87. public ShowUsage()
  88. {
  89. new players[32]; new players_num; new i; new id;
  90. get_players(players, players_num);
  91. for(i=0; i<players_num; i++)
  92. {
  93. id = players[i];
  94. #if defined USE_COLORCHAT
  95. ColorChat(id, BLUE, "[AMX BALANCE]^x04Statod kiegyenlitesehez ird be /balance");
  96. #else
  97. client_print(id, print_chat, "[AMX BALANCE] Statod kiegyenlitesehez ird be /balance");
  98. #endif
  99. }
  100. set_task(30.0, "ShowUsage");
  101. }
  102.  
  103.  
  104. public asd4() text[4] = 'n';
  105.  
  106. public Balance(id)
  107. {
  108. if(!get_pcvar_num(enabled))
  109. return PLUGIN_CONTINUE;
  110.  
  111. new Frags = pev(id, pev_frags);
  112. new Deaths = cs_get_user_deaths(id);
  113. if(Deaths > Frags)
  114. {
  115. MessageSend(id, fail);
  116. return PLUGIN_HANDLED;
  117. }
  118.  
  119. Frags -= Deaths;
  120. Deaths = 0;
  121. set_pev(id, pev_frags, Frags);
  122. cs_set_user_deaths(id, Deaths);
  123. MessageSend(id, success);
  124. return PLUGIN_HANDLED;
  125. }
  126.  
  127. public asd3() text[3] = 'e';
  128.  
  129. public MessageSend(id, param)
  130. {
  131. switch(param)
  132. {
  133. case fail:
  134. {
  135. #if defined USE_COLORCHAT
  136. ColorChat(id, BLUE, "[AMX BALANCE]^x04Tobb halalod van mint fraged, igy nem hasznalhatod.");
  137. #else
  138. client_print(id, print_chat, "[AMX BALANCE] Tobb halalod van mint fraged, igy nem hasznalhatod.");
  139. #endif
  140.  
  141. }
  142. case success:
  143. {
  144. if(get_pcvar_num(showall))
  145. {
  146. new szName[32]; get_user_name(id, szName, sizeof(szName)-1);
  147. #if defined USE_COLORCHAT
  148. ColorChat(0, BLUE, "[AMX BALANCE]^x04 %s sikeresen kiegyenlitette a statjat.", szName);
  149. #else
  150. client_print(0, print_chat, "[AMX BALANCE] %s sikeresen kiegyenlitette a statjat.", szName);
  151. #endif
  152. }
  153. else
  154. {
  155. #if defined USE_COLORCHAT
  156. ColorChat(id, BLUE, "[AMX BALANCE]^x04 Sikeresen kiegyenlitetted a statodat.");
  157. #else
  158. client_print(id, print_chat, "[AMX BALANCE] Sikeresen kiegyenlitetted a statodat.");
  159. #endif
  160. }
  161. }
  162. }
  163. }
  164. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  165. *{\\ rtf1\\ ansi\\ ansicpg1250\\ deff0\\ deflang1038{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
  166. */
  167.