SA-MP Forums Archive
Car Message Function Problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Car Message Function Problem (/showthread.php?tid=79974)



Car Message Function Problem - CyberGuerilla - 01.06.2009

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.


Re: Car Message Function Problem - Weirdosport - 01.06.2009

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;
}



Re: Car Message Function Problem - CyberGuerilla - 01.06.2009

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


Re: Car Message Function Problem - Weirdosport - 01.06.2009

Isn't that what you wanted?


Re: Car Message Function Problem - Lewwy - 01.06.2009

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.


Re: Car Message Function Problem - CyberGuerilla - 01.06.2009

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


Re: Car Message Function Problem - CyberGuerilla - 01.06.2009

It's too urgent, please help...


Re: Car Message Function Problem - SpiderPork - 01.06.2009

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;
}



Re: Car Message Function Problem - CyberGuerilla - 01.06.2009

Oww, all chat functions f.. up Not worked.


Re: Car Message Function Problem - Marcel - 01.06.2009

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;
}