Código PHP:
#include < zcmd>
CMD:ligarfarol(playerid) {
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "{FF2400}| ERRO |: {FFFFFF}Voce nao esta em um veiculo.");
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, -1, "{FF2400}| ERRO |: {FFFFFF}Voce nao e o motorista do veiculo.");
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 509 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 481 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 510) return SendClientMessage(playerid, -1, "{FF2400}| ERRO |: {FFFFFF}Este veiculo nao possui farol");
new engine, lights, alarm, doors, bonnet, boot, objective, vehicleid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, engine, VEHICLE_PARAMS_ON, alarm, doors, bonnet, boot, objective);
GameTextForPlayer(playerid, "Farol Ligado", 2000, 4);
return 1;
}
CMD:desligarfarol(playerid) {
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "{FF2400}| ERRO |: {FFFFFF}Voce nao esta em um veiculo.");
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, -1, "{FF2400}| ERRO |: {FFFFFF}Voce nao e o motorista do veiculo.");
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 509 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 481 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 510) return SendClientMessage(playerid, -1, "{FF2400}| ERRO |: {FFFFFF}Este veiculo nao possui farol");
new engine, lights, alarm, doors, bonnet, boot, objective, vehicleid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, engine, VEHICLE_PARAMS_OFF, alarm, doors, bonnet, boot, objective);
GameTextForPlayer(playerid, "Farol Desligado", 2000, 4);
return 1;
}