ID:261715
 
My KO code is as follows:

mob/proc/KO()
if(src.PL < 0)
src.KO = 1
view(6) << "[src] is KO!!"
src << "You lose conciousness!!"
sleep(300)
src.KO = 0
src.PL = 2

and i get it to run by:

obj/Tech/GallitGunTech/verb/Gallit_Gun(mob/M in oview(6))
if(usr.Stam >= 10)
set category = "Combat"
var/Ki = input("How much power will you put in?") as num
if(Ki > 0)
var/Power = Ki*(((usr.Will+usr.Honor)/220)+1)
var/damage = rand(Power/2,Power)
view(6) << "[usr]:Gallit......."
usr.Stam = usr.Stam-10
sleep(30)
usr.blasting = 1
sleep(30)
if(usr.z == M.z)
usr.PL = usr.PL-Ki
view(6) << "[usr]:GUN!!!!"
missile(/obj/GallitGunhead,usr,M)
sleep(1)
missile(/obj/GallitGuntrail,usr,M)
sleep(1)
missile(/obj/GallitGuntrail,usr,M)
sleep(1)
missile(/obj/GallitGuntrail,usr,M)
sleep(1)
missile(/obj/GallitGuntrail,usr,M)
sleep(1)
missile(/obj/GallitGuntrail,usr,M)
view(6) << "[usr] fires a Gallit Gun at [M],doing [damage] damage!"
M.PL = M.PL-damage
usr.KO()
M.KO()
usr.blasting = 0
else
usr.PL = usr.PL-Ki
view(6) << "[usr]:GUN!!!!"
view(6) << "[usr] fires his Gallit Gun,but [M] is nowhere in sight!"
usr.KO()
usr.blasting = 0

but when it runs,it KO's usr,then when usr revives, it KO's M

any suggestions???</0>
First of all, change usr to src, and then, put return at the end of each if/else statement, that should stop it from repeating.
In response to Macros
Macros, usr is correct here, because it is used in a verb. Src is incorrect. Please know what you're talking about. Second, the problem is that when you call

usr.whatever()

The current proc will stop it's execution until whatever() returns. If you want to continue the current proc, then use

spawn() usr.whatever()
In response to Garthor
Oh my god! Garthor didn't make a sly comment about DBZ games! My world view is collapsing!
In response to Jp
Don't you mean world.view?