Firstly,
PHP Code:
//#CLIENTSIDE
function onCreated() {
foo = new[2][0];
myfunction();
}
function onMouseDown() {
player.chat = "YOU USED YOUR MOUSE!";
myfunction();
}
function myfunction() {
foo[0].add(4);
foo[0].add(2);
echo("TEST"@foo);
}
This will output TEST"4,2",0 to the f2 window every time you press a mousebutton, despite the fact it should keep adding 4,2 to foo. This has been tested with
foo = {{0},{0}};
foo = new[2];
and
foo = {0,0};
just to be sure. All of the above work when the adds are done without using functions, so it is clearly something peculiar about the fact that this is done in the function.
Secondly,
showpoly(0,{playerx,playery,playerx+5,playery,play erx,playery});
Will not do anything, while
showpoly(0,{playerx,playery,playerx+5,playery});
works fine, as it should. Now, you may be wondering why I have an extra "playerx,playery" in the first, I shall explain:
In order to show a segmented line via showpoly with but one showpoly object (the usefulness of this practice should be obvious) one must retrace part of the path in the showpoly.