Question Calling the functions from another txt file

Carebear

Veteran
Messages
10
Reaction score
3
Points
783
Game: Black Ops 3
Mode - MP & ZM

Im on my third mod menu, just slowly learning and improving over time and as I progress and make my code cleaner id like to ask a question.

Question - Can I call functions from a txt file/notepad on _clientids file.
I want to have all my functions on this function txt to clean up my mod menu and overall make it easier for me.

How do i do this? thanks
 

vampytwist

"Don't you trust me?"
Messages
644
Reaction score
620
Points
758
You can't call functions from a .txt file, has to be .gsc..

for the sake of this little tut imagine we have a file called mods.gsc which is placed in scripts\zm\

What you would do is first add it to the zm_mod.zone
Code:
scriptparsetree,scripts/zm/mods.gsc

Then at the top of clientids or the .gsc file you are using, add this. This let's it know to use/include that file
Code:
#using scripts\zm\mods;

Then in your mods.gsc file give it a name
Code:
#namespace mods; //this is what will be used to call functions e.g mods::unlimitedammo(); you can call it anything you want
 

vampytwist

"Don't you trust me?"
Messages
644
Reaction score
620
Points
758
Here is an example of the above code setup for both MP and ZM

Also if you want to call the mods from an option in a mod menu it has to be done like this:
Code:
&mod::unlimitedammo
 

Attachments

  • example.zip
    25.9 KB · Views: 371

Carebear

Veteran
Messages
10
Reaction score
3
Points
783
Here is an example of the above code setup for both MP and ZM

Also if you want to call the mods from an option in a mod menu it has to be done like this:
Code:
&mod::unlimitedammo

Thank you very much and the txt is what i meant. Cant wait to get home and do this☺️
 

vampytwist

"Don't you trust me?"
Messages
644
Reaction score
620
Points
758
Thank you very much and the txt is what i meant. Cant wait to get home and do this☺️

Ahh right haha I legit thought you meant calling it from an actuall .txt file I was like 0.o.. but you're welcome and good luck with your modding adventures. If you need any further help or assistance feel free to message me :smile:
 
Top