Quote:
Originally Posted by Astram
Idk how to use params.. 0.0 sorry im kind of a >>>  <<< at scripting... 
|
Parameters are passed to a function.
PHP Code:
function onCreated() {
this.myFunction("bob", "hello there");
}
function myFunction() {
player.chat = params[0] @ " says " @ params[1];
}
params is an array that you can use to see what data was given to the function. This makes it possible to use functions for many things.
Instead of using the params array, you should usually assign parameters a name, like so:
PHP Code:
function myFunction(person, msg) {
player.chat = person @ " says " @ msg;
}