GetVehicleTrailer Bug
#1

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
Reply
#2

bump
Reply
#3

here try this
pawn Код:
if(IsTrailerAttachedToVehicle(vehicleid)) return SendClientMessage(playerid, COLOR_RED, "No vehicle is attached.");
rvehicle = GetVehicleTrailer(vehicleid);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)