How can I make it so the driver's seat is locked for a player?
#1

Ok, So i'm wanting it so the driver's seat of the cop car is locked for all player's apart from cops

pawn Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
    if(IsVehicleCopCar(vehicleid) && RpPlayerInfo[foreplayerid][pFaction] == 0) // Or whatever team system you are using
    {
        SetVehicleParamsForPlayer(vehicleid, forplayerid, 0, 1); // Lock doors
    }
    return 1;
}

stock IsVehicleCopCar(vehicleid)
{
    switch(GetVehicleModel(vehicleid))
    {
        case 523, 427, 490, 528, 596 .. 599, 601: return 1;
    }
    return 0;
}
Reply
#2

pawn Код:
public OnPlayerEnterVehicle(playerid,vehicleid,ispassenger)
{
    if(!ispassenger)
    {
        if(IsVehicleCopCar(vehicleid) && RpPlayerInfo[playerid][pFaction] == 0)
        {
            ClearAnimations(playerid);
            SendClientMessage(playerid,-1,"Vehicle locked.");
        }
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by tyler12
Посмотреть сообщение
pawn Код:
public OnPlayerEnterVehicle(playerid,vehicleid,ispassenger)
{
    if(!ispassenger)
    {
        if(IsVehicleCopCar(vehicleid) && RpPlayerInfo[playerid][pFaction] == 0)
        {
            ClearAnimations(playerid);
            SendClientMessage(playerid,-1,"Vehicle locked.");
        }
    }
    return 1;
}
Doesn't work, It lock's all vehicles if the player isn't a cop.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)