ID:145547
 
Code:
    proc
sabre()
if(src.attacking == 0)
var/obj/K = new/obj/wepSabre
flick("sabre",usr)
spawn(3)
src.attacking = 1
K.dir = src.dir
K.loc = src.loc
step(K, dir)
var/turf/X = K.loc
spawn(3)
del(K)
for(var/mob/M as mob in X)
if(M == src)
continue
var/damage = rand(1,5)
if(prob(70))
src<<"You attack [M] for [damage] damage!"
M<<"[src] attacks you for [damage] damage!"
M.health -= damage
deathcheck()
else
src<<"You attempt to attack [M] but miss!"
M<<"[src] attempts to attack you but misses!"
sleep(7)
src.attacking = 0



AND





proc
Megashoot() //name of proc
var/obj/H = new/obj/Megabullet
flick("Zon shoot",usr)
spawn(3)
if(src.fired == 0)
src.fired = 1
spawn(20)
src.fired = 0
H.dir = src.dir
H.loc = src.loc
while(H)
step(H,H.dir)
var/turf/T = H.loc
if(T.density == 1)
del(H)
break
for(var/mob/M as mob in T)
if(M == src)
continue
src<<"You shot [M]!"
M.health -= 15
deathcheck()

del(H)
sleep(2)
if(usr.ammo <= 0)
usr << "You need to restock your ammo [usr]"


Problem description:
Well when I kill a enemy and it's shooting.. its bullets stay where they were and if I hit the bullets it wont hurt me, but it pisses me off that they are in my way... same with my enemies that attack with sabres...... can you help me ;D

I put 2 random gun/sabre codes up their

Hello? anyone reading this?
In response to Kingster
Please don't bump your post unless 24 hours have passed and it is off the front page. This is not a realtime chatroom, therefore we cannot get to all of the posts immediately.

1.) For Boolean variables ( Variables that can only be TRUE or FALSE ), use if( variable ) for TRUE, and if( !variable ) for FALSE.

2.) And I quote, "No put usr in proc. Put usr in verb only. No pull SSGX. Carve wheel with bone. Ungh."
In response to Audeuro
I put usr in that? oops....... sorry for bumping ^^
Well, you're calling deathcheck() which is wrong, since src in both those procs is not the mob dying. That should be M.deathcheck(src). Within the deathcheck() proc you should always have the victim as its src, and if you need to know the killer you should provide that as an argument. (Never rely on usr there.)

Lummox JR