Raised This Month: $ Target: $400
 0% 

Native error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bibu
Veteran Member
Join Date: Sep 2010
Old 04-07-2011 , 15:57   Native error
Reply With Quote #1

Quote:
L 04/07/2011 - 20:04:15: [CSTRIKE] Invalid player 2
L 04/07/2011 - 20:04:15: [AMXX] Displaying debug trace (plugin "admin_three_chat_colors.amxx")
L 04/07/2011 - 20:04:15: [AMXX] Run time error 10: native error (native "cs_get_user_team")
L 04/07/2011 - 20:04:15: [AMXX] [0] admin_three_chat_colors.sma::hook_say (line 169)
The beginning of the code (init) till line 169:

PHP Code:
register_clcmd("say""hook_say");

public 
hook_say(id)
{
    
#if defined ALLOW_ALLCHAT
    
if(~IsUserAdmin(id))
    {
        new 
someStr[192];
        
read_argv(1someStr191);
        
        if(
IsValidMessage(someStr))
        {
            new 
name[32];
            
get_user_name(idname31);
            
            new 
Message[192];
            
            if(
cs_get_user_team(id) == CS_TEAM_SPECTATOR)
            {
..... 
bibu is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-07-2011 , 16:06   Re: Native error
Reply With Quote #2

It means just player was not connected when cs_get_user_team was executed.

So, add a check to make player is connected. is_user_connected.
__________________
Arkshine is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 04-07-2011 , 16:13   Re: Native error
Reply With Quote #3

Is that really needed in hook_say?

Shall I check before #if defined ALLOW_CHAT if player is connected, otherwise if not, return PLUGIN_HANDLED_MAIN right?
bibu is offline
Reply


Thread Tools
Display Modes

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 20:08.


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