2020-12-31, 04:46 PM
(This post was last modified: 2020-12-31, 04:49 PM by xbruno1000x.)
First:
To enter interior:
To Exit car interior:
Code:
new IsInSecuricar[MAX_PLAYERS];
To enter interior:
Code:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_PASSENGER)
{
if (GetVehicleModel(vehicleid) == SECURICAR ID)
{
SetPlayerPos(playerid, INTERIOR POS);
SetPlayerFacingAngle(playerid, ANGLE);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, INTERIORID);
IsInSecuricar[playerid] = vehicleid;
}
}
To Exit car interior:
Code:
public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
{
if (newkeys == 16 && IsInSecuricar[playerid] > 0)
{
new Float:X,Float:Y,Float:Z;
GetVehiclePos(IsInSecuricar[playerid], X, Y, Z);
SetPlayerPos(playerid, X, Y, Z);
SetPlayerInterior(playerid, 0);
IsInSecuricar[playerid] = 0;
}