AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   cs_get_user_team error invalid player 8 (https://forums.alliedmods.net/showthread.php?t=237325)

proffs 03-22-2014 11:24

cs_get_user_team error invalid player 8
 
Code:

L 03/22/2014 - 09:58:08: [CSTRIKE] Invalid player 8
L 03/22/2014 - 09:58:08: [AMXX] Displaying debug trace (plugin "noohshop.amxx")
L 03/22/2014 - 09:58:08: [AMXX] Run time error 10: native error (native "cs_get_user_team")
L 03/22/2014 - 09:58:08: [AMXX]    [0] nooblevel.sma::noobshop (line 406)



PHP Code:

public levelmodid )

{

        if( 
get_pcvar_numglevelon ) != )

        {

                
ColorChatidGREY"^x04%s^x03 The shop is under^4 Construction^3! It will be opened again soon."prefix)

                return 
PLUGIN_HANDLED

        
}

        

        if( 
cs_get_user_teamid ) == CS_TEAM_CT )

        {

                return 
PLUGIN_HANDLED

        
}

 

        new 
szText555 char ]

        
formatexszTextcharsmaxszText ), "\wnoob^n\WWW.dfgdfg/^n\rJB Dollar:\d %d^n\rPage:\d^n\dNades:"gKillerPointsid ] )

        new 
menu menu_createszText"shop_handler" )


    
        
formatexszTextcharsmaxszText ), "\wHE Nade \y%d\w JB Dollar",  get_pcvar_numgHeCost ) )

        
menu_additemmenuszText"1")
    
        
    

        
menu_setpropmenuMPROP_EXITMEXIT_ALL )

        
menu_displayidmenu)

 

        return 
PLUGIN_HANDLED



Instead of it returning can I make color chat instead like: This is only for Terrorist?

ironskillz1 03-22-2014 11:46

Re: cs_get_user_team error invalid player 8
 
You need to check if user is connected.

proffs 03-22-2014 12:00

Re: cs_get_user_team error invalid player 8
 
Quote:

Originally Posted by ironskillz1 (Post 2114518)
You need to check if user is connected.

PHP Code:

 if( cs_get_user_teamid ) == CS_TEAM_CT == is_user_aliveid ) )

        { 

Like this?

ironskillz1 03-22-2014 12:11

Re: cs_get_user_team error invalid player 8
 
Quote:

Originally Posted by proffs (Post 2114525)
PHP Code:

 if( cs_get_user_teamid ) == CS_TEAM_CT == is_user_aliveid ) )

        { 

Like this?

No that will not work

like this.
Code:

if( cs_get_user_team( id ) == CS_TEAM_CT || !is_user_connected( id ) )

Black Rose 03-22-2014 13:28

Re: cs_get_user_team error invalid player 8
 
Quote:

Originally Posted by ironskillz1 (Post 2114528)
No that will not work

like this.
Code:

...

Switch them around and you're good.

proffs 03-22-2014 13:35

Re: cs_get_user_team error invalid player 8
 
Quote:

Originally Posted by ironskillz1 (Post 2114518)
You need to check if user is connected.

Quote:

Originally Posted by Black Rose (Post 2114564)
Switch them around and you're good.

Like this:
PHP Code:

if( !is_user_connectedid ) || cs_get_user_teamid ) == CS_TEAM_CT )

        { 

???

Black Rose 03-22-2014 13:47

Re: cs_get_user_team error invalid player 8
 
Exactly.

proffs 03-22-2014 13:54

Re: cs_get_user_team error invalid player 8
 
Quote:

Originally Posted by Black Rose (Post 2114575)
Exactly.

Thanks, can you help me with the other thread?


All times are GMT -4. The time now is 06:03.

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