[HELP] Need help, some errors.
#1

Hello, I have a problem with compiling.
When I compile it I get 2 errors and 1 warning:

Код:
C:\GAMEWORLD\gamemodes\italymafia.PWN(12218) : error 029: invalid expression, assumed zero
C:\GAMEWORLD\gamemodes\italymafia.PWN(12218) : warning 215: expression has no effect
C:\GAMEWORLD\gamemodes\italymafia.PWN(12218) : error 001: expected token: ";", but found "if"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Heres the script:

Код:
	if(strcmp(cmd,"/buygun",true)==0)
	{
 	if(IsPlayerConnected(playerid))
 	{
 		for(new i = 0; i < sizeof(Businesses); i++)
		{
			if (PlayerToPoint(25.0, playerid,Businesses[i][ExitX], Businesses[i][ExitY], Businesses[i][ExitZ]))
			{
				if(GetPlayerVirtualWorld(playerid) == i)
	  			{
				  if(Businesses[i][BizType] == 4) //Ammunation
			  	{
		    		if(Businesses[i][Products] != 0)
		    		{
							new x_info[256];
							x_info = strtok(cmdtext, idx);
						  new wstring[128];

							if(!strlen(x_info)) {
								format(wstring, sizeof(wstring), "[------------------------[%s]------------------------]", Businesses[i][BusinessName]);
								SendClientMessage(playerid, COLOR_LIGHTGREEN, wstring);
								SendClientMessage(playerid, COLOR_RED, "(Type name, no spaces, no capitals. Example. deagle)");
								SendClientMessage(playerid, COLOR_WHITE, "* Deagle - Price: $2500 - 70 Ammo.");
								SendClientMessage(playerid, COLOR_WHITE, "* MP5 - Price: $3000 - 150 Ammo.");
								SendClientMessage(playerid, COLOR_WHITE, "* M4 - Price: $4000 - 150 Ammo.");
								SendClientMessage(playerid, COLOR_WHITE, "* Country Rifle - Price: $5000 - 80 Ammo.");
								SendClientMessage(playerid, COLOR_WHITE, "* Silenced Pistol - Price: $5000 - 150 Ammo.");
								SendClientMessage(playerid, COLOR_WHITE, "* Shotgun - Price: $4000 - 70 Ammo.");
								SendClientMessage(playerid, COLOR_WHITE, "* Body Armour - Price: $1000.");
								SendClientMessage(playerid, COLOR_LIGHTGREEN, "[-------------------------------------------------------------------------------------] ");
								return 1;
							}
							if(PlayerInfo[playerid][pGunLic])
							{
								if(strcmp(x_info,"deagle",true) == 0)
								{
									if(GetPlayerPCash(playerid) >= 2500)
									{
									  GivePlayerWeapon(playerid,24,70);
									  GivePlayerPCash(playerid,-3500);
									  SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[SUCCESS:] You have successfully bought a Desert Eagle.");
									  Businesses[i][Products]--;
									  Businesses[i][Till]+=3000;
									  SaveBusinesses();
									  PlayerActionMessage(playerid,15.0,"gives the store clerk some money and gets a weapon back in return.");
									  return 1;

									}
									else
									{
									  SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] You don't have enough money!");
									  return 1;
									}
								}
								else if(strcmp(x_info,"mp5",true) == 0)
								{
									if(GetPlayerPCash(playerid) >= 3000)
									{
									  GivePlayerWeapon(playerid,29,150);
									  GivePlayerPCash(playerid,-3000);
									  SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[SUCCESS:] You have successfully bought a MP5.");
									  Businesses[i][Products]--;
									  Businesses[i][Till]+=3000;
									  SaveBusinesses();
									  PlayerActionMessage(playerid,15.0,"gives the store clerk some money and gets a weapon back in return.");
									  return 1;

									}
									else
									{
									  SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] You don't have enough money!");
									  return 1;
									}
								}
	    						else if(strcmp(x_info,"m4",true) == 0)
								{
									if(GetPlayerPCash(playerid) >= 4000)
									{
									  GivePlayerWeapon(playerid,31,150);
									  GivePlayerPCash(playerid,-4000);
									  SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[SUCCESS:] You have successfully bought a M4.");
									  Businesses[i][Products]--;
									  Businesses[i][Till]+=4000;
									  SaveBusinesses();
									  PlayerActionMessage(playerid,15.0,"gives the store clerk some money and gets a weapon back in return.");
									  return 1;

									}
									else
									{
									  SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] You don't have enough money!");
									  return 1;
									}
								}
	 							else if(strcmp(x_info,"countryrifle",true) == 0)
								{
									if(GetPlayerPCash(playerid) >= 5000)
									{
									  GivePlayerWeapon(playerid,33,80);
									  GivePlayerPCash(playerid,-5000);
									  SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[SUCCESS:] You have successfully bought a Country Rifle.");
									  Businesses[i][Products]--;
									  Businesses[i][Till]+=5000;
									  SaveBusinesses();
									  PlayerActionMessage(playerid,15.0,"gives the store clerk some money and gets a weapon back in return.");
									  return 1;

									}
									else
									{
									  SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] You don't have enough money!");
									  return 1;
									}
								}
								else if(strcmp(x_info,"silencedpistol",true) == 0)
								{
									if(GetPlayerPCash(playerid) >= 5000)
									{
									  GivePlayerWeapon(playerid,23,150);
									  GivePlayerPCash(playerid,-5000);
									  SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[SUCCESS:] You have successfully bought a 9MM Silenced Pistol.");
									  Businesses[i][Products]--;
									  Businesses[i][Till]+=5000;
									  SaveBusinesses();
									  PlayerActionMessage(playerid,15.0,"gives the store clerk some money and gets a weapon back in return.");
									  return 1;

									}
									else
									{
									  SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] You don't have enough money!");
									  return 1;
									}
								}
								else if(strcmp(x_info,"shotgun",true) == 0)
								{
									if(GetPlayerPCash(playerid) >= 4000)
									{
									  GivePlayerWeapon(playerid,25,70);
									  GivePlayerPCash(playerid,-4000);
									  SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[SUCCESS:] You have successfully bought a Shotgun.");
									  Businesses[i][Products]--;
									  Businesses[i][Till]+=4000;
									  SaveBusinesses();
									  PlayerActionMessage(playerid,15.0,"gives the store clerk some money and gets a weapon back in return.");
									  return 1;

									}
									else
									{
									  SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] You don't have enough money!");
									  return 1;
									}
								}
							}
							else
							{
								SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] You don't have a weapon license, you can only buy:");
								SendClientMessage(playerid, COLOR_RED, "(Type name, no spaces, no capitals. Example. deagle)");
								SendClientMessage(playerid, COLOR_WHITE, "* Body Armour - Price: $1500.");
							}
							else if(strcmp(x_info,"bodyarmour",true) == 0) // This is the Error line..
							{
								if(GetPlayerPCash(playerid) >= 1000)
								{
								  new Float:armour;
								  GetPlayerArmour(playerid,armour);
								  if(armour != 100.0)
								  {
									  GivePlayerPCash(playerid,-1000);
									  SetPlayerArmour(playerid,100);
									  SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[SUCCESS:] You have successfully bought Body Armour.");
									  Businesses[i][Products]--;
									  Businesses[i][Till]+=1000;
									  SaveBusinesses();
									  PlayerActionMessage(playerid,15.0,"gives the store clerk some money and gets body armour back in return.");
									  return 1;
								  }
								  else
								  {
								  	SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] Your armour's full!");
								  	return 1;
								  }
								}
							}
						}
					}
				}
			}
		}
	}
	return 1;
}
Reply
#2

Anyone? Please this is important for me and my script.
Reply
#3

You probably have ; missing on that line
Reply
#4

else if(strcmp(x_info,"bodyarmour",true) == 0) // This is the Error line..

and no, I dont need ; There
Reply
#5

then it shoud probably be
Код:
if(strcmp(x_info,"bodyarmour",true) == 0)
Reply
#6

I think you have the bodyarmour code in wrong place. Put it where the other else if's are.
Reply
#7

Quote:
Originally Posted by Μαστερμινδ
then it shoud probably be
Код:
if(strcmp(x_info,"bodyarmour",true) == 0)
Okee it works now, thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)