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=13519)

n0obie4life 05-19-2005 10:30

healing
 
i'm making a healing plugin that will be diff from the rest, just some questions here.

how do i make it like

I have 50 hp at the start. then this medic comes to me,he heals me up and it goes this way:

every 2 seconds he heals 3 hp for me.

so its like

53,56,59,62,65,68,71,74,77,80...etc..

then when it reaches 100 it stops.

and how do i make it like that the medic must aim at the person to heal him and must be VERY CLOSE to him (like as in almost touching him)

Belsebub 05-19-2005 11:20

you can use get_user_aiming
from the amxmodx.inc:

/* If player doesn't hit at anything function returns 0.0,
* in other case the distance between hit point and player is returned.
* If player is aiming at another player then the id and part of body are set. */
native Float:get_user_aiming(index,&id,&body,dist=99 99);

maybe can do it something like this:

Code:
public heal(id) {         new targetid, body, distance         get_user_aiming(id, targetid, body, distance)         if (targetid && distance <= 100) {             set_user_health(targetid, get_user_health(targetid) + 3)         }     return PLUGIN_HANDLED }

and add a check so the player cant heal over 100 hp

n0obie4life 05-20-2005 23:07

aye thanks.


All times are GMT -4. The time now is 16:39.

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