View Single Post
  #9  
Old 04-03-2011, 07:22 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
...

The problem is that there's absolutely no logic!

There are two blatantly obvious scenarios that need to be addressed:

1. Player changes hat
2. Player is wearing hat already

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
// Check if player is wearing hat
  
if (player.attr[1] == "hat.png") {
    
speedUP();
  }
}

function 
onWeaponFired() {
  
// Check if player is wearing the hat already
  
if (player.attr[1] == "hat.png") {
    
// Remove hat
    
player.attr[1] = "nohat.png";
    
speedDOWN();
  } else {
    
// Put on hat
    
player.attr[1] = "hat.png";
    
speedUP();
  }

That being said the problem is that the speed changing is being done primarily in each hat weapon (and the obvious security issue with the triggerserver). This work would be better off calculated in the movement system or through a "buff" system that the movement system interacts with.

Please also read and search through:
http://wiki.graal.net/index.php/Creation/Dev/GScript
__________________
Quote:
Reply With Quote