Hi,
I have searched already but didn't found anything about my problem. I would like to check spectators and kick them after a defined time.
If I use cs_get_user_team then I get some errors like "invalid player". What's wrong with my code?
Code:
// Alle Spieler überprüfen
for (new id = 1; id <= g_iMaxPlayers; id++){
new CsTeams:eTeam = cs_get_user_team(id)
if (eTeam == CS_TEAM_SPECTATOR || eTeam == CS_TEAM_UNASSIGNED){
g_iTime[id]++
if (g_iTime[id] >= 10){
func_kick_player(id)
}
}
I have also tried to use only get_user_team and check for 0 but that won't work if a player transferred by cs_set_user_team. Is there a secured function to catch the team? Like an offset?
Thanks a lot for your help!