Car Message Function Problem
#1

stock SendCarMessage(playerid, string [], color12)
{
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, GetPlayerVehicleID(playerid)))
{
SendClientMessage(i, color12, string);
}
}
return 1;
}

This function is for car messages. I wanna hear the player's writing, who inside in player's car. But this function not working. Thanks.
Reply
#2

Try this..

pawn Код:
stock SendCarMessage(playerid, string [], color12)
{
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
   if(IsPlayerInAnyVehicle(i))
   {
     SendClientMessage(i, color12, string);
   }
  }
  return 1;
}
Reply
#3

If I use this function, all players can see the message. (Who inside any car)
Reply
#4

Isn't that what you wanted?
Reply
#5

Weirdosport you're sending that message to everyone in ANY car, he's asking to send a message to someone who's in the same car as him.
Reply
#6

Quote:
Originally Posted by [XG
Lj ]
Weirdosport you're sending that message to everyone in ANY car, he's asking to send a message to someone who's in the same car as him.
Yeah It's true. Sorry for my bad English
Reply
#7

It's too urgent, please help...
Reply
#8

Maybe:
pawn Код:
stock SendCarMessage(playerid, string [], color12)
{
  for(new i = 0; i <= MAX_PLAYERS; i++)
  {
   if(IsPlayerInVehicle(i, GetPlayerVehicleID(i)))
   {
     SendClientMessage(i, color12, string);
   }
  }
  return 1;
}
Reply
#9

Oww, all chat functions f.. up Not worked.
Reply
#10

pawn Код:
stock SendCarMessage(playerid, string [], color12)
{
 for(new i = 0; i <= MAX_PLAYERS; i++)
 {
   if(IsPlayerInVehicle(i, GetPlayerVehicleID(playerid)))
   {
    SendClientMessage(i, color12, string);
   }
 }
 return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)