SA-MP Forums Archive
After detaching trailer from vehicle sometimes other users see trailer attached to vehicle - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP (https://sampforum.blast.hk/forumdisplay.php?fid=3)
+--- Forum: Bug Reports (https://sampforum.blast.hk/forumdisplay.php?fid=20)
+--- Thread: After detaching trailer from vehicle sometimes other users see trailer attached to vehicle (/showthread.php?tid=502866)



After detaching trailer from vehicle sometimes other users see trailer attached to vehicle - diclofoss - 26.03.2014

Hello!
I have created simple command
Code:
	if(!strcmp(cmd, "/detach", true)) {		
		SendClientMessage(playerid,COLOR_RED, "Trying to detach");
		new vehicleid = GetPlayerVehicleID(playerid);
		if (!vehicleid)
			return 1;
		SendClientMessage(playerid,COLOR_RED, "Vehicle found");
		if(IsTrailerAttachedToVehicle(vehicleid)) {
			SendClientMessage(playerid,COLOR_RED, "Trailer found");
			DetachTrailerFromVehicle(vehicleid);
			SendClientMessage(playerid,COLOR_RED, "Trailer detached");
		}
		return 1;
	}
Testcase is:
Player A join the game
Player B join the game
A and B meet in the same place where Trailer (435) and Vehicle (515) located
A gets a Vehicle and attaches trailer.
B noticed that Vehicle and trailer are attached
A types /detach command and go forward by vehicle
B noticed that Trailer is detached
A go backward by vehicle and attaches trailer.
B noticed that Vehicle and trailer are attached
A types /detach command and go forward by vehicle
B noticed that Trailer and Vehicle are still attached. In 2-3 mintes after player A noticed a trailer behind vehicle suddenly