CreateVehicle to AttachTrailerToVehicle sync is slow? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: CreateVehicle to AttachTrailerToVehicle sync is slow? (
/showthread.php?tid=326318)
CreateVehicle to AttachTrailerToVehicle sync is slow? -
Donya - 17.03.2012
Hey, I'm having alot of problems regarding AttachTrailerToVehicle, it cannot be used right after CreateVehicle.
I have even tried timers of 500 ms - 1.5 seconds to attach, yet it doesn't attach the created vehicle to the towtruck.
pawn Код:
PlayerInfo[playerid][pSpecial_Missile_Vehicle] = CreateVehicle(420, x, y, z + 10, angle, 0, 0, -1);
//LinkVehicleToInterior(PlayerInfo[playerid][pSpecial_Missile_Vehicle], INVISIBILITY_INDEX);
SetVehicleHealth(PlayerInfo[playerid][pSpecial_Missile_Vehicle], 2500.0);
AttachTrailerToVehicle(PlayerInfo[playerid][pSpecial_Missile_Vehicle], Current_Vehicle[playerid]);
Doesn't even attach, I think it spawns late also.
The vehicle that it is being attached to is a towtruck.
Any suggestions?
Re: CreateVehicle to AttachTrailerToVehicle sync is slow? -
Rac3r - 17.03.2012
Works fine for me (Tested 0.3e), but because some players have higher pings, I use a timer to save any problems.
Are you in the vehicle while attaching the trailer? Maybe try GetPlayerVehicleID().
Is the timer calling a public (forwarded) function? Try print(), printf().
Re: CreateVehicle to AttachTrailerToVehicle sync is slow? -
Donya - 17.03.2012
I'm using 0.3d R2
can I see the code you used?
Yes I'm in the vehicle, the new vehicle is being created just + z of my current vehicle.
Theres no timer currently.
Re: CreateVehicle to AttachTrailerToVehicle sync is slow? -
][Noname][ - 18.03.2012
Yes, AttachTrailerToVehicle sync is slow. Confirmed