Vehicle locked after respawn [0.3c]
#1

Hello, i have a little problem with SetvehicleParamsEx.

After respawn vehicle gets locked, i can enter it, but i have a code which remove player from vehicle if vehicle is locked. Can anyone help me?

pawn Код:
public OnVehicleSpawn(vehicleid)
{
    new engine, lights, alarm, doors, boot, boonet, objective;

    GetVehicleParamsEx( vehicleid, engine, lights, alarm, doors, boot, boonet, objective );
    SetVehicleParamsEx( vehicleid, 0, 0, 0, 0, 0, 0, 0 );
   
    vehicleDB[ vehicleid ][ gyv ] = 1000.0;
    vehicleDB[ vehicleid ][ gas ] = 40;
    return 1;
}
Reply
#2

Show me how it removes player out of the vehicle.
Reply
#3

pawn Код:
if ( newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER )
    {
        new vehicleid = GetPlayerVehicleID( playerid );
        new engine, lights, alarm, doors, bonnet, boot, objective;

        GetVehicleParamsEx( vehicleid, engine, lights, alarm, doors, bonnet, boot, objective );
        if ( doors )
        {
            RemovePlayerFromVehicle( playerid );
        }
    }
This code placed in OnPlayerStateChange public function.
Reply
#4

Try this;
pawn Код:
if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
{
    new vehicleid = GetPlayerVehicleID(playerid);
    new engine,lights,alarm,doors,boot,boonet,objective;
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,boot,boonet,objective);
    if(doors == 1) RemovePlayerFromVehicle( playerid );
}
Reply
#5

Nothing. I have a code, which checks the locked cars, and after respawn this car is locked, but i can't understand why. BTW now i can't enter vehicle after respawn.
Reply
#6

Ok, i have it just made a timer after respawn to unlock, thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)