Raised This Month: $ Target: $400
 0% 

Solved Problem with zp_giveap plugin command


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
GasmoN
Member
Join Date: Jul 2014
Old 02-12-2017 , 12:50   Problem with zp_giveap plugin command
Reply With Quote #1

When i tupe zp_giveap SomeName 100, it will give 100 ammo packs to player.
But when i type zp_giveap @ALL 100, command doesn't work. Can someone tell me why?

PHP Code:
public CmdGiveAP idlevelcid )
{
    if(!
cmd_access(id,level,cid,1)) return PLUGIN_HANDLED
    
    
new arg_name[32],arg_ap[10]
    
    
read_argv(1,arg_name,31)
    
read_argv(2,arg_ap,9)
    
    new 
name[32],target_name[32], ip[16],target_ip[16], steamid[32],target_steamid[32],
    
targetnum_ap str_to_num(arg_ap)
    
    if(!
equali(arg_name,"@ALL")) target cmd_target(id,arg_name,0)
    
    
get_user_name(id,name,31)
    
get_user_ip(id,ip,15,1)
    
get_user_authid(id,steamid,31)
    
    
get_user_name(target,target_name,31)
    
get_user_ip(target,target_ip,15,1)
    
get_user_authid(target,target_steamid,31)
    
    if(
num_ap <= 0)
    {
        
console_print(id,"[ZP] You can give only positive ammo packs.")
        return 
PLUGIN_HANDLED
    
}
    
    if(!
target)
    return 
PLUGIN_HANDLED;
    
    if(
equali(arg_name,"@ALL"))
    {
        for(new 
i=1;i<33;i++) if(is_user_connected(i)) zp_ammopacks_set(izp_ammopacks_get(i) + num_ap)
        
client_printc(id"!g%s %L"PREFIXLANG_PLAYER"AP_AMMOTOALL"namenum_ap)
    } 
    else 
    {
        
zp_ammopacks_set(targetzp_ammopacks_get(target) + num_ap)
        
client_printc(target"!g%s !n%L"PREFIXLANG_PLAYER"AP_GIVEAP"namenum_ap)
    }
    
    return 
PLUGIN_HANDLED
    


Last edited by GasmoN; 02-12-2017 at 14:17.
GasmoN is offline
 


Thread Tools
Display Modes

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 20:27.


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