Raised This Month: $ Target: $400
 0% 

[HELP] Can this code be made better?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
BioI-Iazard
Senior Member
Join Date: Sep 2005
Location: Calgary, Alberta
Old 10-12-2009 , 14:29   [HELP] Can this code be made better?
Reply With Quote #1

Code:
#include <amxmodx> #include <fun> #include <fakemeta> new regen_hp; new regen_time; new g_Classname[] = "healdelay" public plugin_init() {         register_plugin("Auto-Healer", "1.0", "aaaa"); //previously by CSL and Slmclarengt          regen_hp = register_cvar("AH_hp", "2");             regen_time = register_cvar("AH_time", "2.0");     new Ent = engfunc(EngFunc_CreateNamedEntity,engfunc(EngFunc_AllocString,"info_target"))         set_pev(Ent,pev_classname,g_Classname)         set_pev(Ent,pev_nextthink,get_pcvar_float(regen_time)) } public ForwardThink(Ent) {     static Classname[33]         pev(Ent,pev_classname,Classname,32)         if(!equal(Classname,g_Classname))             return FMRES_IGNORED     static Float: s_glbtime         new players[32],num     for (new counter=0; counter<num; counter++)     {         heal_player(players[counter])     }     global_get(glb_time, s_glbtime)         set_pev(Ent,pev_nextthink, s_glbtime + get_pcvar_float(regen_time))         return FMRES_IGNORED } public heal_player(id) {     new hp=get_user_health(id);     new healed=hp+get_pcvar_num(regen_hp)     if (healed>100)     {         set_user_health(id, 100);     }     else     {         set_user_health(id, healed);     } }
__________________
Loved by Many ....
Hated by Some ....
Respected by All !!!!
BioI-Iazard 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 22:34.


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