ItsMods

Full Version: Constants
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
I didn't even know this. Smile nice