Raised This Month: $ Target: $400
 0% 

hp recover plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AvaStIn
Senior Member
Join Date: Feb 2013
Location: Algeria
Old 12-23-2013 , 03:29   hp recover plugin
Reply With Quote #1

im searching for a plugin to recover hp (100 hp) after player fall from a high spot and simply reset his hp after few seconds (100 hp)
__________________
Project : Speedrun / Fastrun / CrazySpeed & [FPS CATEGORY]

o [
||||||||||||||||||||] - 95%

Project : Upgraded Drshop To V6.0

o [||||||||||||||||||||]- 100%

Last edited by AvaStIn; 12-23-2013 at 04:06.
AvaStIn is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 12-23-2013 , 04:23   Re: hp recover plugin
Reply With Quote #2

Try this.

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

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fun>

#define PLUGIN "Recover my Health"
#define VERSION "1.0.0"
#define AUTHOR "Kia"

// !!!
// ===============================================================================
//     WARNING! THIS PLUGIN IS UNTESTED! USE ON OWN RISK!
// ===============================================================================
// !!!

// ===============================================================================
//     Editing begins here
// ===============================================================================

// Time in Seconds for healing HEALTH_AMOUNT Health.
#define HEALTH_INTERVAL 0.5

// Health per HEALTH_INTERVAL
#define HEALTH_AMOUNT 6

// ===============================================================================
//     and stops here. DO NOT MODIFY BELOW UNLESS YOU KNOW WHAT YOU'RE DOING
// ===============================================================================

// ===============================================================================
//     Variables
// ===============================================================================

/* Defines */

#define TASK_ID_RECOVER 1920

#define DMG_FALL (1<<5) 

// ===============================================================================
//     plugin_init
// ===============================================================================

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
/* Hamsandwich */
    
    
RegisterHam(Ham_TakeDamage"player""Ham_PlayerTakeDamgePre"0);
}

// ===============================================================================
//     Ham_PlayerTakeDamgePre - Called when a player is taking Damage
// ===============================================================================

public Ham_PlayerTakeDamgePre(idiInflictoriAttackerFloat:flDamageiDmgBits)
{
    if(
iDmgBits DMG_FALL)
    {
        new 
Float:flTimeToRecover
        
        flTimeToRecover 
= ((100 flDamage) / HEALTH_AMOUNT) * HEALTH_INTERVAL
        
        set_task
(HEALTH_INTERVAL"GivePlayerIntervalHealth"TASK_ID_RECOVER id)
        
set_task(flTimeToRecover"StopRecoverTask"TASK_ID_RECOVER id)
    }
}

// ===============================================================================
//     GivePlayerIntervalHealth - Called after a player falled down
// ===============================================================================

public GivePlayerIntervalHealth(id)
{
    
id -= TASK_ID_RECOVER
    set_user_health
(idget_user_health(id) + HEALTH_AMOUNT)
}
    
// ===============================================================================
//     StopRecoverTask - Stops the plugin giving the player Health
// ===============================================================================

public StopRecoverTask(id)
    
remove_task(id
__________________
Kia is offline
ANTICHRISTUS
kingdom of weird stuff
Join Date: Jun 2010
Location: My kingdom is not in thi
Old 12-23-2013 , 04:37   Re: hp recover plugin
Reply With Quote #3

saw something like this, maybe author is ConnorMcLeod.
__________________
ANTICHRISTUS is offline
Reply


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:31.


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