Quote:
Originally Posted by cbk1994
Yes, it should have been ==.
What do you mean by passing it to a class?
|
well, player.dir is generally clientside* so you can't really use it in a class/serverside in general until you pass it serverside
relatively, you can pass a var in a weapon from the clientside to the serverside like this:
PHP Code:
function onActionServerside(cmd, dir){
if (cmd == "bomb"){
temp.npc = putnpc2(player.x, player.y, "bomb");
temp.npc.join("personal_pig132_bomb");
sendtonc(temp.dir);
}
}
//#CLIENTSIDE
function onWeaponFired(){
temp.dir = player.dir;
triggerserver("gui", this.name, "bomb", temp.dir);
}
(With trigger.server), but how would you pass that temp.dir var to the class then?
in java you'd just redefine the var with the classname like
PHP Code:
// not gs2
classname.firstnum = secondclass.num;
and then you'd just initiate the num var in secondclass for use
how would you accomplish this in gs2?