Thread: warp
View Single Post
  #9  
Old 11-29-2005, 04:26 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by excaliber7388
[code]
if(playerchats&&strequals(#c,bell)){
if(hasweapon(Psy system)){
setsword swordc-reverseblade.png,5;
playerswordpower = 5;
triggeraction x,y,sword,psy;
}
}
if(playerchats&&strequals(#c,bell)){
if(hasweapon(Warrior system)){
setsword swordc-reverseblade.png,6;
playerswordpower = 6;
triggeraction x,y,sword,war;
}
}[CODE]
Erm, you need to learn how to group your code together better :|

PHP Code:
if(playerchats) {
  if(
strequals(#c,bell)) {
    
if(hasweapon(Warrior system)) {
      
// ..
    
} else if(hasweapon(Psy system)) {
      
// ..
    
}
  }

Or something along those lines. In your version, if they have both weapons, both blocks of code are being called, and that is inefficient and stupid.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote