GetVehicleTrailer Bug - 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: GetVehicleTrailer Bug (
/showthread.php?tid=407786)
GetVehicleTrailer Bug -
CoaPsyFactor - 15.01.2013
So I have this little problem, when player do /repair in vehicle GetVehicleTrailer return good value, but if player is out of vehicle it returns 0;
here is code
pawn Код:
if(!IsPlayerInAnyVehicle(playerid)) vehicleid = PlayerInfos[playerid][pLastVehicleID];
else vehicleid = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicleid) != 525) return SendClientMessage(playerid, COLOR_RED, "You must be in towtruck to do repair.");
if(!(rvehicle = GetVehicleTrailer(vehicleid))) return SendClientMessage(playerid, COLOR_RED, "No vehicle is attached.");
PlayerInfos[playerid][pLastVehicleID] I set in OnPlayerExitVehicle
Re: GetVehicleTrailer Bug -
CoaPsyFactor - 16.01.2013
bump
Re: GetVehicleTrailer Bug -
horsemeat - 18.08.2013
here try this
pawn Код:
if(IsTrailerAttachedToVehicle(vehicleid)) return SendClientMessage(playerid, COLOR_RED, "No vehicle is attached.");
rvehicle = GetVehicleTrailer(vehicleid);