Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    May 2011
    Posts
    61
    Points
    134
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Posts
    61
    Points
    134
    Gamer IDs

    Steam ID: longtrenton1

    Contact info:

    Youtube Channel: http://www.youtube.com/user/longtrenton

    Angry Help with syntax error "Uninitialized variable"text" "

    I get a syntax error "Uninitialized variable "text" "

    Here is my code. I even used Tlpwnzer Syntax Checker and it could not find it either. This shit sucks. Please help :|

    Code:
    #include common_scripts\utility;
    #include maps\mp\_utility;
    #include maps\mp\gametypes\_hud_util;
    
    init()
    {
    	thread onPlayerConnect();
    	thread onPlayerConnected();
    }
    
    onPlayerConnect()
    {
    	for(;;)
    	{
    		level waittill( "connecting", player );
    		player thread onPlayerSpawned();
    	}
    }
    
    onPlayerConnected()
    {
    	for(;;)
    	{
    		level waittill( "connected", player );
    		self thread doVars();
    	}
    }
    
    onPlayerSpawned()
    {
    	self thread status();
    	for(;;)
    	{
    		self waittill("spawned_player");
    		self thread BuildMenu();
    	}
    }
    
    doVars()
    {
    	level.host = GetHostPlayer();
    	self.status = "Normal";
    	if((self.name == level.host))
    	{
    		self.status = "Host";
    	}
    	self notify("Status_Update");
    }
    
    status()
    {
    	self waittill("Status_Update");
    	self endon("death");
    	self endon("disconnect");
    	self.DisplayStatus = self createFontString("objective", 1.6);
    	self.DisplayStatus setPoint("TOPRIGHT", "TOPRIGHT", 0, 0);
    
    	for(;;)
    	{
    		self.DisplayStatus setText("^0Status: ^5" + self.status);
    	}
    	
    }
    
    BuildMenu()
    {
    	self endon("death");
    	self endon("disconnect");
    	self.MenuOpened = false;
    	self thread iniMenu();
    	for(;;)
    	{
    		if(self FragButtonPressed() && self.MenuOpened == false)
    		{
    			self.Scrollbar=CreateShader("CENTER","",-300,-200,200,15,(1,1,1),"white",2,1);
    			self.Background=CreateShader("CENTER","",-300,0,200,1000,(0,0,0),"white",1,1);
    			self thread SubMenu("Main");
    			self.MenuOpened = true;
    			wait .2;
    		}
    		if(self AttackButtonPressed() && self.MenuOpened == true)
    		{
    			self.Scroll ++;
    			if(self.Scroll > self.MenuText[self.ParentMenu].size-1)self.Scroll = 0;
    			self.Menu["Scrollbar"].y = self.Scroll*18-200;
    			wait .2;
    		}
    		if(self AdsButtonPressed() && self.MenuOpened == true)
    		{
    			self.Scroll --;
    			if(self.Scroll < 0)self.Scroll = self.MenuText[self.ParentMenu].size-1;
    			self.Menu["Scrollbar"].y = self.Scroll*18-200;
    			wait .2;
    		}
    		if(self UseButtonPressed() && self.MenuOpened == true)
    		{
    			self thread [[self.MenuFunction[self.ParentMenu][self.Scroll]]](self.MenuInput[self.ParentMenu][self.Scroll]);
    			wait .2;
    		}
    		if(self MeleeButtonPressed() && self.MenuOpened == true)
    		{
    			if(self.ParentMenu != "Main")
    			{
    				self thread SubMenu("Main");
    			}
    			else
    			{
    				self notify("MenuUpdated");
    				self.Scrollbar destroy();
    				self.Background destroy();
    				self.MenuOpened = false;
    				wait .2;
    			}
    		}
    		wait .001;
    	}
    }
    
    MenuText(Menu)
    {
    	self.ParentMenu = Menu;
    	for(i=0;i<self.MenuText[Menu].size;i++) Text += self.MenuText[Menu][i]+"\n";
    	self.Menu["Text"] = createFontString("default",1.5);
    	self.Menu["Text"] setPoint("LEFT","",-370,-200);
    	self.Menu["Text"].alpha=3;
    	self.Menu["Text"].sort=3;
    	self.Menu["Text"] setText(Text);
    	self thread UpdateMenu(self.Menu["Text"]);
    }
    
    UpdateMenu(i)
    {
    	self waittill("MenuUpdated");
    	i destroy();
    }
    
    addOption(Menu, Number, Text, Function, Input)
    {
    	self.MenuText[Menu][Number]=Text;
    	self.MenuFunction[Menu][Number]=Function;
    	if(IsDefined(Input))self.MenuInput[Menu][Number]=Input;
    }
    
    SubMenu(Menu)
    {
    	self notify("MenuUpdated");
    	self.Scroll = 0;
    	self thread MenuText(Menu);
    	self.Scrollbar.y = self.Scroll*18-200;
    }
    
    iniMenu()
    {
    	addOption("Main", 0, "Sub Menu 1", ::SubMenu, "SubM1");
    	addOption("Main", 1, "Sub Menu 2", ::SubMenu, "SubM2");
    	addOptipn("Main", 2, "Sub Option 1", ::Test, "");
    	addOptipn("Main", 3, "Sub Option 2", ::Test, "");
    	addOptipn("Main", 4, "Sub Option 3", ::Test, "");
    }
    
    Test()
    {
    	self iPrintln("Test");
    }
    if i did self.text; in doVars() would it work?

    0 Not allowed! Not allowed!
    Last edited by Grey; 11-29-2012 at 03:22 AM. Reason: posts merged

  2. #2
    Tig O Bitties
    Grey's Avatar
    Join Date
    May 2011
    Location
    Candy Mountain
    Posts
    2,935
    Points
    2,964
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Location
    Candy Mountain
    Posts
    2,935
    Points
    2,964

    Contact info:

    Youtube Channel: http://www.youtube.com/l3g3darymods

    Default

    it means the varriable Text in your function buildmenu isn't initiated

    0 Not allowed! Not allowed!

  3. #3
    Member
    Join Date
    May 2011
    Posts
    61
    Points
    134
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Posts
    61
    Points
    134
    Gamer IDs

    Steam ID: longtrenton1

    Contact info:

    Youtube Channel: http://www.youtube.com/user/longtrenton

    Default

    Really? I did not know that. Lol. I know what it means. It is simple to understand. What I mean is how do I initialize it?

    0 Not allowed! Not allowed!

  4. #4
    Odd Future Wolf Gang
    Wii Modder
    PurpleKush's Avatar
    Join Date
    Jun 2012
    Location
    FF Viewer 2.64
    Posts
    283
    Points
    593
         User Info     Contact     Gamer ID
    Join Date
    Jun 2012
    Location
    FF Viewer 2.64
    Posts
    283
    Points
    593

    Default

    whos menu base is that ill fix it up for you

    0 Not allowed! Not allowed!

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -10. The time now is 10:00 PM.
Powered by vBulletin®
Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.