SA-MP Forums Archive
Remove from vehicle - 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: Remove from vehicle (/showthread.php?tid=138237)



Remove from vehicle - Steven82 - 01.04.2010

I know the coding but how do i remove a player from vehicle if they get into a Police Department car?
P.S i know the code

RemovePlayerFromVehicle(playerid)


Re: Remove from vehicle - Backwardsman97 - 01.04.2010

Under the OnPlayerStateChange callback you need to do a check to see if he's becoming the driver of a vehicle, if he is, and the vehicle is a police car, call the code you have right there.


Re: Remove from vehicle - aircombat - 01.04.2010

under OnPlayerStateChange :
Код:
new vehicleid = GetVehicleId(playerid);
new modelid = GetVehicleModel(vehicleid);
if(gTeam != Team_Cops) 
{
if(modelid == cops car)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,COLOR_RED,"You Have To Be A Cop To Get In This Car");
}
}