Bulunduğu Kütüphane: Amxmodx
İşlevi: Index'in Olduğu Takımı Çeker.
Örnek Eklenti:
PHP Kod:
#include <amxmodx>
new const PLUGIN[] = "Get_User_Team";
new const VERSION[] = "1.0";
new const AUTHOR[] = "By.KinG";
new const TAG[] = "WebAilesi GaminG";
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, New_ID;
get_players(Players, Num_All);
for(new i; i < Num_All; i++)
{
New_ID = Players[i];
switch(get_user_team(New_ID))
{
case 1 : Renkli_Yazi(New_ID, "^1[^3%s^1] ^4Bulundugun Takim ^1: ^3Terrorist", TAG);
case 2 : Renkli_Yazi(New_ID, "^1[^3%s^1] ^4Bulundugun Takim ^1: ^3Counter Terrorist", TAG);
case 3 : Renkli_Yazi(New_ID, "^1[^3%s^1] ^4Bulundugun Takim ^1: ^3Spectator", TAG);
}
}
}
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
}
)

