Raised This Month: $51 Target: $400
 12% 

[CSTRIKE] Player out of range (0)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shadow728988
Member
Join Date: Sep 2017
Old 10-13-2017 , 09:29   [CSTRIKE] Player out of range (0)
Reply With Quote #1

So i changed the coding as it was giving too many errors related to invalid player.
But then this is a new one.. Help would be appreciated. Thanks
Code:
L 10/13/2017 - 18:28:28: [CSTRIKE] Player out of range (0)
L 10/13/2017 - 18:28:28: [AMXX] Displaying debug trace (plugin "pub_war.amxx", version "3.2")
L 10/13/2017 - 18:28:28: [AMXX] Run time error 10: native error (native "cs_set_user_team")
L 10/13/2017 - 18:28:28: [AMXX]    [0] _pub_war.sma::Show_PlayersTT (line 436)

PHP Code:
public Show_PlayersTT(idMenuitem)
{
    new 
data[6], iName[64]
    new 
iaccesscallback
    menu_item_getinfo
(Menuitemiaccessdata,5iName63callback)
    
    new 
tempid str_to_num(data)
    new 
uName[33]
    
get_user_name(tempiduNamecharsmax(uName))//
    
    
if(CaptainTT[id])
    {
        
cs_set_user_team(tempidCS_TEAM_T)
        
ColorChat(0NORMAL"^3%s ^4Captain ^3%s ^4Chose ^1Player ^3%s"MS_tagCaptainTT_NameuName)
        
        
TTsCount++
        
        for(new 
i=1i<=g_iMaxplayersi++)
        {
            if(
CaptainCT[i])
            {
                if((
CTsCount TTsCount) <= 32)
                {
                    
SelectCT(i)
                    break
                }
            }
        }
    }
    
SelectionFinish()
        
    
menu_destroy(Menu)
    return 
PLUGIN_HANDLED

shadow728988 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 10-13-2017 , 13:38   Re: [CSTRIKE] Player out of range (0)
Reply With Quote #2

The problem is not in that piece of code. You're trying to set the team of player id 0, which is the server.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:40.


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