AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Little problem with cs_get_user_team (https://forums.alliedmods.net/showthread.php?t=128403)

KadiR 05-31-2010 17:27

Little problem with cs_get_user_team
 
I can't exactly find where the error is, but this is the log:
Quote:

L 05/31/2010 - 22:07:17: [CSTRIKE] Player out of range (128)
L 05/31/2010 - 22:07:17: [AMXX] Displaying debug trace (plugin "freerun.amxx")
L 05/31/2010 - 22:07:17: [AMXX] Run time error 10: native error (native "cs_get_user_team")
L 05/31/2010 - 22:07:17: [AMXX] [0] freerun.sma::Kill_Ct (line 226)
Code:

PHP Code:

register_event("DeathMsg""Kill_Ct""a""1>0"); 

PHP Code:

public Kill_Ct() 
{
    if (!
get_pcvar_num(g_KillHP))
        return;
    
    new 
killer read_data(1);
    new 
victim read_data(2);
    
    if ((
killer != victim && g_bFreerun && g_bGiveHealthToT )
    && 
cs_get_user_team(victim) == CS_TEAM_CT
    
&& cs_get_user_team(killer) == CS_TEAM_T)
    {
        
set_user_health(killer1);
        
client_cmdkiller"spk ^"%s^""KIT_SOUND );
    }



Exolent[jNr] 05-31-2010 17:30

Re: Little problem with cs_get_user_team
 
You have to check if killer is a player.

KadiR 05-31-2010 17:37

Re: Little problem with cs_get_user_team
 
Do you mean something like this?

PHP Code:

#define IsPlayer(%1)    (1<=%1<=g_maxplayers) 


fysiks 05-31-2010 17:39

Re: Little problem with cs_get_user_team
 
Yes.

ConnorMcLeod 06-01-2010 01:47

Re: Little problem with cs_get_user_team
 
+ is_user_connected, suppose you die + disconnect while holding a ready to explode nade...


All times are GMT -4. The time now is 05:23.

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