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