SA-MP Forums Archive
How can I make it so the driver's seat is locked for a player? - 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: How can I make it so the driver's seat is locked for a player? (/showthread.php?tid=456556)



How can I make it so the driver's seat is locked for a player? - jueix - 06.08.2013

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



Re: How can I make it so the driver's seat is locked for a player? - tyler12 - 06.08.2013

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



Re: How can I make it so the driver's seat is locked for a player? - jueix - 06.08.2013

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.