Cant fix this error! HELP please.
#1

Hello!, ive tried to add a function to this CMD but it turns out that theres an error:

Код:
error 001: expected token: ";", but found ")"
This is the line that contains the error:

Код:
if ((carid = Car_GetID(carid)) != -1 && Car_IsOwner(playerid, carid)) && IsPlayerInVehicle(playerid, dmvCars[i])) && IsPlayerInVehicle(playerid, rentCars[c]))
And here is the full command:

Код:
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;
  }
}
Thanks
Reply
#2

PHP код:
if (carid Car_GetID(carid) != -&& Car_IsOwner(playeridcarid) && IsPlayerInVehicle(playeriddmvCars[i]) && IsPlayerInVehicle(playeridrentCars[c])) 
You had a lot of extra brackets.
Reply
#3

It worked! Thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)