Error?
#1

Code:
Код:
public Startup(playerid, vehicleid)
{
  new pveh = GetVehicleModel(GetPlayerVehicleID(playerid));
  new newcar = GetPlayerVehicleID(playerid);
	if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER || engineOn[vehicleid])
	{
		//I do nothing!
	}
 else if(IsPlayerInAnyVehicle(playerid) && !engineOn[vehicleid] && !vehicleEntered[playerid][vehicleid] && GetPlayerState(playerid) == PLAYER_STATE_DRIVER && pveh != 510 && pveh != 462 && newcar != 59 && newcar != 60 && !IsAPlane(newcar) && !IsAHarvest(newcar) && !IsADrugHarvest(newcar) && !IsASweeper(newcar));
	{
		SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Type /engine or press SHIFT to start your vehicle!");
		TogglePlayerControllable(playerid, false);
		vehicleEntered[playerid][vehicleid] = true;
	}
	else if(IsPlayerInAnyVehicle(playerid) && !engineOn[vehicleid] && vehicleEntered[playerid][vehicleid] && GetPlayerState(playerid) == PLAYER_STATE_DRIVER && pveh != 510 && pveh != 462 && newcar != 59 && newcar != 60 && !IsAPlane(newcar) && !IsAHarvest(newcar) && !IsADrugHarvest(newcar) && !IsASweeper(newcar))
	{
		SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Type /engine or press SHIFT to start your vehicle!");
		TogglePlayerControllable(playerid, false);
	}
}
Errors

Код:
C:\Program Files\Rockstar Games\GTA San Andreas\SOCRoleplay\gamemodes\larp.pwn(45978) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\SOCRoleplay\gamemodes\larp.pwn(45978) : warning 215: expression has no effect
C:\Program Files\Rockstar Games\GTA San Andreas\SOCRoleplay\gamemodes\larp.pwn(45978) : error 001: expected token: ";", but found "]"
C:\Program Files\Rockstar Games\GTA San Andreas\SOCRoleplay\gamemodes\larp.pwn(45978) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\SOCRoleplay\gamemodes\larp.pwn(45978) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
What I do Wrong?
Reply
#2

Try this
Код:
public Startup(playerid, vehicleid)
{
  new pveh = GetVehicleModel(GetPlayerVehicleID(playerid));
  new newcar = GetPlayerVehicleID(playerid);
	if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER || engineOn[vehicleid])
	{
		//I do nothing!
	}
 else if(IsPlayerInAnyVehicle(playerid) && !engineOn[vehicleid] && !vehicleEntered[playerid][vehicleid] && GetPlayerState(playerid) == PLAYER_STATE_DRIVER && pveh != 510 && pveh != 462 && newcar != 59 && newcar != 60 && !IsAPlane(newcar) && !IsAHarvest(newcar) && !IsADrugHarvest(newcar) && !IsASweeper(newcar));
	{
		SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Type /engine or press SHIFT to start your vehicle!");
		TogglePlayerControllable(playerid, false);
		vehicleEntered[playerid][vehicleid] = true;
	}
	else if(IsPlayerInAnyVehicle(playerid) && !engineOn[vehicleid] && vehicleEntered[playerid][vehicleid] && GetPlayerState(playerid) == PLAYER_STATE_DRIVER && pveh != 510 && pveh != 462 && newcar != 59 && newcar != 60 && !IsAPlane(newcar) && !IsAHarvest(newcar) && !IsADrugHarvest(newcar) && !IsASweeper(newcar));
	{
		SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Type /engine or press SHIFT to start your vehicle!");
		TogglePlayerControllable(playerid, false);
	}
}
If not this
Код:
public Startup(playerid, vehicleid)
{
  new pveh = GetVehicleModel(GetPlayerVehicleID(playerid));
  new newcar = GetPlayerVehicleID(playerid);
	if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER || engineOn[vehicleid])
	{
		//I do nothing!
	}
 else if(IsPlayerInAnyVehicle(playerid) && !engineOn[vehicleid] && !vehicleEntered[playerid][vehicleid] && GetPlayerState(playerid) == PLAYER_STATE_DRIVER && pveh != 510 && pveh != 462 && newcar != 59 && newcar != 60 && !IsAPlane(newcar) && !IsAHarvest(newcar) && !IsADrugHarvest(newcar) && !IsASweeper(newcar));
	{
		SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Type /engine or press SHIFT to start your vehicle!");
		TogglePlayerControllable(playerid, false);
		vehicleEntered[playerid][vehicleid] = true;
	}
	else if(IsPlayerInAnyVehicle(playerid) && !engineOn[vehicleid] && vehicleEntered[playerid][vehicleid] && GetPlayerState(playerid) == PLAYER_STATE_DRIVER && pveh != 510 && pveh != 462 && newcar != 59 && newcar != 60 && !IsAPlane(newcar) && !IsAHarvest(newcar) && !IsADrugHarvest(newcar) && !IsASweeper(newcar);
	{
		SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Type /engine or press SHIFT to start your vehicle!");
		TogglePlayerControllable(playerid, false);
	}
}
Reply
#3

Quote:
Originally Posted by craponnaruto
Try this
Код:
public Startup(playerid, vehicleid)
{
  new pveh = GetVehicleModel(GetPlayerVehicleID(playerid));
  new newcar = GetPlayerVehicleID(playerid);
	if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER || engineOn[vehicleid])
	{
		//I do nothing!
	}
 else if(IsPlayerInAnyVehicle(playerid) && !engineOn[vehicleid] && !vehicleEntered[playerid][vehicleid] && GetPlayerState(playerid) == PLAYER_STATE_DRIVER && pveh != 510 && pveh != 462 && newcar != 59 && newcar != 60 && !IsAPlane(newcar) && !IsAHarvest(newcar) && !IsADrugHarvest(newcar) && !IsASweeper(newcar));
	{
		SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Type /engine or press SHIFT to start your vehicle!");
		TogglePlayerControllable(playerid, false);
		vehicleEntered[playerid][vehicleid] = true;
	}
	else if(IsPlayerInAnyVehicle(playerid) && !engineOn[vehicleid] && vehicleEntered[playerid][vehicleid] && GetPlayerState(playerid) == PLAYER_STATE_DRIVER && pveh != 510 && pveh != 462 && newcar != 59 && newcar != 60 && !IsAPlane(newcar) && !IsAHarvest(newcar) && !IsADrugHarvest(newcar) && !IsASweeper(newcar));
	{
		SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Type /engine or press SHIFT to start your vehicle!");
		TogglePlayerControllable(playerid, false);
	}
}
If not this
Код:
public Startup(playerid, vehicleid)
{
  new pveh = GetVehicleModel(GetPlayerVehicleID(playerid));
  new newcar = GetPlayerVehicleID(playerid);
	if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER || engineOn[vehicleid])
	{
		//I do nothing!
	}
 else if(IsPlayerInAnyVehicle(playerid) && !engineOn[vehicleid] && !vehicleEntered[playerid][vehicleid] && GetPlayerState(playerid) == PLAYER_STATE_DRIVER && pveh != 510 && pveh != 462 && newcar != 59 && newcar != 60 && !IsAPlane(newcar) && !IsAHarvest(newcar) && !IsADrugHarvest(newcar) && !IsASweeper(newcar));
	{
		SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Type /engine or press SHIFT to start your vehicle!");
		TogglePlayerControllable(playerid, false);
		vehicleEntered[playerid][vehicleid] = true;
	}
	else if(IsPlayerInAnyVehicle(playerid) && !engineOn[vehicleid] && vehicleEntered[playerid][vehicleid] && GetPlayerState(playerid) == PLAYER_STATE_DRIVER && pveh != 510 && pveh != 462 && newcar != 59 && newcar != 60 && !IsAPlane(newcar) && !IsAHarvest(newcar) && !IsADrugHarvest(newcar) && !IsASweeper(newcar);
	{
		SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Type /engine or press SHIFT to start your vehicle!");
		TogglePlayerControllable(playerid, false);
	}
}
what if both dont work
Reply
#4

Try to read the error and look at any misplaced text if they don't work
Reply
#5

I attempted to change stuff around, same error

Reply
#6

The error said that it was supposed to be ; but was ] so look for a ] in the coding and change it.
Reply
#7

For rezolved your problem add a fielliscript with /engine on and offQ
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)