hello. i have a csgo remake server and i made a csgo agents plugin using this api:
https://forums.alliedmods.net/showthread.php?t=161255
After 15 rounds, the teams are changing using freeze time and set_task (for id 1..8 task 0.1, for id 9..16 task 0.2 etc). The problem is after this freeze time, the server is restarting using sv_restart 1. All good, but for some players the model belongs to the team he was on before sv_restart.
How can i prevent this ?
i don t have the source file for changing team.
this is the code that check player model:
PHP Code:
public plugin_init()
{
RegisterHam(Ham_Spawn, "player", "player_spawn_post", 1)
}
public player_spawn_post(id)
{
if(is_user_alive(id))
{
cs_reset_player_model(id)
if(get_user_team(id) == 1 && g_iPlayerSkin[id][T] == NON_USED_SKIN)
{
return PLUGIN_HANDLED
}
if(get_user_team(id) == 2 && g_iPlayerSkin[id][CT] == NON_USED_SKIN)
{
return PLUGIN_HANDLED
}
if(get_user_team(id) == 1 && g_iPlayerSkin[id][T] != NON_USED_SKIN)
{
new iSkin = g_iPlayerSkin[id][T]
cs_set_player_model(id, g_TSkin[iSkin][szCTSkin])
}
if(get_user_team(id) == 2 && g_iPlayerSkin[id][CT] != NON_USED_SKIN)
{
new iSkin = g_iPlayerSkin[id][CT]
cs_set_player_model(id, g_CTSkin[iSkin][szCTSkin])
}
}
return PLUGIN_CONTINUE
}