AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Aim and add health (https://forums.alliedmods.net/showthread.php?t=140743)

zirualas 10-16-2010 06:44

Aim and add health
 
How i can dow that then I aim on any player and push button +use that give to player +100 hp?

Sylwester 10-16-2010 07:36

Re: Aim and add health
 
try this:
PHP Code:

#include <amxmodx>
#include <fakemeta>
#include <fun>

public plugin_init(){
    
register_plugin("Boost Target HP""1.0""Sylwester")
    
register_forward(FM_CmdStart,"fwd_CmdStart")
}

public 
fwd_CmdStart(iduc_handleseed){
    static use
    if(!(
get_uc(uc_handle,UC_Buttons)&IN_USE)){
        use&=~(
1<<id)
        return
    }
    if(!(use&
1<<id)){
        new 
targetbodypart
        get_user_aiming
(idtargetbodypart)
        if(
is_user_alive(target))
            
set_user_health(targetget_user_health(target)+100)
    }
    use|=
1<<id



zirualas 10-16-2010 09:10

Re: Aim and add health
 
It's working, thx ;]


All times are GMT -4. The time now is 10:24.

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