SA-MP Forums Archive
A error i get alot, for some reason - 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: A error i get alot, for some reason (/showthread.php?tid=65489)



A error i get alot, for some reason - Tisca - 13.02.2009

Look at this code:

Код:
teleportmenu = CreateMenu("Teleportmenu", 2, 200.0, 100.0, 150.0, 150.0);
Код:
public OnGameModeInit()
{
	// Don't use these lines if it's a filterscript
	SetGameModeText("Blank Script");
	AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
	return 1;
}

{
	teleportmenu = CreateMenu("TeleportMenu", 2, 200.0, 100.0, 150.0, 150.0);
And that is my code, and then i get this error:

Код:
C:\Users\Alex\Desktop\Spil\GetRaped.pwn(41) : error 055: start of function body without function header
And this is my line 41:

Код:
{



Re: A error i get alot, for some reason - SilentMouse - 13.02.2009

You just randomly stuck teleportmenu = CreateMenu("Teleportmenu", 2, 200.0, 100.0, 150.0, 150.0); in the middle of nowhere, try putting it under OnGameModeInit.


Re: A error i get alot, for some reason - Tisca - 13.02.2009

Thanks, but now i get another error..

Код:
C:\Users\Alex\Desktop\Spil\GetRaped.pwn(39) : error 017: undefined symbol "teleportmenu"
And line 39 ->

Код:
teleportmenu = CreateMenu("teleportmenu", 2, 200.0, 100.0, 150.0, 150.0);
And this is my top of the script:

Код:
#include <a_samp>

// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#if defined FILTERSCRIPT
new Menu:teleportmenu;
public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Blank Filterscript by your name here");
	print("--------------------------------------\n");
	return 1;
}
So it should work, because i put new Menu:teleportmenu;


Re: A error i get alot, for some reason - [RP]Rav - 13.02.2009

put
Код:
new Menu:teleportmenu;
above
Код:
#if defined FILTERSCRIPT



Re: A error i get alot, for some reason - Tisca - 13.02.2009

And now it works, thanks for the help guys, really.