08.11.2015, 15:32
Hi, I'm using SC-RP script, help-me command engine just to owners or members of the faction turn it on.
Код:
CMD:motor(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid); if (!IsEngineVehicle(vehicleid)) return SendErrorMessage(playerid, "Vocк nгo estб em um veiculo."); if (GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendErrorMessage(playerid, "Vocк nгo pode fazer isso porque nгo estб de motorista."); if (CoreVehicles[vehicleid][vehFuel] < 1) return SendErrorMessage(playerid, "Este veiculo estб sem combustнvel."); if (ReturnVehicleHealth(vehicleid) <= 300) return SendErrorMessage(playerid, "Este veiculo estб quebrado e nгo pode ser ligado."); switch (GetEngineStatus(vehicleid)) { case false: { SetEngineStatus(vehicleid, true); //ShowPlayerFooter(playerid, "Voce ~g~ligou~w~ o motor!"); SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s insere a chave na igniзгo e liga o motor.", ReturnName(playerid, 0)); } case true: { SetEngineStatus(vehicleid, false); //ShowPlayerFooter(playerid, "Voce ~r~desligou~w~ o motor!"); SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s gira a chave na igniзгo e desliga o motor.", ReturnName(playerid, 0)); } } return 1; }