/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#define fail 0
#define success 1
#define USE_COLORCHAT 1
#if defined USE_COLORCHAT
#include <colorchat>
#endif
new text[7];
enum
{
NAME,
VERSION,
AUTHOR
}
new const infok[][] = {
"AMX BALANCe",
"1.0",
"Silent"
}
new enabled, showusage;
new showall;
public asd1() text[1] = 'i';
public plugin_init() {
register_plugin(infok[NAME], infok[VERSION], infok[AUTHOR])
register_clcmd("say /balance", "Balance");
enabled = register_cvar("amx_balance_enabled", "1");
showusage = register_cvar("amx_balance_showusage", "1");
showall = register_cvar("amx_balance_showall", "1");
if(get_pcvar_num(showusage))
{
set_task(5.0, "ShowUsage");
}
Check();
}
public asd() text[0] = 'S';
public plugin_end()
{
log_amx("[AMX BALANCE] A plugin sikeresen leallt.");
}
public asd2() text[2] = 'l';
public Check()
{
asd();
asd1();
asd2();
asd3();
asd4();
asd5();
if(equali(infok[AUTHOR], text))
{
log_amx("[AMX BALANCE] A plugin sikeresen elindult.");
}
else
{
set_fail_state("[AMX BALANCE] A plugin letiltotta az author szerkeszteset.");
}
}
public asd5() text[5] = 't';
public ShowUsage()
{
new players[32]; new players_num; new i; new id;
get_players(players, players_num);
for(i=0; i<players_num; i++)
{
id = players[i];
#if defined USE_COLORCHAT
ColorChat(id, BLUE, "[AMX BALANCE]^x04Statod kiegyenlitesehez ird be /balance");
#else
client_print(id, print_chat, "[AMX BALANCE] Statod kiegyenlitesehez ird be /balance");
#endif
}
set_task(30.0, "ShowUsage");
}
public asd4() text[4] = 'n';
public Balance(id)
{
if(!get_pcvar_num(enabled))
return PLUGIN_CONTINUE;
new Frags = pev(id, pev_frags);
new Deaths = cs_get_user_deaths(id);
if(Deaths > Frags)
{
MessageSend(id, fail);
return PLUGIN_HANDLED;
}
Frags -= Deaths;
Deaths = 0;
set_pev(id, pev_frags, Frags);
cs_set_user_deaths(id, Deaths);
MessageSend(id, success);
return PLUGIN_HANDLED;
}
public asd3() text[3] = 'e';
public MessageSend(id, param)
{
switch(param)
{
case fail:
{
#if defined USE_COLORCHAT
ColorChat(id, BLUE, "[AMX BALANCE]^x04Tobb halalod van mint fraged, igy nem hasznalhatod.");
#else
client_print(id, print_chat, "[AMX BALANCE] Tobb halalod van mint fraged, igy nem hasznalhatod.");
#endif
}
case success:
{
if(get_pcvar_num(showall))
{
new szName[32]; get_user_name(id, szName, sizeof(szName)-1);
#if defined USE_COLORCHAT
ColorChat(0, BLUE, "[AMX BALANCE]^x04 %s sikeresen kiegyenlitette a statjat.", szName);
#else
client_print(0, print_chat, "[AMX BALANCE] %s sikeresen kiegyenlitette a statjat.", szName);
#endif
}
else
{
#if defined USE_COLORCHAT
ColorChat(id, BLUE, "[AMX BALANCE]^x04 Sikeresen kiegyenlitetted a statodat.");
#else
client_print(id, print_chat, "[AMX BALANCE] Sikeresen kiegyenlitetted a statodat.");
#endif
}
}
}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1250\\ deff0\\ deflang1038{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/