SA-MP Forums Archive
restricted vehicles are bugged? - 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: restricted vehicles are bugged? (/showthread.php?tid=612672)



restricted vehicles are bugged? - Jorda - 20.07.2016

Well, we made few updates after that restricted vehicles gone bugged, like anyone can drive em, for ex- pd cars can be drive by non pd members aswell


Re: How to restrict a vehicle for faction ? - Stinged - 20.07.2016

Код:
OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if (PlayerFaction[playerid] == FACTION_ID && vehicleid == VEHICLE_ID)
    {
        ClearAnimations(playerid);
    }
    return 1;
}
This will stop the player from even trying to enter.

But this stops the player from staying in the car once they enter:
Код:
OnPlayerStateChange(playerid, newstate, oldstate)
{
    if (newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
    {
        RemovePlayerFromVehicle(playerid);
    }
    return 1;
}



Re: How to restrict a vehicle for faction ? - Jorda - 21.07.2016

Quote:
Originally Posted by Stinged
Посмотреть сообщение
Код:
OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if (PlayerFaction[playerid] == FACTION_ID && vehicleid == VEHICLE_ID)
    {
        ClearAnimations(playerid);
    }
    return 1;
}
This will stop the player from even trying to enter.

But this stops the player from staying in the car once they enter:
Код:
OnPlayerStateChange(playerid, newstate, oldstate)
{
    if (newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
    {
        RemovePlayerFromVehicle(playerid);
    }
    return 1;
}

thank you for your reply, but the codes you just sent me aren't working in the faction vehicles only, I mean, When I put it in the script then all the players became not able to drive any vehicle, even their own vehicle, the first codes you sent didn't work to me, Or I didn't know how to put it, But the second codes worked but as I said, they didn't work as I wanted to