Raised This Month: $ Target: $400
 0% 

Fake Natives Question [Solved]


Post New Thread Reply   
 
Thread Tools Display Modes
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]
P34nut
AMX Mod X Beta Tester
Join Date: Feb 2006
Location: Netherlands
Old 11-18-2007 , 11:09   Re: Fake Natives Question
Reply With Quote #2

If you want to use the fake native in the base plugin you need to include the include and use it
__________________
All you need to change the world is one good lie and a river of blood
P34nut is offline
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 11-18-2007 , 11:43   Re: Fake Natives Question
Reply With Quote #3

Quote:
Originally Posted by P34nut View Post
If you want to use the fake native in the base plugin you need to include the include and use it
Are you shitting me? It's that simple?

So just #include <dyn_test> and then use half_user_hp(id) instead of _half_user_hp....wow.

Thanks P34nut
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
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]
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 11-18-2007 , 11:14   Re: Fake Natives Question
Reply With Quote #4

He wants to know what the params are ?! What param should be the player "index" ? If he want to half a user hp how can use that native "_half_user_hp( ??? ) "

??? - unknown params :s
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Reply



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