View Single Post
  #6  
Old 09-18-2011, 06:39 PM
oralgnome oralgnome is offline
doesnt afraid of anything
oralgnome's Avatar
Join Date: Sep 2011
Posts: 34
oralgnome is an unknown quantity at this point
Quote:
Originally Posted by cbk1994 View Post
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(cmddir){
if (
cmd == "bomb"){
        
temp.npc putnpc2(player.xplayer.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?
__________________
Quote:
Originally Posted by CaySedaiSim View Post
Is there a GS2 for retards book..?
Reply With Quote