AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   healing? (https://forums.alliedmods.net/showthread.php?t=108695)

drakeris 11-08-2009 08:57

healing?
 
i know its possible but how i cannot figure it out so could anyone here give me a hand nd atelast show how to make for example i press e i start healing others or my self

Arkshine 11-08-2009 09:17

Re: healing?
 
There are plugins which do that, please search.

byetovice 11-08-2009 09:50

Re: healing?
 
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!")
 }




All times are GMT -4. The time now is 17:33.

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