View Single Post
  #5  
Old 04-11-2003, 10:04 PM
GrowlZ1010 GrowlZ1010 is offline
defunct
Join Date: May 2002
Posts: 187
GrowlZ1010 is on a distinguished road
Nobody else spotted this?

NPC Code:

if (weaponfired) {
if (strequals(#s(client.equipment),fists)){
setstring client.equipment,dagger;
setplayerprop #c,Equipped Dagger;
setstring client.weaponpower,2;
}
// Hey, look! client.equipment, at this point, equals dagger!
if (strequals(#s(client.equipment),dagger)){
// So let's get rid of the dagger and bring the fists back,
// despite the fact that we've just got rid of the fists!
setstring client.equipment,fists;
setplayerprop #c,Unequipped Dagger;
setstring client.weaponpower,1;
}
}



Use some kind of small modification like this to check whether or not the equipment has already been changed. Oh, and have the default weapon set automatically.
NPC Code:

if (weaponfired) {
this.check=0;
if (strequals(#s(client.equipment),fists)){
this.check=1;
// dagger equip stuff..
}
if (strequals(#s(client.equipment),dagger) && this.check=0){
// fist equip stuff..
}
if (strequals(#s(client.equipment),)){
// default weapon setting stuff..
}
}

Reply With Quote