Raised This Month: $ Target: $400
 0% 

HELP with plugin!


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
totalcsscripting
BANNED
Join Date: Jul 2010
Old 07-26-2010 , 23:04   HELP with plugin!
Reply With Quote #1

PHP Code:
public admin_heal(id,level,cid) {
    if (!
cmd_access(id,level,cid,3))
        return 
PLUGIN_HANDLED
    
new arg[32], arg2[8], name2[32]
    
read_argv(1,arg,31)
    
read_argv(2,arg2,7)
    
get_user_name(id,name2,31)
    if (
arg[0]=='@'){
        new 
players[32], inum
        get_players
(players,inum,"ae",arg[1])
        if (
inum==0){
            
console_print(id,"")
            return 
PLUGIN_HANDLED
        
}
        for(new 
a=0;a<inum;++a) {
            new 
user_health get_user_health(players[a])
            
set_user_health(players[a], str_to_num(arg2) + user_health)
        }
        switch(
get_cvar_num("amx_show_activity")) {
            case 
2:    client_print(0,print_chat,"",name2,arg[1])
            case 
1:    client_print(0,print_chat,"",arg[1])
        }
        
console_print(id,"")
    }
    else {
        new 
player cmd_target(id,arg,7)
        if (!
player) return PLUGIN_HANDLED
        
new user_health get_user_health(player)
        
set_user_health(playerstr_to_num(arg2) + user_health)
        new 
name[32]
        
get_user_name(player,name,31)
        switch(
get_cvar_num("amx_show_activity"))    {
            case 
2:    client_print(0,print_chat,"",name2,name)
            case 
1:    client_print(0,print_chat,"",name)
        }
        
console_print(id,"",name)
    }
    return 
PLUGIN_HANDLED


Y have this part of a plugin. When i call it i put:
amx_heal "name" "150"

and gaves me 150 more health. But i want to put that if i put:
amx_heal "name" "-100"

return my health to 100.
or y put:
amx_heal "name" "-50" and my heal goes to 50.

Last edited by totalcsscripting; 07-27-2010 at 01:32.
totalcsscripting 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 00:17.


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