30.07.2015, 23:08
Hello!, ive tried to add a function to this CMD but it turns out that theres an error:
This is the line that contains the error:
And here is the full command:
Thanks
Код:
error 001: expected token: ";", but found ")"
Код:
if ((carid = Car_GetID(carid)) != -1 && Car_IsOwner(playerid, carid)) && IsPlayerInVehicle(playerid, dmvCars[i])) && IsPlayerInVehicle(playerid, rentCars[c]))
Код:
CMD:motor(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid); new carid = GetPlayerVehicleID(playerid); if (!IsEngineVehicle(vehicleid)) return SendErrorMessage(playerid, "No estas dentro de ningun coche."); /* if (IsRefueling[playerid]) return SendErrorMessage(playerid, "Wait until the car tank is refueled.");*/ if (GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendErrorMessage(playerid, "No eres el conductor."); if (CoreVehicles[vehicleid][vehFuel] < 1) return SendErrorMessage(playerid, "No queda gasolina."); if (ReturnVehicleHealth(vehicleid) <= 300) return SendErrorMessage(playerid, "Intentas arrancar el coche pero no enciende, parece ser que esta daсado."); new i = 0; i < sizeof(dmvCars); i++; new c = 0; c < sizeof(rentCars); c++; if ((carid = Car_GetID(carid)) != -1 && Car_IsOwner(playerid, carid)) && IsPlayerInVehicle(playerid, dmvCars[i])) && IsPlayerInVehicle(playerid, rentCars[c])) //Line that contains the error 001 { if(IsPlayerInVehicle(playerid, dmvCars[i])) { if (!PlayerData[playerid][pDrivingTest]) return SendClientMessage(playerid, -1, "Escribe /examen para comenzar el examen de conuccion."); } if(IsPlayerInVehicle(playerid, rentCars[c])) { if(GetPVarInt(playerid, "RentedCar") == 0 && GetPVarInt(playerid, "RentVehKey") == 0) return SendClientMessage(playerid, -1, "No tienes las llaves de este vehiculo."); if(GetPVarInt(playerid, "RentedCar") == 1 && GetPVarInt(playerid, "RentVehKey") == 0) return SendClientMessage(playerid, -1, "No tienes las llaves de este vehiculo."); if(GetPVarInt(playerid, "RentedCar") == 1 && GetPVarInt(playerid, "RentVehKey") != vehicleid) return SendClientMessage(playerid, -1, "No tienes las llaves de este vehiculo."); } switch (GetEngineStatus(vehicleid)) { case false: { SetEngineStatus(vehicleid, true); ShowPlayerFooter(playerid, "Has ~g~encendido~w~ el motor del vehiculo!"); SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s acciona la llave y pone el motor en marcha acto seguido desembraga.", ReturnName(playerid, 0)); } case true: { SetEngineStatus(vehicleid, false); ShowPlayerFooter(playerid, "Has ~r~apagado~w~ el motor del vehiculo!"); SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s acciona la llave y apaga el vehiculo.", ReturnName(playerid, 0)); } return 1; } else SendErrorMessage(playerid, "No tienes las llaves de este vehiculo."); return 1; } }