blocking vehicle enterance with clearanimation, need some help
#1

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)