The error that this cause is that: When respawning a player there are times when it was as a spectator, Instead of reviving
The method that i'm using is this:
PHP Code:
ExecuteHamB( Ham_CS_RoundRespawn, id );
To try to solve the problem i have done this small code:
PHP Code:
if (!can_spawn(id)) return;
{
//revive
}
stock can_spawn(id)
{
if(cs_get_user_team(id) == CS_TEAM_SPECTATOR || cs_get_user_team(id) == CS_TEAM_UNASSIGNED || is_user_alive(id))
return false
return true
}
The problem is that it is not working and moreover i strip this error:
Code:
L 07/07/2010 - 23:53:17: Start of error session.
L 07/07/2010 - 23:53:17: Info (map "de_train") (file "addons/amxmodx/logs/error_20100707.log")
L 07/07/2010 - 23:53:17: [CSTRIKE] Invalid player 9
L 07/07/2010 - 23:53:17: [AMXX] Displaying debug trace (plugin "respawn.amxx")
L 07/07/2010 - 23:53:17: [AMXX] Run time error 10: native error (native "cs_get_user_team")
L 07/07/2010 - 23:53:17: [AMXX] [0] deathmatch.sma::can_spawn (line 51)
L 07/07/2010 - 23:53:17: [AMXX] [1] deathmatch.sma::revive (line 35)