ItsMods

Full Version: две отдельные функции
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
(04-07-2013, 17:23)SailorMoon Wrote: [ -> ]
Code:
SettingsTEXT()
{
self endon ( "disconnect" );

infosban = "TEXT";
infosban += "TEXT..";

infosban2 = "TEXT2";
infosban2 += "TEXT..";

self.text20 = self createFontString( "normalbold", 1.5 );
self.text20 setPoint ( "RIGHTTOP", "RIGHTTOP", -5, 0);
self.text20 setText ( infosban );

self.text21 = self createFontString( "normalbold", 1.5 );
self.text21 setPoint ( "RIGHTTOP", "RIGHTTOP", -5, 0);
self.text21 setText ( infosban2 );

}
I need this code to be in two separate functions
1)SettingsTEXT()

self.text20 = self createFontString( "normalbold", 1.5 );
self.text20 setPoint ( "RIGHTTOP", "RIGHTTOP", -5, 0);
self.text20 setText ( infosban );

self.text21 = self createFontString( "normalbold", 1.5 );
self.text21 setPoint ( "RIGHTTOP", "RIGHTTOP", -5, 0);
self.text21 setText ( infosban2 );

2)BanerText()

infosban = "TEXT";
infosban += "TEXT..";

infosban2 = "TEXT2";
infosban2 += "TEXT..";
You can't use common temp variables in gscs, that's bad.

Code:
SettingsTEXT()
{
self endon ( "disconnect" );

self.text20 = self createFontString( "normalbold", 1.5 );
self.text20 setPoint ( "RIGHTTOP", "RIGHTTOP", -5, 0);
self.text20 setText ( infosban(1) );

self.text21 = self createFontString( "normalbold", 1.5 );
self.text21 setPoint ( "RIGHTTOP", "RIGHTTOP", -5, 0);
self.text21 setText ( infosban(2) );

}

infosban(num)
{
       if(num==1)
          return "infosban1 BLABLABLA";
        else if(num==2)
           return "infosban2 AHAHAHA";

       return "undefined";
}