Car Whisper
#1

Anybody has a command like /carwhisper that will send a message only for the players that are in the car? Like
X says in the car: Hello and only the people in the car can see it.
Reply
#2

This is how you would check anyway.

pawn Code:
for(new i = 0; i < MAX_PLAYERS; i ++)
{
  if(IsPlayerConnected(i))
  {
    if(IsPlayerInVehicle(i, GetPlayerVehicleID(playerid)))
    {
      SendClientMessage(i, color, string);
    }
  }
  return 1;
}
Reply
#3

I suggest making it into a callback...
Example:
pawn Code:
forward SendCarMessage(color, string[]);

public SendCarMessage(color, string[])
{
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
    if(IsPlayerConnected(i))
      {
        if(IsPlayerInVehicle(i, GetPlayerVehicleID(i)))
            {
            SendClientMessage(i, color, string);
            }
      }
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)