Escaping from the vehicle - 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: Escaping from the vehicle (
/showthread.php?tid=459505)
Escaping from the vehicle -
Lusan - 23.08.2013
Hi, i have a question. So, how do I make the player while cuffed animation unable to leave the vehicle? I've tried everything, but nothing. Next the same... Can someone help me? I would add that I also tried with the speed of the vehicle when exiting the vehicle, but neither worked.
Sorry, for my lang.
Re: Escaping from the vehicle -
RajatPawar - 23.08.2013
pawn Код:
new bool: isPlayerCuffed[ MAX_PLAYERS ];
stock ChangeCuffStatus( playerid )
{
isPlayerCuffed[ playerid ] = !isPlayerCuffed[ playerid ];
}
public OnPlayerExitVehicle / OnPlayerStateChange( ... )
{
if( isPlayerCuffed[ playerid ] )
{
PutPlayerInVehicle(playerid, vehicleid, GetPlayerVehicleSeat( playerid ));
}
return 1;
}
Re: Escaping from the vehicle -
Lusan - 23.08.2013
Thanks, working.
Re: Escaping from the vehicle -
Dragonsaurus - 23.08.2013
pawn Код:
public OnPlayerKeyStateChange(playerid, newatate, oldstate)
{
if(newstate == PLAYER_STATE_ONFOOT && oldstate == PLAYER_STATE_PASSENGER)
{
if(PlayerInfo[playerid][Cuffed] == 1) PutPlayerInVehicle(playerid, vehicleid, 2);
}
return 1;
}
Change PlayerInfo[playerid][Cuffed] with the variable you use to detect if the player is cuffed.
Edit: Too late...
Re: Escaping from the vehicle -
Lusan - 23.08.2013
which is more compatible?
Re: Escaping from the vehicle -
Dragonsaurus - 23.08.2013
Try them both, and choose the one you like more.
Re: Escaping from the vehicle -
Lusan - 23.08.2013
Okay, thanks for help.