Code:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new id = GetPlayerVehicleID(playerid);
if(newkeys == 131072 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) // Verifica se o jogador pressionou o N
{
// A gente remove o IsPlayerAnyVehicle pois sempre que ele N espaзo irб aparecer a mensagem.
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!");
}
// ------------------------------------------------------------------------------- >>
// PRУXIMO ITEM
//------------------------------------------------------------------------------
if(newkeys & KEY_YES && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) // Y
{
GetVehicleParamsEx(id, engine, lights, alarm, doors, bonnet, boot, objective);
if(boot == VEHICLE_PARAMS_OFF || boot == VEHICLE_PARAMS_UNSET) {
SetVehicleParamsEx(id, engine, lights, alarm, doors, bonnet, VEHICLE_PARAMS_ON, objective);
SendClientMessage(playerid, Branco, "Vocк abriu a mala do carro !");
}
else
{
SetVehicleParamsEx(id, engine, lights, alarm, doors, bonnet, VEHICLE_PARAMS_OFF, objective);
SendClientMessage(playerid, Cinza, "Vocк fechou a mala do carro !");
}
}
// ------------------------------------------------------------------------------- >>
// PRУXIMO ITEM
//------------------------------------------------------------------------------
}
/*
new t[80];
format(t, sizeof(t)," Tecla: %d", newkeys);
SendClientMessage(playerid, -1, t);
*/
return true;
}
public completa.
nгo ta funcionando
Ermanhaut
sinceramente pra mim ta tudo certo, o de desligar/ligar com N ta funcionando perfeitamente
serб que tem algo errado aqui
Code:
SetVehicleParamsEx(id, engine, lights, alarm, doors, bonnet, VEHICLE_PARAMS_ON, objective);
?