I'm pretty sure I'm doing this completely wrong, but... in Developer Help
|
|
Okay, once again, I'm having a firearm related problem (No, I wasn't shot). I have set variables for each gun, two of which are the delay between being able to fire and the delay for reloading the gun.
if(usr.wait == 1) return usr.projectile(new/obj/bullet(usr.loc),usr.dir,10,usr) src.clip -= 1 if(src.clip == 0) if(src.maxclip == 0) usr << "The [src] is out of ammo!" del(src) return usr.wait = 1 usr << "Reloading [src]..." sleep(src.reloadelay) if(src.maxclip <= src.fullclip - 1) src.clip = src.maxclip src.maxclip = 0 usr << "[src] reloaded." usr.wait = 0 return src.clip = src.fullclip src.maxclip -= src.fullclip usr << "[src] reloaded." usr.wait = 0 return usr.wait = 1 sleep(src.firedelay) usr.wait = 0
|
The problem is, I can set the delay variables up to like thirty or forty seconds for test purposes, and I'm still able to fire while the gun is reloading.
|