Raised This Month: $ Target: $400
 0% 

FM_Touch ?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
bwgrubbs1
Senior Member
Join Date: Sep 2006
Old 06-17-2007 , 09:01   FM_Touch ?
Reply With Quote #1

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");     } }
bwgrubbs1 is offline
 


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 10:42.


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