10.06.2013, 18:32
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:
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....
}
}
}