AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Plugin thinks i'm bot (https://forums.alliedmods.net/showthread.php?t=120455)

drekes 03-05-2010 04:00

Plugin thinks i'm bot
 
Hi, i'm working on a xp mod by using fxfighters tutorial.
And for some reason my rank won't upgrade at lvl 10.
After a long hard search i used client_print to find the error.
Now the plugin thinks i'm a bot??
I was killing a bot and playing on a listen server.

here's the deathmsg,
PHP Code:

public PlayerDeath(id ,attacker
{
    
    new 
attacker read_data(1);
    new 
headshot read_data(3);
    new 
clipammoweapon get_user_weapon(attackerclipammo);

    
    
playerxp[attacker] += get_pcvar_num(xp_kill);

    if(
headshot)
        
playerxp[attacker] += get_pcvar_num(xp_hs);

    if(
weapon == CSW_KNIFE)
        
playerxp[attacker] += get_pcvar_num(xp_knife);
            
    while(
playerxp[attacker] >= LEVELS[playerlevel[attacker]]) 
    {
        
playerlevel[attacker] += 1;
        
client_print(attackerprint_chat"Congratulations! You are a level %i %s!",playerlevel[attacker], RANKS[playerrank[attacker]]);
    }
    
    if(
playerlevel[attacker] == 10
    {
        if(!
is_user_connected(attacker))
        {
            
client_print(0print_chat"Not Connected")
        }
            
        if(!
is_user_bot(attacker))
        {
            
client_print(0print_chat"i'm a bot.")
        }
        
client_print(0print_chat"lvl check works.")
        
updaterank(id)
    }
    
showhud(attacker);
    
savedata(attacker);



DarkGod 03-05-2010 04:12

Re: Plugin thinks i'm bot
 
if(!is_user_bot(attacker))
{
client_print(0, print_chat, "i'm a bot.")
}

! = not

Meaning that you're checking if user is not a bot.

drekes 03-05-2010 04:53

Re: Plugin thinks i'm bot
 
:oops:Ow, missed that one, tnx and sorry
I'm so used to writing that.

lazarev 03-05-2010 05:58

Re: Plugin thinks i'm bot
 
btw you have posted in the frong section ^^

drekes 03-05-2010 06:05

Re: Plugin thinks i'm bot
 
ow sorry, did'nt get much sleep this night.
hard to concentrate.

If admin sees this, you may delete this thread


All times are GMT -4. The time now is 08:37.

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