SA-MP Forums Archive
1 error with adding a menu - 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: 1 error with adding a menu (/showthread.php?tid=70164)



1 error with adding a menu - zanakinz - 22.03.2009

this is the error i get from this script:
Код:
C:\Users\Alex\Downloads\PimpTown RPG V1.0\gamemodes\larp3.pwn(44829) : error 021: symbol already defined: "AddMenuItem"
im trying to do this:
Код:
public ShowMenuMafia()
	MafiaMenu1 = CreateMenu("Mafia Teleports", 2, 125, 150, 300);
	AddMenuItem(MafiaMenu1, 0, "Roof");
	AddMenuItem(MafiaMenu1, 1, "Hq Roof");
	AddMenuItem(MafiaMenu1, 0, "Graveyard");
	AddMenuItem(MafiaMenu1, 1, "Hq Graveyard");
}



Re: 1 error with adding a menu - FUNExtreme - 22.03.2009

Wheres the opening brace? eg {


Re: 1 error with adding a menu - ReCoN-CRRPG - 22.03.2009

You're missing the opening brace, make the code like this:"

pawn Код:
public ShowMenuMafia()
{
    MafiaMenu1 = CreateMenu("Mafia Teleports", 2, 125, 150, 300);
    AddMenuItem(MafiaMenu1, 0, "Roof");
    AddMenuItem(MafiaMenu1, 1, "Hq Roof");
    AddMenuItem(MafiaMenu1, 0, "Graveyard");
    AddMenuItem(MafiaMenu1, 1, "Hq Graveyard");
}
If you still get an error, post back


Re: 1 error with adding a menu - zanakinz - 22.03.2009

thank you no errors.
But whats Tag missmatch mean?


Re: 1 error with adding a menu - ReCoN-CRRPG - 22.03.2009

Post the warning


Re: 1 error with adding a menu - zanakinz - 22.03.2009

Код:
C:\Users\Alex\Downloads\PimpTown RPG V1.0\gamemodes\larp3.pwn(42166) : warning 203: symbol is never used: "str"
C:\Users\Alex\Downloads\PimpTown RPG V1.0\gamemodes\larp3.pwn(44828) : warning 213: tag mismatch
C:\Users\Alex\Downloads\PimpTown RPG V1.0\gamemodes\larp3.pwn(44829) : warning 213: tag mismatch
C:\Users\Alex\Downloads\PimpTown RPG V1.0\gamemodes\larp3.pwn(44830) : warning 213: tag mismatch
C:\Users\Alex\Downloads\PimpTown RPG V1.0\gamemodes\larp3.pwn(44831) : warning 213: tag mismatch
C:\Users\Alex\Downloads\PimpTown RPG V1.0\gamemodes\larp3.pwn(44832) : warning 213: tag mismatch
C:\Users\Alex\Downloads\PimpTown RPG V1.0\gamemodes\larp3.pwn(44894) : warning 203: symbol is never used: "GetPointDistanceToPointExMorph"
C:\Users\Alex\Downloads\PimpTown RPG V1.0\gamemodes\larp3.pwn(44894) : warning 203: symbol is never used: "adminspec"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase

Header size:      8972 bytes
Code size:     1626036 bytes
Data size:     3677992 bytes
Stack/heap size:   16384 bytes; estimated max. usage=4982 cells (19928 bytes)
Total requirements: 5329384 bytes

8 Warnings.
Oh also i got another problem now Whenever i go to the pickup icon my server closes out (the .exe)
i think i messed up with the public thing here is the code of the public
Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
	if (pickupid == MafiaWeps)
	{
		SetPlayerPos(playerid,2137.6677,-2273.7737,14.7734);
		}
	if (pickupid == MafiaTele)
	{
		ShowMenuForPlayer(Mafia,playerid);
		}
		return 1;
 }
Please help


Re: 1 error with adding a menu - Delused - 22.03.2009

Make sure you create the menu before you try to show it to a player.


Re: 1 error with adding a menu - zanakinz - 22.03.2009

I did do createmenu..


Re: 1 error with adding a menu - zanakinz - 22.03.2009

Is that Code correct cuz everytime i try to go into the pickup icon it doesnt do anything and it shuts off my .exe to run the server