Error empty statement?
#1

Hey, as i'm trying to learn how to script, i wanted to make a little "DM"

I made 2 teams, and added 6 bikes at each of the two teams starting point.

I'm gonna make so that like team 1 can't use team 2's bikes.

but i just get those errors:

Код:
C:\Programmer\Rockstar Games\GTA San Andreas\Pawno\gamemodes\TeamDM.pwn(218) : error 036: empty statement
C:\Programmer\Rockstar Games\GTA San Andreas\Pawno\gamemodes\TeamDM.pwn(224) : error 036: empty statement
C:\Programmer\Rockstar Games\GTA San Andreas\Pawno\gamemodes\TeamDM.pwn(230) : error 036: empty statement
C:\Programmer\Rockstar Games\GTA San Andreas\Pawno\gamemodes\TeamDM.pwn(236) : error 036: empty statement
C:\Programmer\Rockstar Games\GTA San Andreas\Pawno\gamemodes\TeamDM.pwn(242) : error 036: empty statement
C:\Programmer\Rockstar Games\GTA San Andreas\Pawno\gamemodes\TeamDM.pwn(248) : error 036: empty statement
C:\Programmer\Rockstar Games\GTA San Andreas\Pawno\gamemodes\TeamDM.pwn(254) : error 036: empty statement
C:\Programmer\Rockstar Games\GTA San Andreas\Pawno\gamemodes\TeamDM.pwn(260) : error 036: empty statement
C:\Programmer\Rockstar Games\GTA San Andreas\Pawno\gamemodes\TeamDM.pwn(266) : error 036: empty statement
C:\Programmer\Rockstar Games\GTA San Andreas\Pawno\gamemodes\TeamDM.pwn(272) : error 036: empty statement
C:\Programmer\Rockstar Games\GTA San Andreas\Pawno\gamemodes\TeamDM.pwn(278) : error 036: empty statement
C:\Programmer\Rockstar Games\GTA San Andreas\Pawno\gamemodes\TeamDM.pwn(284) : error 036: empty statement
Those are the lines of the bikes:

Top of script:

Код:
new Bike1;
new Bike2;
new Bike3;
new Bike4;
new Bike5;
new Bike6;
new Bike7;
new Bike8;
new Bike9;
new Bike10;
new Bike11;
new Bike12;
OnGameModeInnit:

Код:
	Bike1 = AddStaticVehicle(468,173.9683,2457.9558,16.1627,359.9962,6,6); // SanchezT2,1
	Bike2 = AddStaticVehicle(468,172.1324,2457.9070,16.1475,5.1565,53,53); // SanchezT2,2
	Bike3 = AddStaticVehicle(468,170.4063,2457.6304,16.1484,1.5941,6,6); // SanchezT2,3
	Bike4 = AddStaticVehicle(468,168.4018,2457.5972,16.1466,4.4897,53,53); // SanchezT2,4
	Bike5 = AddStaticVehicle(468,166.7386,2457.3679,16.1461,9.5415,6,6); // SanchezT2,5
	Bike6 = AddStaticVehicle(468,165.0416,2457.1724,16.1468,12.6820,53,53); // SanchezT2,6
	Bike7 = AddStaticVehicle(468,417.6771,2532.2822,16.2591,178.3678,6,6); // SanchezT1,1
	Bike8 = AddStaticVehicle(468,418.7739,2532.0764,16.2621,177.8045,53,53); // SanchezT1,2
	Bike9 = AddStaticVehicle(468,419.9492,2532.0305,16.2660,176.7910,6,6); // SanchezT1,3
	Bike10 = AddStaticVehicle(468,420.9674,2531.8933,16.2693,177.7131,53,53); // SanchezT1,4
	Bike11 = AddStaticVehicle(468,421.9666,2531.8308,16.2712,178.7260,6,6); // SanchezT1,5
	Bike12 = AddStaticVehicle(468,423.1473,2531.8340,16.2712,179.4426,53,53); // SanchezT1,6
OnPlayerEnterVehicle:

Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	if(GetPlayerSkin(playerid) == 124)
	{
	if(vehicleid == Bike7);
	SetVehicleToRespawn(vehicleid);
	return 1;
	}
	else if(GetPlayerSkin(playerid) == 124)
	{
	if(vehicleid == Bike8);
	SetVehicleToRespawn(vehicleid);
	return 1;
	}
	else if(GetPlayerSkin(playerid) == 124)
	{
	if(vehicleid == Bike9);
	SetVehicleToRespawn(vehicleid);
	return 1;
	}
	else if(GetPlayerSkin(playerid) == 124)
	{
	if(vehicleid == Bike10);
	SetVehicleToRespawn(vehicleid);
	return 1;
	}
	else if(GetPlayerSkin(playerid) == 124)
	{
	if(vehicleid == Bike11);
	SetVehicleToRespawn(vehicleid);
	return 1;
	}
	else if(GetPlayerSkin(playerid) == 124)
	{
	if(vehicleid == Bike12);
	SetVehicleToRespawn(vehicleid);
	return 1;
	}
	if(GetPlayerSkin(playerid) == 108)
	{
	if(vehicleid == Bike1);
	SetVehicleToRespawn(vehicleid);
	return 1;
	}
	else if(GetPlayerSkin(playerid) == 108)
	{
	if(vehicleid == Bike2);
	SetVehicleToRespawn(vehicleid);
	return 1;
	}
	else if(GetPlayerSkin(playerid) == 108)
	{
	if(vehicleid == Bike3);
	SetVehicleToRespawn(vehicleid);
	return 1;
	}
	else if(GetPlayerSkin(playerid) == 108)
	{
	if(vehicleid == Bike4);
	SetVehicleToRespawn(vehicleid);
	return 1;
	}
	else if(GetPlayerSkin(playerid) == 108)
	{
	if(vehicleid == Bike5);
	SetVehicleToRespawn(vehicleid);
	return 1;
	}
	else if(GetPlayerSkin(playerid) == 108)
	{
	if(vehicleid == Bike6);
	SetVehicleToRespawn(vehicleid);
	return 1;
	}
	return 1;
}
Does any1 know why this error comes up? and also if you can please explain it, as i want to learn by my mistakes

-Naxix
Reply
#2

Here's your problem:
pawn Код:
if(vehicleid == Bike5);
{
}
Remove the ; from all if statements.
Reply
#3

Quote:
Originally Posted by Don Correlli
Here's your problem:
pawn Код:
if(vehicleid == Bike5);
{
}
Remove the ; from all if statements.
Thank you!

btw, by makeing the bike respawn it kicks the player, right?
as i was not sure how to make it just kick the player from it.
Reply
#4

Yes, SetVehicleToRespawn function will remove player(s) from vehicle if he is in it.
Reply
#5

And to optimise the code you can use:

pawn Код:
new Bike[13];
Reply
#6

Quote:
Originally Posted by ¤Adas¤
And to optimise the code you can use:

pawn Код:
new Bike[13];
Instead of:

[pawn]
new Bike1;
new Bike2;
new Bike3;
and so on
[pawn]

?
Reply
#7

Yes. This array method is better.
Reply
#8

Quote:
Originally Posted by ¤Adas¤
Yes. This array method is better.
Thanks alot

Well, i'm a new scripter, so i have to learn it (:
You helped me alot
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)