GetVehicleTrailer

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 17:56, 2 February 2014
Connor Mead (Talk | contribs)

← Previous diff
Revision as of 07:45, 11 May 2015
MP2 (Talk | contribs)
(Better example. The old example would have just used IsTrailerAttachedToVehicle..)
Next diff →
Line 9: Line 9:
<pawn> <pawn>
-if(GetVehicleTrailer(GetPlayerVehicleID(playerid))) SendClientMessage(playerid, 0xFFFFFFAA, "You are currently towing a trailer.");+new trailerid = GetVehicleTrailer(vehicleid);
-else SendClientMessage(playerid, 0xFFFFFFAA, "You are not towing a trailer.");+DetachTrailerFromVehicle(trailerid);
</pawn> </pawn>

Revision as of 07:45, 11 May 2015



Description:

Get the ID of the trailer attached to a vehicle.


Parameters:
(vehicleid)
vehicleidThe ID of the vehicle to get the trailer of.


Return Values:

The vehicle ID of the trailer or 0 if no trailer is attached.


new trailerid = GetVehicleTrailer(vehicleid);
DetachTrailerFromVehicle(trailerid);

Related Functions

The following functions may be useful, as they are related to this function in one way or another.

In other languages