#include <amxmodx>
#include <reapi>
new sk_Cvars;
new const PLUGIN[] = "En_Iyi_Smoke";
new const VERSION[] = "1.0";
new const AUTHOR[] = "By.KinG";
new const TAG[] = "SERVER ISMI";
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_event("HLTV", "Event_Round_Start", "a", "1=0", "2=0");
sk_Cvars = register_cvar("bomba_player", "20");
}
public Event_Round_Start()
{
set_task(1.0, "T_Best", 0);
set_task(1.0, "CT_Best", 0);
}
public T_Best(ID)
{
new Players[32], Num_Alive_T, New_ID, Best_T[33], Name[33];
get_players(Players, Num_Alive_T, "aeh", "TERRORIST");
for(new i; i < Num_Alive_T; i++)
{
New_ID = Players[i];
if(get_entvar(New_ID, var_frags) >= get_entvar(Best_T[ID], var_frags))
{
Best_T[ID] = New_ID;
}
}
get_user_name(Best_T[ID], Name, 32);
Renkli_Yazi(0, "^1[^3%s^1] ^4Oyuncu ^3%s ^4En Iyi ^3T ^4Oldugu Icin ^3Smoke ^4ve ^3Flash ^4Kazandi", TAG, Name);
set_task(1.0, "Add_Smoke", Best_T[ID]);
}
public CT_Best(ID)
{
new Players[32], Num_Alive_CT, New_ID, Best_CT[33], Name[33];
get_players(Players, Num_Alive_CT, "aeh", "CT");
for(new i; i < Num_Alive_CT; i++)
{
New_ID = Players[i];
if(get_entvar(New_ID, var_frags) >= get_entvar(Best_CT[ID], var_frags))
{
Best_CT[ID] = New_ID;
}
}
get_user_name(Best_CT[ID], Name, 32);
Renkli_Yazi(0, "^1[^3%s^1] ^4Oyuncu ^3%s ^4En Iyi ^3T ^4Oldugu Icin ^3Smoke ^4ve ^3Flash ^4Kazandi", TAG, Name);
set_task(1.0, "Add_Smoke", Best_CT[ID]);
}
public Add_Smoke(ID)
{
new i_numplayers = get_playersnum(0);
if (i_numplayers < get_pcvar_num(sk_Cvars)) return
else {
rg_give_item(ID, "weapon_smokegrenade");
rg_give_item(ID, "weapon_flashbang");
}
}
stock Renkli_Yazi(const ID, const Input[], any:...)
{
static Message[191];
vformat(Message, 190, Input, 3);
replace_all(Message, 190, "!n", "^x01");
replace_all(Message, 190, "!g", "^x04");
replace_all(Message, 190, "!t", "^x03");
new Count = 1, Players[32];
if(ID) Players[0] = ID; else get_players(Players, Count, "ch");
{
for(new i = 0; i < Count; i++)
{
if(is_user_connected(Players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, Players[i]);
write_byte(Players[i]);
write_string(Message);
message_end();
}
}
}
}