Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <amxmisc>
- #include <hamsandwich>
- #include <fakemeta>
- #include <fun>
- #define PLUGIN "RegenHP HNS"
- #define VERSION "1.0"
- #define AUTHOR "Tabus"
- #define TASK_REGEN 10000
- new hpToRegen[33]
- new Float:czasOdrodzenia[33]
- public plugin_init() {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- register_logevent("newRound", 2, "1=Round_Start")
- RegisterHam(Ham_TakeDamage, "player", "ham_TakeDamage")
- }
- public ham_TakeDamage(victim, inflictor, attacker, Float:damage, damagebits){
- if( (damagebits & DMG_FALL) && (get_gametime()-czasOdrodzenia[victim] > 10.0 ) ){
- hpToRegen[victim] = floatround(damage*(has_flag(victim, "t") ? 0.8:0.6))
- if( task_exists(TASK_REGEN+victim) )
- remove_task(TASK_REGEN+victim)
- set_task(0.5, "regenHpFall", TASK_REGEN+victim)
- }
- return HAM_IGNORED
- }
- public regenHpFall(id){
- id -= TASK_REGEN
- if( !is_user_alive(id) || !is_user_connected(id) )
- return
- set_user_health(id, get_user_health(id) + hpToRegen[id])
- hpToRegen[id] = 0;
- }
- public newRound(){
- for( new i = 1; i <= get_maxplayers(); i ++ )
- czasOdrodzenia[i] = get_gametime()
- }
- /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
- *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1045\\ f0\\ fs16 \n\\ par }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement