Raised This Month: $ Target: $400
 0% 

Fake Natives Question [Solved]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 11-18-2007 , 10:28   Fake Natives Question [Solved]
Reply With Quote #1

In Hawk's Tutorial on Dynamic/Fake Natives, he provides the below example of usage.

My question is how to use the function that serves as the code for the native within this base plugin.

Code:
#include <amxmodx> #include <fun> public plugin_init()     register_plugin("Dynamic Native Test - Handler","1.0","Hawk552")     public plugin_natives() {     register_library("dyn_test")         register_native("half_user_hp","_half_user_hp") } public _half_user_hp(iPlugin,iParams) {     if(iParams != 1)         return PLUGIN_CONTINUE             new id = get_param(1)     if(!id)         return PLUGIN_CONTINUE             set_user_health(id,get_user_health(id) / 2)         return PLUGIN_HANDLED }

How would I use _half_user_hp() within this plugin itself? The main question is how can I get the 'id' parameter to it from within this plugin?

For example, if I wanted to make every user cut his hp in half when he spawned,

Code:
public event_ResetHUD( id ) {    _half_user_hp(......); // What goes in the brackets? }
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician

Last edited by Wilson [29th ID]; 11-18-2007 at 11:44.
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
 



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 01:23.


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