omg! you have to help me with this
#1

Hey guys i am using a LARP edit as a test for this and i have found this new weapon system but when i compile it i get:


Код:
C:\**********\script.pwn(19344) : error 017: undefined symbol "Businesses"
C:\**********\script.pwn(19344) : error 036: empty statement
C:\**********\script.pwn(19344) : error 017: undefined symbol "i"
C:\**********\script.pwn(19344) : fatal error 107: too many error messages on one line
those above error messages are referring to this line:

for(new i = 0; i < sizeof(Businesses); i++)

Here is the code

Код:
if(strcmp(cmd,"/buyweapon",true)==0)
	{
 	if(IsPlayerConnected(playerid))
 	{
 		for(new i = 0; i < sizeof(Businesses); i++)
		{
			if (IsPlayerInRangeOfPoint(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: $350 - 200 Ammo.");
								SendClientMessage(playerid, COLOR_WHITE, "* MP5 - Price: $500 - 500 Ammo.");
								SendClientMessage(playerid, COLOR_WHITE, "* M4 - Price: $800 - 500 Ammo.");
								SendClientMessage(playerid, COLOR_WHITE, "* Country Rifle - Price: $800 - 500 Ammo.");
								SendClientMessage(playerid, COLOR_WHITE, "* Sniper Rifle - Price: $1200 - 500 Ammo.");
								SendClientMessage(playerid, COLOR_WHITE, "* Silenced Pistol - Price: $350 - 200 Ammo.");
								SendClientMessage(playerid, COLOR_WHITE, "* Shotgun - Price: $450 - 200 Ammo.");
								SendClientMessage(playerid, COLOR_WHITE, "* Pepperspray - Price:$10 - 500 Ammo.");
								SendClientMessage(playerid, COLOR_WHITE, "* Body Armour - Price: $150.");
								SendClientMessage(playerid, COLOR_LIGHTGREEN, "[-------------------------------------------------------------------------------------] ");
								return 1;
							}
							if(PlayerInfo[playerid][pWepLic])
							{
								if(strcmp(x_info,"deagle",true) == 0)
								{
									if(GetPlayerCash(playerid) >= 350)
									{
									  GivePlayerWeapon(playerid,24,200);
									  GivePlayerCash(playerid,-350);
									  SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[SUCCESS:] You have successfully bought a Desert Eagle.");
									  Businesses[i][Products]--;
									  Businesses[i][Till]+=35000;
									  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(GetPlayerCash(playerid) >= 500)
									{
									  GivePlayerWeapon(playerid,29,500);
									  GivePlayerCash(playerid,-500);
									  SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[SUCCESS:] You have successfully bought a MP5.");
									  Businesses[i][Products]--;
									  Businesses[i][Till]+=50000;
									  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(GetPlayerCash(playerid) >= 800)
									{
									  GivePlayerWeapon(playerid,31,500);
									  GivePlayerCash(playerid,-800);
									  SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[SUCCESS:] You have successfully bought a M4.");
									  Businesses[i][Products]--;
									  Businesses[i][Till]+=50000;
									  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(GetPlayerCash(playerid) >= 800)
									{
									  GivePlayerWeapon(playerid,33,500);
									  GivePlayerCash(playerid,-800);
									  SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[SUCCESS:] You have successfully bought a Country Rifle.");
									  Businesses[i][Products]--;
									  Businesses[i][Till]+=80000;
									  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,"sniperrifle",true) == 0)
								{
									if(GetPlayerCash(playerid) >= 1200)
									{
									  GivePlayerWeapon(playerid,34,500);
									  GivePlayerCash(playerid,-1200);
									  SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[SUCCESS:] You have successfully bought a Sniper Rifle.");
									  Businesses[i][Products]--;
									  Businesses[i][Till]+=120000;
									  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(GetPlayerCash(playerid) >= 350)
									{
									  GivePlayerWeapon(playerid,23,200);
									  GivePlayerCash(playerid,-350);
									  SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[SUCCESS:] You have successfully bought a 9MM Silenced Pistol.");
									  Businesses[i][Products]--;
									  Businesses[i][Till]+=35000;
									  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(GetPlayerCash(playerid) >= 450)
									{
									  GivePlayerWeapon(playerid,25,200);
									  GivePlayerCash(playerid,-450);
									  SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[SUCCESS:] You have successfully bought a Shotgun.");
									  Businesses[i][Products]--;
									  Businesses[i][Till]+=45000;
									  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, "* Pepperspray - Price: $1000 - 500 Ammo.");
								SendClientMessage(playerid, COLOR_WHITE, "* Body Armour - Price: $1500.");
							}
							if(strcmp(x_info,"pepperspray",true) == 0)
							{
								if(GetPlayerCash(playerid) >= 10)
								{
								  GivePlayerWeapon(playerid,41,500);
								  GivePlayerCash(playerid,-10);
								  SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[SUCCESS:] You have successfully bought Pepperspray.");
								  Businesses[i][Products]--;
								  Businesses[i][Till]+=1000;
								  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,"bodyarmour",true) == 0)
							{
								if(GetPlayerCash(playerid) >= 150)
								{
								  new Float:armour;
								  GetPlayerArmour(playerid,armour);
								  if(armour != 100.0)
								  {
									  GivePlayerCash(playerid,-15);
									  SetPlayerArmour(playerid,1000);
									  SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[SUCCESS:] You have successfully bought Body Armour.");
									  Businesses[i][Products]--;
									  Businesses[i][Till]+=1500;
									  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;
}
please help me

thanks
Reply
#2

Quote:

omg! you have to help me with this

We don't....
Wrong Section <- Ask in the LARP GM thread
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)