View Single Post
  #5  
Old 05-15-2012, 10:39 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
As Starfire2001 just said, a single equals sign is for assignment, while two are for testing equality.

Styling your code, as you should have done before posting:

PHP Code:
//#CLIENTSIDE
function onWeaponFired() {
  if (
this.on == false) {
    
this.on == true;
    
setani("Gani"null);
    
replaceani("idle""Gani");
    
replaceani("walk""Gani2");
  } else if (
this.on == true) {
    
this.on == false;
    
setani("idle"null);
    
replaceani("idle""idle");
    
replaceani("walk""walk");
  }

Removing some redundant stuff like "== true" and fixing your assignment (you would have known that if you'd read the tutorial I've linked to you several times now)

PHP Code:
//#CLIENTSIDE
function onWeaponFired() {
  if (! 
this.on) {
    
this.on true;
    
setani("Gani"null);
    
replaceani("idle""Gani");
    
replaceani("walk""Gani2");
  } else if (
this.on) {
    
this.on false;
    
setani("idle"null);
    
replaceani("idle""idle");
    
replaceani("walk""walk");
  }

It should work now. If it doesn't, list the steps you've used to try to debug it.
__________________
Reply With Quote