Escaping from the vehicle
#1

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.
Reply
#2

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;
}
Reply
#3

Thanks, working.
Reply
#4

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...
Reply
#5

which is more compatible?
Reply
#6

Try them both, and choose the one you like more.
Reply
#7

Okay, thanks for help.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)