AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   run time eror (https://forums.alliedmods.net/showthread.php?t=171577)

dineizen 11-07-2011 17:41

run time eror
 
L 11/08/2011 - 00:46:25: [AMXX] Displaying debug trace (plugin "Jail1.amxx") L 11/08/2011 - 00:46:25: [AMXX] Run time error 10: native error (native "cs_get_user_team") L 11/08/2011 - 00:46:25: [AMXX] [0] Jail1.sma::client_damage (line 2607)

PHP Code:

public client_damage(victimentidattackerFloat:damagedamagebits

    if (
g_rebel[attacker] == true)  
    { 
        return 
PLUGIN_HANDLED
    } 
    
    new 
name_t[32
    
get_user_name(attackername_t31
    if(
cs_get_user_team(attacker) == CS_TEAM_T && cs_get_user_team(victim) == CS_TEAM_CT
    {     
        
g_rebel[attacker] = true 
        ColorChat
(0RED"^4[ ^1Extreme^4 ]^4 Prisoner ^1%s^4 is a rebel!"name_t
    } 
    return 
PLUGIN_HANDLED


This the line with problem
if(cs_get_user_team(attacker) == CS_TEAM_T && cs_get_user_team(victim) == CS_TEAM_CT)
what to do how i fix this line

fysiks 11-07-2011 19:25

Re: run time eror
 
I think you may need to check if the attacker is connected first.

dineizen 11-08-2011 06:55

Re: run time eror
 
if(is_user_connected(attacker)
??

Blue Snake. 11-08-2011 11:43

Re: run time eror
 
PHP Code:

if ( !is_user_connected(attacker) )
    return 
PLUGIN_HANDLED 



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

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