Car Chat <-- Quick Question! - 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)
+--- Thread: Car Chat <-- Quick Question! (
/showthread.php?tid=476179)
Car Chat <-- Quick Question! -
hewittpro - 17.11.2013
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!!!!
Re: Car Chat <-- Quick Question! -
***Niko*** - 17.11.2013
Click on link
IsPlayerInAnyVehicle
Re: Car Chat <-- Quick Question! -
hewittpro - 17.11.2013
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(IsPlayerConnected(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;
}
}
}
}//