25.09.2015, 20:01
Then we'll create a public function and we put a timer on it,I had the same problem.So that code will be like
And now we're creating the "AttachTrailer" function:
If you don't know were to put this function, do a search into your gm for "public" and put this function there near the others.
PHP код:
new Float:x, Float:y, Float:z; GetPlayerPos(playerid,x,y,z);
newTrailer[playerid] = CreateVehicle(611,x+4,y,z+1,270.0,-1,-1,15);
SetTimerEx("AttachTrailer", 1000, false, "ii", playerid, vehicleid); //It will attach the trailer after 1 sec.
PHP код:
forward AttachTrailer(playerid, vehicleid);
public AttachTrailer(playerid, vehicleid)
{
AttachTrailerToVehicle(newTrailer[playerid], vehicleid);
}