26.10.2014, 03:40
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?
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)
{
ClearAnimations(playerid);
SendClientMessage(playerid, COLOR_GREY, " You are not a Cop !");
}
return 1;
}
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;
}