I can't find the keybind for car engine.
#4

This code would be under OnPlayerKeyStateChange, if you still have problems with the 'S' button after using my code, post your entire public OnPlayerKeyStateChange function here.

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys == KEY_SUBMISSION)
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            new engine, lights, alarm, doors, bonnet, boot, objective;
            GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
            if(engine == 1)
            {
                SetVehicleParamsEx(GetPlayerVehicleID(playerid), 0, lights, alarm, doors, bonnet, boot, objective);
                SendClientMessage(playerid, 0xFF0000FF, "You Have Turned Your Vehicle's Engine Off."); //This line is not necessary and is completely optional.
            }
            else
            {
                SetVehicleParamsEx(GetPlayerVehicleID(playerid), 1, lights, alarm, doors, bonnet, boot, objective);
                SendClientMessage(playerid, 0x00FF00FF, "You Have Turned Your Vehicle's Engine On."); //Once again, this line is completely optional.
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)