Thread: [Solved] [HELP] attack 250 hp = 1 ap
View Single Post
Author Message
spooky HL15
Member
Join Date: Oct 2015
Old 03-19-2018 , 15:10   [HELP] attack 250 hp = 1 ap
Reply With Quote #1

hi, everone i have problem with this scripting
i want make plugin for mod base builder for CT
when CT attack zombie every 250 damage CT will win 1 ap

i try to make it but not working
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "attack 250 hp = 1 ap"
#define VERSION "1.0"
#define AUTHOR "test"

native bb_get_ap1(id)

new 
pg_dmg

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
pg_dmg=register_cvar("bb_hpap","250"
    
register_event("Damage""Damage""b""2!=0")
}
public 
Damage(id)
{
    new 
damage read_data(2)
    new 
tid get_user_attacker(id)    // Gracz atakujacy
    
if(tid==id || !tid || !is_user_alive(tid)) return PLUGIN_HANDLED
    
while(damage>=get_pcvar_num(pg_dmg)){
        
damage-=get_pcvar_num(pg_dmg)
        
        
bb_get_ap1(id)
    }
    return 
PLUGIN_CONTINUE
    



sorry for my bad english

Last edited by spooky HL15; 04-02-2018 at 15:58.
spooky HL15 is offline