SA-MP Forums Archive
How to check for everyone who is in my car? - 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: How to check for everyone who is in my car? (/showthread.php?tid=300321)



How to check for everyone who is in my car? - HondaCBR - 29.11.2011

How to check for everyone who is in my car?

basically when I type /radioon, I want something to check for all palyers in my car so then I can set music on for those players, Im using
pawn Код:
new vehicleid = GetPlayerVehicleID(playerid);
IsRadioOn[vehicleid] = 1 //when turned on



Re: How to check for everyone who is in my car? - MP2 - 29.11.2011

Double post (forum bug)


Re: How to check for everyone who is in my car? - MP2 - 29.11.2011

pawn Код:
for(new i=0; i<MAX_PLAYERS; i++)
{
    if(GetPlayerVehicle(i) == GetPlayerVehicle(playerid))
    {
        // player 'i' is in the vehicle.
    }
}



Re: How to check for everyone who is in my car? - HondaCBR - 29.11.2011

Error: Undefined GetPlayerVehicle

And BTW its not a Double Post, The other post was about something else, and then it went on to vehicle variables but it hasnt been helpfull and that was like few days ago.


Re: How to check for everyone who is in my car? - [MG]Dimi - 29.11.2011

PHP код:
for(new i=0i<MAX_PLAYERSi++)
{
    if(
GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
    {
        
// player 'i' is in the vehicle.
    
}




Re: How to check for everyone who is in my car? - MP2 - 29.11.2011

The forum posted my last post twice at the exact same time, so I removed the second one.

Change it to GetPlayerVehicleID (my mistake).