Posts: 37
Threads: 8
Joined: Sep 2009
31.12.2010, 16:15
(
Last edited by IllidanS46; 31/12/2010 at 06:06 PM.
)
Hello, can you help me how to call effectively native functions and hook callbacks (OnPlayerConnect) in plugin?
Posts: 37
Threads: 8
Joined: Sep 2009
31.12.2010, 20:31
(
Last edited by IllidanS46; 01/01/2011 at 11:51 AM.
)
I found a way to call native function:
SetWeather(weather)
Code:
cell* params = (cell*)malloc(8);
params[0] = 4;
params[1] = 5; //weather 5
int idx;
amx_FindNative(amx, "SetWeather", &idx);
cell result;
amx_Callback(amx, idx, &result, params);
free(params);
When I first run it, weather has set to 5, but next time weather has set to 96 (0x60) and never more changed. Does anyone know where the problem is?
Posts: 37
Threads: 8
Joined: Sep 2009
Ok, about hooking I know enough, but I still don't know how to correctly call native functions.
Posts: 37
Threads: 8
Joined: Sep 2009
Quote:
Originally Posted by IllidanS4
Ok, about hooking I know enough, but I still don't know how to correctly call native functions.
|
Please help!