SA-MP Forums Archive
shop help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: shop help (/showthread.php?tid=211536)



shop help - Baboon - 15.01.2011

format(Primary[playerid], sizeof(Primary[playerid]), "M4A1");

Код:
C:\Users\Timothy\Desktop\0.3c rc8\gamemodes\CODVIIItest.pwn(3423) : error 001: expected token: "]", but found "-identifier-"
C:\Users\Timothy\Desktop\0.3c rc8\gamemodes\CODVIIItest.pwn(3423) : warning 215: expression has no effect
C:\Users\Timothy\Desktop\0.3c rc8\gamemodes\CODVIIItest.pwn(3423) : error 001: expected token: ";", but found "]"
C:\Users\Timothy\Desktop\0.3c rc8\gamemodes\CODVIIItest.pwn(3423) : error 029: invalid expression, assumed zero
C:\Users\Timothy\Desktop\0.3c rc8\gamemodes\CODVIIItest.pwn(3423) : fatal error 107: too many error messages on one line

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


4 Errors.
why the **** is this not working, on top of the script:

new Primary[MAX_PLAYERS][25];



It is for my shop, to show textdraws. If I use a normal format, it shows the textdraw for all with the same text, this is not right. It should only show the text for the player. It is for making custom classes.


Re: shop help - *IsBack - 15.01.2011

Quote:
Originally Posted by timothyinthehouse
Посмотреть сообщение
format(Primary[playerid], sizeof(Primary[playerid]), "M4A1");

Код:
C:\Users\Timothy\Desktop\0.3c rc8\gamemodes\CODVIIItest.pwn(3423) : error 001: expected token: "]", but found "-identifier-"
C:\Users\Timothy\Desktop\0.3c rc8\gamemodes\CODVIIItest.pwn(3423) : warning 215: expression has no effect
C:\Users\Timothy\Desktop\0.3c rc8\gamemodes\CODVIIItest.pwn(3423) : error 001: expected token: ";", but found "]"
C:\Users\Timothy\Desktop\0.3c rc8\gamemodes\CODVIIItest.pwn(3423) : error 029: invalid expression, assumed zero
C:\Users\Timothy\Desktop\0.3c rc8\gamemodes\CODVIIItest.pwn(3423) : fatal error 107: too many error messages on one line

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


4 Errors.
why the **** is this not working, on top of the script:

new Primary[MAX_PLAYERS][25];



It is for my shop, to show textdraws. If I use a normal format, it shows the textdraw for all with the same text, this is not right. It should only show the text for the player. It is for making custom classes.
Can you post lines 3422-3424


Re: shop help - Baboon - 15.01.2011

Код:
public OnPlayerSelectedMenuRow(playerid, row)//shop
{
    TogglePlayerControllable(playerid,1);
	new Menu: Current = GetPlayerMenu(playerid);
	ShowMenuForPlayer(HIMenu,playerid);
	if(Current == HIMenu)
	{
		SetPlayerInterior(playerid,6);
		switch(row)
		{
			case 0:
      		{
				if(GetPlayerMoney(playerid) >= 15000)//m4
				{
				    if(m4text[playerid] == 1)
					{
					    ShowMenuForPlayer(HIMenu,playerid);
						return SendClientMessage(playerid, WHITE, "you already bought this weapon...");
					}
					GivePlayerMoney(playerid, -15000);
					ShowMenuForPlayer(HIMenu,playerid);
					TogglePlayerControllable(playerid,0);
					m4text[playerid] = 1;
					ak74textspawn[playerid] = 0;
					if(ak74text[playerid] == 1)
					{
						ak74text[playerid] = 0;
					}
					if(mp5text[playerid] == 1)
					{
						mp5text[playerid] = 0;
					}
					if(shotguntext[playerid] == 1)
					{
						shotguntext[playerid] = 0;
					}
					format(Primary[playerid], sizeof(Primary[playerid]), "M4A1");
    			}
				else
				{
    				SendClientMessage(playerid, WHITE, "You don't have enough money.");
    				ShowMenuForPlayer(HIMenu,playerid);
					TogglePlayerControllable(playerid,0);
				}
   			}
starting from line 3387