Thread: Hmm?
View Single Post
  #3  
Old 11-27-2009, 11:00 AM
Sage_Shadowbane Sage_Shadowbane is offline
Graal Developer
Sage_Shadowbane's Avatar
Join Date: Mar 2004
Posts: 585
Sage_Shadowbane will become famous soon enough
Quote:
Originally Posted by DustyPorViva View Post
Boolean is short for 'true or false' conditions. Foo and Bar are just fillers to use as examples. Such as, this.foo = true; would just be to show how to set a variable, and foo in reality is nothing at all, foo could be anything you want it to be.
Ahhh ok, thanks for the info Dust.

Edit: Since I made a thread, I'm actually having a problem with a code I'm working on. For some odd reason, when I made this script at first and was testing some minor things, it worked fine. Than I started to add more details into the script to finish it up. Now all of a sudden the onWeaponFired() function wont call anything, I've even tried deleting all of the code and simply adding a clientsided onWeaponFired() with it setting the player.chat variable, and oddly it STILL wont work.. anyone know why this could be?? Yes I am sure that I have the weapon, as I've set player.chat in the onCreated() event. Someone help please.. ? o.O

Here is the code:
PHP Code:
function onActionServerside()
{
  if ( 
params[0] == "Explode" ) {
  
    
temp.findplayer(params[5]).level.putnpc2(params[1], params[2], "");
    
temp.n.join("object_explosion");
    
temp.n.bombRange params[3];
    
temp.n.bombThrowDir params[4];
    
temp.n.bombPlacer params[5];
  }
}

//#CLIENTSIDE
function onCreated()
{
  
this.pulledoutBomb false;
  
this.canThrow false;
  
this.explosionTimer nil;
}

function 
onWeaponFired() 
{  
  
player.chat "debug";
  if ( !
this.pulledoutBomb ) {
  
    
onTimeout();
    
player.chat "Pull out bomb!";
  }
  if ( 
this.pulledoutBomb ) {
    if ( 
this.canThrow ) {
    
      
player.chat "Throw bomb!";
      
onCreated();
      
setTimer(0);
    }
  }
}

function 
onTimeout()
{
  
temp.bombRange 1;
  
temp.bombThrowDir player.dir;
  
temp.bombPos = {player.+ (vecx(player.dir) * 3) - 2.5
                  
player.+ (vecy(player.dir) * 3) - 2};  
  
temp.bombPlacer player.account;
  if ( !
this.pulledoutBomb ) {
  
    
this.pulledoutBomb true;
  }
  if ( 
this.pulledoutBomb ) {
    if ( 
this.explodeTimer ) {
    
      
this.explodeTimer += .05;
      
this.canThrow true;
    }
    if ( 
this.explodetimer >= ) {
    
      
this.canThrow false;
      
setani("hurt"nil);
      
triggerServer("gui"this.name"Explode"bombPos[0], bombPos[1], temp.bombRangetemp.bombThrowDirtemp.bombPlacer);
      
onCreated();
      
setTimer(0);
    }
  }
  
setTimer(0.05);

Reply With Quote