vehicle help - 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: vehicle help (
/showthread.php?tid=424404)
vehicle help -
Chrillzen - 22.03.2013
Let's say I make something like this at OnPlayerEnterVehicle.
pawn Код:
if(IsACopVehicle(vehicleid))
{
new Float:playerposx, Float:playerposy, Float:playerposz;
GetPlayerPos(playerid, playerposx, playerposy, playerposz);
if(PlayerInfo[playerid][pCop] == 0)
{
SetPlayerPos(playerid,playerposx, playerposy, playerposz);
}
}
How do I do if I want the passangers to be allowed to enter the cop vehicles?
Re: vehicle help -
Dubya - 22.03.2013
You lacked the && !ispassenger, which judges whether the player that is entering is entering as driver, or as passenger.
pawn Код:
if(IsACopVehicle(vehicleid) && !ispassenger)
{
new Float:playerposx, Float:playerposy, Float:playerposz;
GetPlayerPos(playerid, playerposx, playerposy, playerposz);
if(PlayerInfo[playerid][pCop] == 0)
{
SetPlayerPos(playerid,playerposx, playerposy, playerposz);
}
}