Thread: Hat Weapon
View Single Post
  #3  
Old 08-12-2010, 11:45 AM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by Fulg0reSama View Post
Your brackets are off.

PHP Code:
//#CLIENTSIDE
function onWeaponFired()
{
  if (
player.attr[1] = "ds-gasmask.png") {
  
player.attr[1] = "hat.png"
}
  else if (
player.attr[1] = "hat.png") {
  
player.attr[1] = "ds-gasmask.png'";

I think that'll work.
Not quite what he wanted though, and your equal signs are off This should do:
PHP Code:
//#CLIENTSIDE
function onWeaponFired() {
  if (
player.attr[1] == "ds-gasmask.png") {
    
player.attr[1] = "hat.png"
  } else {
    
player.attr[1] = "ds-gasmask.png'";
  }

Remember: When comparing stuff, you need two equal signs.
Reply With Quote