iTahhr
Well-Known Member
- Messages
- 248
- Reaction score
- 118
- Points
- 243
iTahhr's Managed Code List
NOTE: I do not claim to be the best coder so if i make any mistakes please correct me down below or send me a pm telling me what i could add or improve to this tutorial thread, thanks!
Symbols and includes:
Q: What is symbols and includes?
A: Symbols and includes are useful for if statements and some other stuff.
Symbols and includes:
Q: What is symbols and includes?
A: Symbols and includes are useful for if statements and some other stuff.
Examples:
Symbols and includes:
Code:
if(self.origin[0] >= 100)//Checks to see if your origin is the same as "100,342,22"
self iprintln("you're more than or equal to 100");
Symbols and includes:
Code:
> means more than[/LEFT]
< means less than
== means equals
>= means more than or equal
<= means less than or equals
!= means not equal
|| means or
&& means and
Variable:
Q: What are Variables used for?
A: Variables are used to store information.
Q: What are Variables used for?
A: Variables are used to store information.
Examples:
Variable:
Code:
Variable = "Lets Learn Together";
if(Variable == "Lets Learn Together")
self iprintln("Continue Code");
Variable:
Code:
Variable = "Lets Learn Together";
Floats and int's:
Q: What are Floats and int's?
A: Floats and ints change Variables to values.
Q: What are Floats and int's?
A: Floats and ints change Variables to values.
Examples:
Floats and int's:
Code:
time = strTok(".5,.5,.2,.2,.1,.05", ",");
for(Ext = 0; Ext < 6; Ext++)
{
wait float(time[Ext]);
}
Int's are used the same way but you only use ints when you aren't using decimals.
Floats and int's:
Code:
float(time[Ext]);
int(time[Ext]);
Strtok:
Q: What are Strtok used for?
A: Strtok is used to store data until it is being called.
Examples:Q: What are Strtok used for?
A: Strtok is used to store data until it is being called.
Code:
So lets make it count to 10, always remember in gsc the first value will always be 0 so if you want to count to 10 you would do, Ext = 0; Ext <9; Ext++ in a loop.
Example = strTok("1,2,3,4,5,6,7,8,9,10", ",");
for(Ext = 0; Ext < 9; Ext++)
{
self iprintln("Current Num: ^2" + Example[Ext]);
wait .2;
}
Strtok:
Code:
Example = strTok(" ", ",");
Words/Commands:
Q: Why are these useful?
A: These are usful since you can end loops easily etc.
Examples:Q: Why are these useful?
A: These are usful since you can end loops easily etc.
Code:
if(self useButtonPressed())
break;
Words/Commands:
Code:
break; means terminate/end.
return; means terminate and reurn to called function.
continue; means continue.
Clean Code:
Q: Why should we clean our code if it works?
A: Clean code means better code since people will be able to read it if you are having issues.
Examples:Q: Why should we clean our code if it works?
A: Clean code means better code since people will be able to read it if you are having issues.
Code:
if(self.variable ) //means if true
self iprintln("variable is currently False");
Clean Code:
Code:
if(self.variable ) //means if true
if(!self.variable ) //means if false
1 2
true false
Fixing Overflows:
Q: Overflows suck but they're hard to fix?
A: Yes overflows do suck but they are simple to fix.
Notes:Q: Overflows suck but they're hard to fix?
A: Yes overflows do suck but they are simple to fix.
Code:
Make sure everything is getting fixed as "player"!
Fixing Values: setValue
Fixing Normal Text: setSafeText
Examples:
Code:
if(isDefined(player.FuncVariableHere))
{
player.Ext["Tuts"] = setSafeText("Hello CCM");
player.Ext["MainTut"] = setSafeText("Welcome To...");
}
Fixing Overflows:
Code:
if(isDefined(player.FuncVariableHere))
{
//Fixing Text Here
}
Fonts:
Q: The default font is good enough?
A: Yes the font is good but you might like a different one better.
Q: The default font is good enough?
A: Yes the font is good but you might like a different one better.
Example:
Fonts:
Pressed Buttons:
Colour Codes:
Code:
self.Ext["Txt"] = drawText("Hiya xoxo", "FONT HERE PLEASE!! ", 1.4, "BOTTOM", "BOTTOM", 0, -5, (1,1,1), 3, 5);
Fonts:
Code:
default[/LEFT]
bigfixed
smallfixed
objective
big
small
extrabig
extrasmall
Pressed Buttons:
Q: I leave the buttons the same because they are hard to change?
A: They're not hard to change like you will find out.
Example:Q: I leave the buttons the same because they are hard to change?
A: They're not hard to change like you will find out.
Code:
if(self BUTTONPRESSEDHERE!!())
Pressed Buttons:
Code:
if(self sprintbuttonpressed()) self iprintln("SPRINT");
if(self inventorybuttonpressed()) self iprintln("INVENTORY");
if(self secondaryoffhandbuttonpressed()) self iprintln("SECONDARY OFFHAND");
if(self fragbuttonpressed()) self iprintln("FRAG");
if(self stancebuttonpressed()) self iprintln("STANCE");
if(self jumpbuttonpressed()) self iprintln("JUMP");
if(self meleebuttonpressed()) self iprintln("MELEE");
if(self throwbuttonpressed()) self iprintln("THROW");
if(self adsbuttonpressed()) self iprintln("ADS");
if(self actionslotfourbuttonpressed()) self iprintln("ACTION SLOT FOUR");
if(self actionslotthreebuttonpressed()) self iprintln("ACTION SLOT THREE");
if(self actionslottwobuttonpressed()) self iprintln("ACTION SLOT TWO");
if(self actionslotonebuttonpressed()) self iprintln("ACTION SLOT ONE");
if(self attackbuttonpressed()) self iprintln("ATTACK");
if(self changeseatbuttonpressed()) self iprintln("CHANGE SEAT");
if(self usebuttonpressed()) self iprintln("USE");
Iprintln Buttons:
Q: Sometimes i see people using buttons in text, How can i do that?
A: This is easy, you just need the button codes.
Q: Sometimes i see people using buttons in text, How can i do that?
A: This is easy, you just need the button codes.
Example:
Iprintln:
Code:
self iptintln("Press button [{+usereload}] to activate the mod!");
Iprintln:
Code:
dpad-up: [{+actionslot 1}]
dpad-down: [{+actionslot 2}]
dpad-left: [{+actionslot 3}]
dpad-Right: [{+actionslot 4}]
X: [{+gostand}]
O: [{+stance}]
Square: [{+usereload}]
Triangle: [{weapnext}]
R3: [{+melee}]
L3: [{+breath_sprint}]
R2: [{+frag}]
L2: [{+smoke}]
R1: [{+attack}]
L1: [{+toggleads_throw}]
L1: [{+speed_throw}]
Colour Codes:
Q: How do i change the colour of things easily?
A: Its simple you will just need the colour code you would like to use.
Example:Q: How do i change the colour of things easily?
A: Its simple you will just need the colour code you would like to use.
Code:
self.Ext["Tut"] = drawText("^1This is colour red", "default", 1.4, "BOTTOM", "BOTTOM", 0, -5, (1,1,1), 3, 5);
Colour Codes:
Code:
^1 = red
^2 = green
^3 = yellow
^4 = blue
^5 = light blue
^6 = purple
^7 = white
^8 is a color that changes depending what level you are on.
American maps = Dark Green
Russian maps = Dark red/marroon
British maps = Dark Blue
^9 = grey
^0 = black
Credits:
iTahhr.
Extinct P.S. Made It Better.
iTahhr.
Extinct P.S. Made It Better.
Last edited: