Making certain vehicles un-drivable? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Making certain vehicles un-drivable? (
/showthread.php?tid=226668)
Making certain vehicles un-drivable? -
YungGee - 16.02.2011
Well just as the title states...
Any help?
Re: Making certain vehicles un-drivable? -
Antonio [G-RP] - 16.02.2011
pawn Код:
new NonDrivable = CreateVehicle......
and
under OnPlayerEnterVehicle
pawn Код:
if(vehicleid == NonDrivable)
{
RemovePlayerFromVehicle(playerid, vehicleid);
}
Re: Making certain vehicles un-drivable? -
Serbish - 16.02.2011
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER)
{
if(vehicleid == Vehicle_ID_which_you_want_to_make_undrivable))
{
TogglePlayerControllable(playerid, 0); // Or use RemovePlayerFromVehicle(playerid); if you want that it just removes you from the vehicle which is undrivable.
SendClientMessage(playerid, COLOR_WARNING, "This vehicle is out of use !");
}
}
return 1;
}
When you get out of the vehicle you should use:
pawn Код:
TogglePlayerControllable(playerid, 1);
Re: Making certain vehicles un-drivable? -
YungGee - 16.02.2011
Thanks guys