Disable exiting a vehicle without TogglePlayerControlable - 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: Disable exiting a vehicle without TogglePlayerControlable (
/showthread.php?tid=66814)
Disable exiting a vehicle without TogglePlayerControlable -
Robbin237 - 24.02.2009
I want that the player cannot exit the vehicle using the Enter / F key. But i cannot get it done, each time when i return 0 at OnVehicleExit (or whatever the callback is called) it just steps out. I've also tried this but this wouldn't work also:
pawn Код:
public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
{
if(locked[playerid] == 1)
{
if(newkeys == 16) return 0;
}
return 1;
}
I just want that he wont be able to exit, but can use everything else like normally. Without TogglePlayerControlable.
Thanks!
Re: Disable exiting a vehicle without TogglePlayerControlable -
[RP]Rav - 24.02.2009
pawn Код:
OnPlayerStateChange(playerid, newstate, oldstate)
{
if (oldstate == PLAYER_STATE_DRIVER)
{
PutPlayerInVehicle(playerid, lastVehicle[playerid], 0)
}
}
something like that?
Re: Disable exiting a vehicle without TogglePlayerControlable -
Robbin237 - 24.02.2009
Doesn't work too well, anyone got a better solution?
Re: Disable exiting a vehicle without TogglePlayerControlable -
Norn - 24.02.2009
pawn Код:
public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
{
if(newkeys & 16)
{
if(locked[playerid])
{
return 0;
}
}
return 1;
}