Raised This Month: $51 Target: $400
 12% 

Solved Run time error 10: native error (native "cs_get_user_team")


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
WhiteFang1319
Senior Member
Join Date: Jan 2017
Old 07-07-2017 , 13:34   Run time error 10: native error (native "cs_get_user_team")
Reply With Quote #1

Server keeps crashing with this plugin and I got these errors with debugging:
PHP Code:
L 07/07/2017 16:05:47Start of error session.
L 07/07/2017 16:05:47Info (map "de_dust2") (file "addons/amxmodx/logs/error_20170707.log")
L 07/07/2017 16:05:47: [CSTRIKEInvalid player 18
L 07
/07/2017 16:05:47: [AMXXDisplaying debug trace (plugin "pub_war.amxx")
L 07/07/2017 16:05:47: [AMXXRun time error 10native error (native "cs_get_user_team")
L 07/07/2017 16:05:47: [AMXX]    [0pub_war_simple.sma::TransferToSpec (line 2034)
L 07/07/2017 16:10:14Start of error session.
L 07/07/2017 16:10:14Info (map "de_dust2") (file "addons/amxmodx/logs/error_20170707.log")
L 07/07/2017 16:10:14: [CSTRIKEInvalid player 19
L 07
/07/2017 16:10:14: [AMXXDisplaying debug trace (plugin "pub_war.amxx")
L 07/07/2017 16:10:14: [AMXXRun time error 10native error (native "cs_get_user_team")
L 07/07/2017 16:10:14: [AMXX]    [0pub_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.

Last edited by WhiteFang1319; 07-10-2017 at 10:30. Reason: Problem Solved
WhiteFang1319 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 07-07-2017 , 22:06   Re: Run time error 10: native error (native "cs_get_user_team")
Reply With Quote #2

Code:
// 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
}
-->
Code:
// Transfer a player to spec.
public TransferToSpec(id)
{
	if(is_user_connected(id))
	{
		new CsTeams:team = cs_get_user_team(id)

		if(!(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
}
zmd94 is offline
WhiteFang1319
Senior Member
Join Date: Jan 2017
Old 07-10-2017 , 10:29   Re: Run time error 10: native error (native "cs_get_user_team")
Reply With Quote #3

Quote:
Originally Posted by zmd94 View Post
Code:
// 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
}
-->
Code:
// Transfer a player to spec.
public TransferToSpec(id)
{
	if(is_user_connected(id))
	{
		new CsTeams:team = cs_get_user_team(id)

		if(!(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
}
Thank you It's working properly now
WhiteFang1319 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 07-28-2017 , 09:27   Re: Run time error 10: native error (native "cs_get_user_team")
Reply With Quote #4

Welcome.
zmd94 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:39.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode