[Question] Looking for vehicle function.
#3

It's kinda easy.
Well you can get the player's car ID and then make a loop to check if there are another players in the same car and to be a little bit better make a variable "persinthecar"(example) and everytime he found a person in the same car persinthecar++; when persinthecar reaches 3 use the function break;
Be careful to avoid in the loop the player who changed the radio: "if(playerid != i)"

It will look like:
pawn Код:
new persinthecar,newcar;
newcar = GetPlayerVehicleID(playerid);
for(new i=0;i<MAX_PLAYERS;i++)
{
 if(playerid != i)
 {
  if(newcar == GetPlayerVehicleID(i))
  {
    //Change the stream....
  }
 }
}
Reply


Messages In This Thread
[Question] Looking for vehicle function. - by tony_fitto - 10.06.2013, 17:41
Respuesta: [Question] Looking for vehicle function. - by Parka - 10.06.2013, 18:01
Re: [Question] Looking for vehicle function. - by Aly - 10.06.2013, 18:32

Forum Jump:


Users browsing this thread: 1 Guest(s)