15.01.2013, 14:09
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
PlayerInfos[playerid][pLastVehicleID] I set in OnPlayerExitVehicle
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.");