Raised This Month: $ Target: $400
 0% 

Player Out Of Range


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
shine771
Senior Member
Join Date: Jun 2007
Old 06-10-2007 , 10:15   Player Out Of Range
Reply With Quote #1

I have a problem with my plugin. When i launched my server it gave me this:
Code:
[CSTRIKE] Player out of range (0)
[AMXX] Run time error 10 (plugin "slayer.amxx") (native "cs_get_user_team")
Here's the code:

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define PLUGIN "Team Slayer"
#define VERSION "1.0"
#define AUTHOR "Sh!nE*"

new slayed_tslayed_ctslayed_all

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_concmd("amx_slayer""slay_cmd"ADMIN_SLAY" <@CT @T @ALL>")
    
    
set_task(1.0"check_slay")
}

public 
slay_cmd(idlevelcid)
{
    if (!
cmd_access(idlevelcid3))
        return 
PLUGIN_HANDLED
    
    
new Arg1[5]
    
    
read_argv(1Arg14)
    
    if (
Arg1[0] == '@')
    {
        new 
Team 0
        
if (equali(Arg1[1], "CT"))
        {
            
Team 2
        

        else if (
equali(Arg1[1], "T"))
        {
            
Team 1
        
}
        else if (
equali(Arg1[1], "ALL"))
        {
            
Team 3
            
new players[32], num
            get_players
(playersnum)
            new 
i
            
for (i=0i<numi++)
            {
                if (
Team == 1)
                {
                    
slayed_t 1
                
}
                else if(
Team == 2)
                {
                    
slayed_ct 1
                
}
                else if(
Team == 3)
                {
                    
slayed_all 1
                
}
            }
        }
    }
    return 
PLUGIN_HANDLED
}

public 
check_slay(id)
{    
    new 
CsTeams:team cs_get_user_team(id)
    
    if(
slayed_t == 1)
    {
        if(
team == CS_TEAM_T)
        {
            
user_slap(id99990)
            
slayed_t 0
            
return PLUGIN_CONTINUE
        
}
    }
    
    if(
slayed_ct == 1)
    {
        if(
team == CS_TEAM_CT)
        {
            
user_slap(id99990)
            
slayed_ct 0
            
return PLUGIN_CONTINUE
        
}
    }
    
    if(
slayed_all == 1)
    {
        
user_slap(id99990)
        
slayed_all 0
        
return PLUGIN_CONTINUE
    
}
    
set_task(1.0"check_slay")
    return 
PLUGIN_CONTINUE

Please help me, i'm new to scripting. This is one of my first plugins.
I think i messed up with set_task

Sorry for my bad english.
shine771 is offline
 



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 10:39.


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