SA-MP Forums Archive
blocking vehicle enterance with clearanimation, need some 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: blocking vehicle enterance with clearanimation, need some help (/showthread.php?tid=543341)



blocking vehicle enterance with clearanimation, need some help - nogh445 - 26.10.2014

I have made a system to kick a player out of the copcar if he is not a cop, but I would like for passengers to still be able to go into the car, which they cannot with this code below. How can I allow passengers to enter?

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(IsACopCar(vehicleid) && PlayerInfo[playerid][pCop] == 0)
    {
        ClearAnimations(playerid);
        SendClientMessage(playerid, COLOR_GREY, "   You are not a Cop !");
    }
    return 1;
}
EDIT:

Nevermind! I used my mind a bit and found out how it is done! For anyone else that had this problem here is the fix;

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(IsACopCar(vehicleid) && PlayerInfo[playerid][pCop] == 0 && !ispassenger)
    {
        ClearAnimations(playerid);
        SendClientMessage(playerid, COLOR_GREY, "   You are not a Cop !");
    }
    return 1;
}