I need some help with Restricted Vehicle to a Name.
#5

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new Pname[24];
    GetPlayerName(playerid, Pname, 24);
    if(vehicleid == /*The certain vehicle ID you want to restrict*/ && strcmp(Pname, "Oggy_Wilson", true) && ispassenger == 0)
    {
        new Float:Pos[3];
        GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
        SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED, "You are not allowed to access this vehicle."):
    }

    return 1;
}
That will fix it, just replace the values with the right ones.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)