View Full Version : Car Chat <-- Quick Question!

17/11/2013, 12:48 AM
Just a quick question, how would I check to see whos in the car with the player to use a car chat? Like if you want to display a message to only people who are in the car with you or you change the radio station how could I check which players are in the car too? THanks!!!!

17/11/2013, 12:54 AM
Click on link
IsPlayerInAnyVehicle (http://wiki.sa-mp.com/wiki/IsPlayerInAnyVehicle)

17/11/2013, 01:08 AM
okay cam up with this, Is this the best way?

new vehicleid = GetPlayerVehicleID(playerid);
new passengervehid;
if(listitem == 0) // Rap
PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=8318"); // driver
for(new i = 0; i < MAX_PLAYERS; i++)
if (!IsPlayerInAnyVehicle(i)) return 1;
passengervehid = GetPlayerVehicleID(i);
if(passengervehid = vehicleid)
PlayAudioStreamForPlayer(i,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=8318"); // Passenger
SendClientMessage(playerid,GREEN,"Someone has turned on the radio.");
return 1;