31.08.2018, 16:46
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if(newkeys == 131072 || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) // Verifica se o jogador pressionou o N { // A gente remove o IsPlayerAnyVehicle pois sempre que ele N espaзo irб aparecer a mensagem. new id = GetPlayerVehicleID(playerid); GetVehicleParamsEx(id, engine, lights, alarm, doors, bonnet, boot, objective); if(engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET) { SetVehicleParamsEx(id, VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective); SendClientMessage(playerid, Branco, "Vocк ligou o seu veнculo!"); } else { SetVehicleParamsEx(id, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective); SendClientMessage(playerid, Cinza, "Vocк desligou o seu veнculo!"); } return true; } return 1; }
Код:
if(newkeys == 131072 || GetPlayerState(playerid) == PLAYER_STATE_DRIVER)