Passenger help - 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: Passenger help (
/showthread.php?tid=452791)
Passenger help -
yancarlos4500 - 22.07.2013
Hello,
So i am trying to do a job where 2 people have to work.
so what i want is how can i get the passengers information
what i am trying to say is that if the a person gets a vehicle it will appeard a checkpoint only if the have the job (I already did that) what i want is that when the player enters that checkpoint i will check if there is a passenger and if so it will check if it has a the job and then it will appear another checkpoint
Everything I want if how the checkpoint can check the passengers information when the drivers enter that checkpoint
Re : Passenger help -
lelemaster - 22.07.2013
Those are basic codes, you'll need to adapt them to fit your script.
pawn Code:
new found = 0;
new passengerid;
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(GetPlayerVehicleID(playerid) == GetPlayerVehicleID(i) && GetPlayerVehicleSeat(i) == 1) // Seat 1 = co-driver
{
if(PlayerInfo[i][pJob] == yourjobid) // change my variable of PlayerInfo and pJob to fit your script
{
found = 1;
passengerid = i;
break;
}
}
}
if(found == 0) return SendClientMessage(playerid, -1, "You have no passenger who works with you.");
// use passengerid for the player id of the passenger.
Respuesta: Passenger help -
yancarlos4500 - 22.07.2013
thanks men i am going to try it