Function hook problem
#1

Hello everyone!
I tried to hook CreateVehicle function with ALS method, but I just couldn't, it won't work, custom function isn't called, but there is no error saying, that _CreateVehicle is not used.
Code:
_CreateVehicle(vehicletype, Float:x, Float:y, Float:z, Float:rotation, color1, color2, respawn_delay, addsiren=0)
{
	new vehicleid = CreateVehicle(vehicletype, Float:x, Float:y, Float:z, Float:rotation, color1, color2, respawn_delay, addsiren=0);
	Iter_Add(Vehicles, vehicleid);
	return vehicleid;
}

/*************************|FUNCTION HOOKS|*************************/
#if defined _ALS_CreateVehicle
    #undef CreateVehicle
#else
    #define _ALS_CreateVehicle
#endif
#define CreateVehicle _CreateVehicle
This is my code, where is the problem? Thanks in advance!
Reply
#2

SOLVED!

I managed to fail, and hook CreateVehicle function at the end of the script, after calling CreateVehicle itself.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)