Raised This Month: $ Target: $400
 0% 

healing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
n0obie4life
Veteran Member
Join Date: Dec 2004
Old 05-19-2005 , 10:30   healing
Reply With Quote #1

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)
__________________
Plugins:
none

n0obie4life is offline
Belsebub
Senior Member
Join Date: Feb 2005
Location: Sweden
Old 05-19-2005 , 11:20  
Reply With Quote #2

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
Belsebub is offline
n0obie4life
Veteran Member
Join Date: Dec 2004
Old 05-20-2005 , 23:07  
Reply With Quote #3

aye thanks.
__________________
Plugins:
none

n0obie4life is offline
Reply


Thread Tools
Display Modes

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 16:39.


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