AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to understood this error? (https://forums.alliedmods.net/showthread.php?t=129520)

PWA 06-13-2010 16:58

How to understood this error?
 
PHP Code:

L 06/13/2010 23:54:56: [CSTRIKEPlayer out of range (0)
L 06/13/2010 23:54:56: [AMXXDisplaying debug trace (plugin "idday.amxx")
L 06/13/2010 23:54:56: [AMXXRun time error 10native error (native "cs_get_user_team")
L 06/13/2010 23:54:56: [AMXX]    [0idday.sma::Hook_Deathmessage (line 143

This is log from server, what he show me!

Line 143

PHP Code:

        if( cs_get_user_team(killer) == CS_TEAM_T && cs_get_user_team(victim) == CS_TEAM_CT

Full code from that line:
PHP Code:

public Hook_Deathmessage()
{
    {
        
/* --| Get the killer and attacker */
        
new killer read_data);
        new 
victim read_data);
        new 
headshot read_data);

        
/* --| If player has died with world / trigger_hurt */
        
if( killer == victim )
        {
            return 
PLUGIN_HANDLED;
        }
        
        
/* --| Setting killer points when killed a enemy */
        
if( cs_get_user_team(killer) == CS_TEAM_T && cs_get_user_team(victim) == CS_TEAM_CT)
        {
            
playerpoints[killer] += get_pcvar_num(cvar_killpoints)
            
            if(
headshot)
            
playerpoints[killer] += get_pcvar_num(cvar_headshotpoints);
        }
        if( 
cs_get_user_team(killer) == CS_TEAM_CT && cs_get_user_team(victim) == CS_TEAM_T)
        {
            
playerpoints[killer] += get_pcvar_num(cvar_killpointsct)
        
            if(
headshot)
            
playerpoints[killer] += get_pcvar_num(cvar_headshotpointsct);
        }        
        
SaveData(killer)
        
        
set_user_gravityvictim1.0 );    
        
set_user_maxspeedvictim0.0 );
    }
    
    return 
PLUGIN_CONTINUE;


Help me, to fix this sh*t x)

Bugsy 06-13-2010 17:26

Re: How to understood this error?
 
Try replacing yours with

PHP Code:

register_event"DeathMsg" "Hook_Deathmessage" "a" "1>0" ); 


PWA 06-13-2010 18:42

Re: How to understood this error?
 
done, worked out! ;)


All times are GMT -4. The time now is 14:58.

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