Raised This Month: $ Target: $400
 0% 

healing?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
byetovice
Senior Member
Join Date: Nov 2009
Location: Turkey
Old 11-08-2009 , 09:50   Re: healing?
Reply With Quote #3

try it :
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#define PLUGIN "Healing"
#define VERSION "1.0"
#define AUTHOR "author"
 
public plugin_init() {
 
register_plugin(PLUGINVERSIONAUTHOR)
 
register_clcmd("heal","cmd_heal")
 
register_cvar("amx_heal_persecond","1")
 
}
public 
cmd_heal(id)
{
 new 
Health get_user_health(id)
 if(
Health!=100//if you need healing
 
{
  
set_task(1.0,"plus_hp",id,"",0,"b"//plus_hp for per seconds
 
}
 else
 {
  
client_print(id,print_center,"You dont need healing!")
 }
}
public 
plus_hp(id)
{
 if(
Health!=100//if you need healing
 
{
  
set_user_health(id,get_user_health(id)+get_cvar_num("amx_heal_persecond"))
  
//an example ... sethp(myhp+1)
 
 
}
 else
 {
  
//if your hp is 100, stop the healing
 
remove_task(id)
 
client_print(id,print_chat,"Your healing is stopped!")
 }

byetovice 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 17:33.


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