Passenger help
#1

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

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.
Reply
#3

thanks men i am going to try it
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)