Raised This Month: $ Target: $400
 0% 

[REQ] Health Regeneration


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
wTf.
Senior Member
Join Date: Aug 2011
Location: This important?
Old 03-01-2014 , 04:29   Re: [REQ] Health Regeneration
Reply With Quote #6

How do i add time to it? e.g. 10 sec.

EDIT:

this is league of legends games hero master yi feature.I make press e key health regeneration 10 sec.

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

#define TIME_WAIT 10.0
#define TASK_ID_WAIT 1292

enum
{
    
x,
    
y,
    
z
}
new 
bool:g_hp[33], bool:g_time[33], sprites
public plugin_precache() {
    
sprites precache_model("sprites/th_jctf_heal.spr")
}
public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_forward(FM_PlayerPreThink"FwPlayerPreThink"0)
}
public 
FwPlayerPreThink(id) {
    new 
iButtons pev(idpev_button)
    new 
iOButtons pev(idpev_oldbuttons)

    if(
iButtons IN_USE && !(iOButtons IN_USE) && is_user_alive(id) && !g_time[id]) {
        
player_healingEffect(id)
        
g_time[id] = true
        set_task
(TIME_WAIT"FinishTime"TASK_ID_WAIT id)
    }
}
public 
player_healingEffect(id) {
    new 
health pev(idpev_health);
    if(
is_user_connected(id) && !g_hp[id] && is_user_alive(id) && health 100.0) {
        
set_pev(id,pev_healthhealth 1.0)
        
set_view(id,CAMERA_3RDPERSON)
        
g_hp[id] = true
        set_hudmessage
(02550, -1.00.2501.02.00.10.14)
        
show_hudmessage(id,"<< !! MEDITATION !! >>")

        new 
iOrigin[3]
        
get_user_origin(idiOrigin)
        
message_begin(MSG_PVSSVC_TEMPENTITYiOrigin)
        
write_byte(TE_PROJECTILE)
        
write_coord(iOrigin[x] + random_num(-1010))
        
write_coord(iOrigin[y] + random_num(-1010))
        
write_coord(iOrigin[z] + random_num(030))
        
write_coord(0)
        
write_coord(0)
        
write_coord(15)
        
write_short(sprites)
        
write_byte(1)
        
write_byte(id)
        
message_end()
    }
    
set_task(0.2,"player_healingEffect",id)
    
set_task(10.0,"finish",id)
}
public 
finish(id) {
    if(!
is_user_alive(id)) return;

    
set_view(id,CAMERA_NONE)
    
g_hp[id] = false
    remove_task
(id)
}
public 
FinishTime(id) {
    
id -= TASK_ID_WAIT
    g_time
[id] = false
    client_print
(idprint_center,"Try Again !!.")


Last edited by wTf.; 03-01-2014 at 04:55.
wTf. 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:09.


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