How would i add something like this to my code...if you are touching an entity, then i want it to continuously call a function.
Code:
register_forward(FM_Touch, "fwdTouch", 0);
how do i set it up in there to call this function
Code:
public give_health(id)
{
new temp = get_user_health(id);
if(temp >= 99)
{
set_user_health(id, 100);
}
else
{
temp += 2;
set_user_health(id, temp);
}
return PLUGIN_HANDLED;
}
from in here ?
Code:
public fwdTouch(ptr, ptd)
{
//only if i am touching a certain entity.
//specifically one that I created.
else if( equal(szClassname, "healer", 0) )
{
//NOT sure...where do i put this...
//or is there a way to do this with set_pev
//set_task(1.0,"give_health",ptd,"",0,"b");
}
}