Quote:
Originally Posted by padilha007
my mod transfer all players to terrorists on roundstart, so if anyone go to ct the event start.
|
Is that what you need?
Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#define OFFSET_TEAM 114
new g_Msg_TeamInfo;
public plugin_init()
{
RegisterHam(Ham_Spawn, "player", "Forward_Spawn");
g_Msg_TeamInfo = get_user_msgid("TeamInfo");
}
public Forward_Spawn(id)
{
if(get_user_team(id) != 1)
{
fm_set_user_team(id, 1);
}
}
fm_set_user_team(index, team)
{
set_pdata_int(index, OFFSET_TEAM, team);
dllfunc(DLLFunc_ClientUserInfoChanged, index, engfunc(EngFunc_GetInfoKeyBuffer, index));
message_begin(MSG_ALL, g_Msg_TeamInfo);
write_byte(index);
static Teams[][] =
{
"", // LOL NULL
"TERRORIST",
"CT",
"SPECTATOR"
}
write_string(Teams[team]);
message_end();
}
__________________