Jump to content
Sign in to follow this  
McArcher

Functions syntax

Recommended Posts

How to declare my own function? How to give it my parameters? Haven't found it in wiki and in forum.

Share this post


Link to post
Share on other sites

What the wiki doesn't seem to show is that you don't need to put it into a new file and compile preprocess it. You can just do:

_greet = {
 hint format ["Hi, %1",name _this];
};

player call _greet;

BUT!

Remember to make variables private inside it (_this is a special case), or you might get some unexpected things happening as variables outside of the functions are available inside it.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×