Server keeps crashing with this plugin and I got these errors with debugging:
PHP Code:
L 07/07/2017 - 16:05:47: Start of error session.
L 07/07/2017 - 16:05:47: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20170707.log")
L 07/07/2017 - 16:05:47: [CSTRIKE] Invalid player 18
L 07/07/2017 - 16:05:47: [AMXX] Displaying debug trace (plugin "pub_war.amxx")
L 07/07/2017 - 16:05:47: [AMXX] Run time error 10: native error (native "cs_get_user_team")
L 07/07/2017 - 16:05:47: [AMXX] [0] pub_war_simple.sma::TransferToSpec (line 2034)
L 07/07/2017 - 16:10:14: Start of error session.
L 07/07/2017 - 16:10:14: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20170707.log")
L 07/07/2017 - 16:10:14: [CSTRIKE] Invalid player 19
L 07/07/2017 - 16:10:14: [AMXX] Displaying debug trace (plugin "pub_war.amxx")
L 07/07/2017 - 16:10:14: [AMXX] Run time error 10: native error (native "cs_get_user_team")
L 07/07/2017 - 16:10:14: [AMXX] [0] pub_war_simple.sma::TransferToSpec (line 2034)
Part of code:
Code:
public GoToTheSpec(id)
{
if(g_MatchInit || g_KnifeRound)
{
if(is_user_connected(id))
{
set_task(3.0,"TransferToSpec",id)
}
}
}
//When Client join the server and if match is initialized or Knife round is running transfer player to spec.
public client_putinserver(id)
{
if(g_MatchInit || g_KnifeRound)
{
//Transfer player to spec.
set_task(7.0,"TransferToSpec",id)
}
}
// Transfer a player to spec.
public TransferToSpec(id)
{
new CsTeams:team = cs_get_user_team(id)
if(is_user_connected(id) && !(team == CS_TEAM_SPECTATOR) && !(team == CS_TEAM_UNASSIGNED) )
// if(is_user_connected(id) && !(team == CS_TEAM_UNASSIGNED) )
{
new TransferedName[32]
get_user_name(id, TransferedName, charsmax(TransferedName))
user_silentkill(id)
cs_set_user_team(id, CS_TEAM_SPECTATOR)
}
return PLUGIN_HANDLED
}
Please help.