• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tutorial] Constants
#1
Hello, OMA

Another random tutorial, this time is about CONSTs, they are something like info that you add at the top of your gsc file and allow you to use it anywhere in your code.
They work like this, at the top of your gsc file, before your first thread add something like this for example:

Code:
CONST_player_oma = 20;    
CONST_icecream = 15;    
CONST_gay_text = "OMA is sick";

Now, you can use them anywhere in your code, for example like this:

Code:
shader settext(CONST_gay_text);

or

Code:
self setplayerangles((self.angles[0],self.angles[1]*CONST_icecream,self.angles[2]));

This method will allow you in dont defining so many things.

Thats all, Nyan Cat
[Image: veovuq.png]
  Reply
#2
I didn't even know this. Smile nice
[Image: MaEIQ.png]
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)