Raised This Month: $ Target: $400
 0% 

[FUN] Player out of range (0)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GhostMan
Senior Member
Join Date: Jun 2012
Old 07-15-2012 , 17:22   [FUN] Player out of range (0)
Reply With Quote #1

What's the problem? :O
PHP Code:
public cmd_box(id)
{
    if(
cs_get_user_team(id) != CS_TEAM_CT)
    {
        
ChatColor(id"%d Si komanda skirta tik priziuretojams."PREFIX)
    }
    else if(
cs_get_user_team(id) == CS_TEAM_CT && !is_user_alive(id))
    {
        
ChatColor(id"%d Turi buti gyvas, noredamas naudoti /box komanda."PREFIX)
    }
    else
    {
        new 
players[32], numTtid
        get_players
playersnumT"ae""TERRORIST" )
    
        if(
numT <= get_pcvar_num(gp_BoxMax) && numT && !g_BoxStarted)
        {
            for(new 
0<= numTi++)
            {
                
tid players[i]
                
set_user_health(tid100)
            }

            
boxon true
            set_cvar_num
("mp_tkpunish"0)
            
set_cvar_num("mp_friendlyfire"1)
            
g_BoxStarted true
            
            set_hudmessage
(025500.080.2422.06.00.050.22)
            
            new 
name[33]; get_user_name(idnamecharsmax(name))
            
ShowSyncHudMsg(0g_HudSync"Priziuretojas %s Ijunge BOKSO rezima!"name)
        }
        else 
        {
            
set_hudmessage(255000.080.2422.06.00.050.22)
            
ShowSyncHudMsg(idg_HudSync"Ijungti BOKSO rezimo dabar negalima!")
        }
    }
    return 
PLUGIN_HANDLED

Quote:
L 07/15/2012 - 23:40:21: [FUN] Player out of range (0)
L 07/15/2012 - 23:40:21: [AMXX] Displaying debug trace (plugin "jb_days_lr.amxx")
L 07/15/2012 - 23:40:21: [AMXX] Run time error 10: native error (native "set_user_health")
L 07/15/2012 - 23:40:21: [AMXX] [0] jb_days_lr.sma::cmd_box (line 450)
GhostMan is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 07-15-2012 , 17:33   Re: [FUN] Player out of range (0)
Reply With Quote #2

PHP Code:
for(new 0<= numTi++)
{
     
tid players[i]
     
set_user_health(tid100)

-->

PHP Code:
for(new 0numTi++)
{
     
tid players[i]
     
set_user_health(tid100)

__________________

Last edited by Emp`; 07-15-2012 at 17:44.
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
micapat
Veteran Member
Join Date: Feb 2010
Location: Nyuu, nyuu (France).
Old 07-15-2012 , 17:45   Re: [FUN] Player out of range (0)
Reply With Quote #3

Don't need to check if players are connected. get_players do that.

The problem is :

PHP Code:
for(new 0numTi++) 
And there are some things which can be optimized ..

PHP Code:
if(cs_get_user_team(id) != CS_TEAM_CT)
{
    
ChatColor(id"%d Si komanda skirta tik priziuretojams."PREFIX)
}
else if(!
is_user_alive(id))
{
    
ChatColor(id"%d Turi buti gyvas, noredamas naudoti /box komanda."PREFIX)

__________________
micapat is offline
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 15:03.


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