Bulunduğu Kütüphane: Amxmodx
İşlevi: Belirlediğiniz Ayarlar Doğrultusunda Oyuncu Sayısını Çeker.
Örnek Eklenti:
PHP Kod:
#include <amxmodx>
new const PLUGIN[] = "Get_Players";
new const VERSION[] = "1.0";
new const AUTHOR[] = "By.KinG";
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_event("HLTV", "Event_Round_Start", "a", "1=0", "2=0");
}
public Event_Round_Start()
{
new Players[32], Num_All;
get_players(Players, Num_All);
Renkli_Yazi(0, "!t[BILGI] !gOyuncu Sayisi !n: !t%d", Num_All);
}
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");
#if AMXX_VERSION_NUM < 183
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();
}
}
}
#else
client_print_color(ID, ID, Message);
#endif
}
PHP Kod:
#include <amxmodx>
new const PLUGIN[] = "Get_Players";
new const VERSION[] = "1.0";
new const AUTHOR[] = "By.KinG";
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_event("HLTV", "Event_Round_Start", "a", "1=0", "2=0");
}
public Event_Round_Start()
{
new Players[32], Num_Alive_T;
get_players(Players, Num_Alive_T, "aceh", "TERRORIST");
Renkli_Yazi(0, "!t[BILGI] !gT Takimindaki Yasayan, Bot ve HLTV Olmayan Oyuncu Sayisi !n: !t%d", Num_Alive_T);
}
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");
#if AMXX_VERSION_NUM < 183
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();
}
}
}
#else
client_print_color(ID, ID, Message);
#endif
}
)


