SA-MP Forums Archive
Detect Trailer id? - 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: Detect Trailer id? (/showthread.php?tid=503977)



Detect Trailer id? - DaZZleViirus - 01.04.2014

Hello! In the enun when i made missions i want to choose wich trailer id the mission is for.

Also like this:
{0, "Hauling 1 to Hauling 2", -24.4073, -281.8898, 5.9985, -305.4319, 1315.6797, 54.6189, 0, 584, 10780},
The 584 is the id of the trailer, Also i want to choose wich trailer the id is for

How can i do it? Here is the script
http://pastebin.com/ZWja9JpJ


Re: Detect Trailer id? - Jefff - 01.04.2014

Replace TrailerID[MAX_PLAYERS] to PlayerMissionID[MAX_PLAYERS] and set on start missionid to player array

pawn Код:
PlayerMissionID[playerid] = missionid_here;
then
pawn Код:
if(GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(playerid))) == PetrolTruckerLocations[PlayerMissionID[playerid]][TrailID])
and you don't need these xd
pawn Код:
new     MissionText[512][MAX_PLAYERS], Float:unx[MAX_PLAYERS], Float:uny[MAX_PLAYERS], Float:unz[MAX_PLAYERS], TrailerID[MAX_PLAYERS], Payment[MAX_PLAYERS], MissionStatus[MAX_PLAYERS];
only
pawn Код:
new PlayerMissionID[MAX_PLAYERS];
because everything is here
pawn Код:
new PetrolTruckerLocations[][PetrolTruckerLocationsEnum]
text,x,y,z,pay..


Re: Detect Trailer id? - DaZZleViirus - 01.04.2014

Quote:
Originally Posted by Jefff
Посмотреть сообщение
Replace TrailerID[MAX_PLAYERS] to PlayerMissionID[MAX_PLAYERS] and set on start missionid to player array

pawn Код:
PlayerMissionID[playerid] = missionid_here;
then
pawn Код:
if(GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(playerid))) == PetrolTruckerLocations[PlayerMissionID[playerid]][TrailID])
and you don't need these xd
pawn Код:
new     MissionText[512][MAX_PLAYERS], Float:unx[MAX_PLAYERS], Float:uny[MAX_PLAYERS], Float:unz[MAX_PLAYERS], TrailerID[MAX_PLAYERS], Payment[MAX_PLAYERS], MissionStatus[MAX_PLAYERS];
only
pawn Код:
new PlayerMissionID[MAX_PLAYERS];
because everything is here
pawn Код:
new PetrolTruckerLocations[][PetrolTruckerLocationsEnum]
text,x,y,z,pay..
http://pastebin.com/HZsN5jx8 Almost got it, can you "fix" it and send it to me?


Re: Detect Trailer id? - DaZZleViirus - 01.04.2014

Nobody?


Re: Detect Trailer id? - Jefff - 01.04.2014

http://pastebin.com/9BsVT6wq