How to detect differfent trailers? - 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: How to detect differfent trailers? (
/showthread.php?tid=436705)
**DELETE** -
Pettersen - 12.05.2013
**DELETE
AW: How to detect differfent trailers? -
ulbi1990 - 12.05.2013
pawn Код:
if(GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(playerid))) == 584)
Checks in this case for the trailer ID 584. Than does it depends how you load the missions, if they have a clearly ID for the load (Box, Petro, Dirt) can you ask if the trailer id and the clearly setted ID.
Like this:
pawn Код:
if(GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(playerid))) == 584 && ClealyID[Missions]==LoadID)
**DELETE** -
Pettersen - 12.05.2013
**DELETE
AW: How to detect differfent trailers? -
ulbi1990 - 12.05.2013
How i said, you will need to use a clearly ID for the Loads, that all Boxtrailer missions has one id, all Petrotrailer missions another and all Dirttrailer missions also another ID.
like this (Pseudocode):
pawn Код:
enum TrailerMissions
{
ID,X,Y,Z,Name,UnloadX,UnloadY,UnloadZ,UnloadName
}
While ID changes ONLY than when another Trailer should be taken.
If you want to use more than one enum (for each trailer one). Than does you need only to ask for the TrailerID and load than in the next step from the correct enum.
**DELETE** -
Pettersen - 12.05.2013
**DELETE
**DELETE** -
Pettersen - 12.05.2013
**DELETE