SA-MP Forums Archive
Check If he is in your 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: Check If he is in your car. (/showthread.php?tid=383636)



Check If he is in your car. - MechaTech - 08.10.2012

Hey, I am making a tie command with ZCMD.
But I dont know how to start with.
I need to check if the victim is a passenger in YOUR vehicle.
I already searched on ******, but I cant find it.


Re: Check If he is in your car. - park4bmx - 08.10.2012

Well you need to loop through all online players
pawn Код:
//this goes in your cmd
for(new i; i<GetMaxPlayers(); i++)
{
     If(IsPlayerConnected(i) && GetPlayerVehicleID(playerid) == GetPlayerVehicleID(i)){
          //this should check if the player that typed the cmd and some other player are in the same vehicle
     }
}
There are other ways but right now I'm on m phone