just testing what would happen i made this:
PHP Code:
function onActionserverside(acc,weapon){
e = findplayer(acc);
if(e != NULL) echo("Found Player: " @ e);
else echo("Player NOT found:" @ acc);
e.addweapon(weapon);
}
//#CLIENTSIDE
function onPlayerchats(){
tokens = player.chat.tokenize();
if(tokens[0] == "/findplayer"){
triggeraction(0,0,"serverside","Sern",tokens[1],tokens[2]);
}
}
and when weapon = NULL it returns a function error to the RC.
yes i could just add if(weapon != NULL) but i wanted to see if gs2 would look for the function addweapon if no weapon was specified. this also happens to removeweapon
this also happens if the weapon doesn't exist
GraalScript: Function addweapon not found at line 5 in script of Sern (in level test.nw at pos (0, 0))