AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Checking teams error (https://forums.alliedmods.net/showthread.php?t=143280)

Gadzislaw007 11-17-2010 08:52

Checking teams error
 
PHP Code:

public client_connect(id)
{
    
champion[id] = random_num(0,15)
    
    
check_champion(id)
}

[...]

public 
check_champion(id)
{
    for (new 
132i++)
    {
        if(
is_user_connected(i) && != id)
        {
            new 
name1[32], name2[32]
            
get_user_name(iname1charsmax(name1))
            
get_user_name(idname2charsmax(name2))

            new 
CsTeams:userTeam cs_get_user_team(id)
            new 
CsTeams:oppTeam cs_get_user_team(i)

            if(
userTeam == oppTeam)
            {
                
                if(
champion[id] == champion[i])
                {
                
                
champion[id] = random_num(0,15)
                
check_champion(id)
                }
    
            }


        }
    }
}

[...] 

Code:

[P*D]Pseudolukian (97) connected
[P*D]Pseudolukian (97) is joining the Terrorist force
L 11/17/2010 - 14:42:03: [CSTRIKE] Invalid player 6
L 11/17/2010 - 14:42:03: [AMXX] Displaying debug trace (plugin "z_League.amxx")
L 11/17/2010 - 14:42:03: [AMXX] Run time error 10: native error (native "cs_get_user_team")
L 11/17/2010 - 14:42:03: [AMXX]    [0] z_League.sma::check_champion (line 156)
L 11/17/2010 - 14:42:03: [AMXX]    [1] z_League.sma::client_connect (line 99)

line 99 is check_champion(id)
line 156 is if(userTeam == oppTeam)

Everything in check_champion what's before line 156 is working.

Any ideas, what's wrong?

ARES[ro] 11-17-2010 09:29

Re: Checking teams error
 
is_user_connected(id)


All times are GMT -4. The time now is 11:19.

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