ID:148112
 
what is worng with this:
mob/cop/cop
icon='cop.dmi'
icon_state="cop"
health=100
maxhealth=100
var/mob/characters/P
New()
.=..()
spawn(1)
Wander()
proc/Wander()
while(src)
if (P in oview(5))
step_towards(src,P)
else
step_rand(src)
for(P in view(src))
break
sleep(5)
spawn(40)
Wander()
CopShoot()
proc/CopShoot(M in oview(3))
sleep(1)
missile(/obj/Shoot,usr,usr.loc)
var/damage=rand(5,15)
usr.health-=damage
usr<<"The cop has done [damage] damage to you."
src.deathcheck(M)

i would like the cop to shoot the PC when he is in 3 space of the npc and when the npc shoots a bullet shows up on the screen and hits the pc.
<dm> </dm>

that aside...

proc/CopShoot(M in oview(3))

i think it should be mob/M in oview(3)
In response to The mothball
oview(3,src) rather. Otherwise you're using usr in a proc, which is bad.
In response to Garthor
i have this now
proc/CopShoot(mob/M in oview(3,src)
sleep(1)
missile(/obj/Shoot,usr,usr.loc)
var/damage=rand(5,15)
usr.health-=damage
usr<<"The cop has done [damage] damage to you."
src.deathcheck(M)
and i get this when i compile:
combat.dm:52:error: sleep: missing comma ',' or right-paren ')'
implementation.dm:113:warning: empty 'else' clause
implementation.dm:145:warning: empty 'else' clause
leveling system.dm:10:warning: empty 'else' clause
MAFIA The City Of blood.dm:21:warning: empty 'else' clause
MAFIA The City Of blood.dm:25:warning: empty 'else' clause
MAFIA The City Of blood.dm:31:warning: empty 'else' clause
MAFIA The City Of blood.dm:35:warning: empty 'else' clause
MAFIA The City Of blood.dm:41:warning: empty 'else' clause
MAFIA The City Of blood.dm:45:warning: empty 'else' clause
npcs.dm:40:warning: empty 'else' clause
npcs.dm:51:warning: empty 'else' clause
npcs.dm:60:warning: empty 'else' clause
npcs.dm:69:warning: empty 'else' clause
npcs.dm:78:warning: empty 'else' clause
npcs.dm:85:warning: empty 'else' clause
npcs.dm:109:warning: empty 'else' clause
npcs.dm:115:warning: empty 'else' clause
npcs.dm:143:warning: empty 'else' clause
s_bubble.dm:10:error: bad argument definition
s_bubble.dm:10:error: bad argument definition
s_bubble.dm:13:error: bad argument definition
s_bubble.dm:13:error: bad argument definition
s_bubble.dm:16:error: bad argument definition
s_bubble.dm:16:error: bad argument definition
s_bubble.dm:19:error: bad argument definition
s_bubble.dm:19:error: bad argument definition
s_bubble.dm:22:error: bad argument definition
s_bubble.dm:22:error: bad argument definition
s_bubble.dm:25:error: bad argument definition
s_bubble.dm:25:error: bad argument definition
s_bubble.dm:28:error: bad argument definition
s_bubble.dm:28:error: bad argument definition
s_bubble.dm:31:error: bad argument definition
s_bubble.dm:31:error: bad argument definition
s_bubble.dm:34:error: bad argument definition
s_bubble.dm:34:error: bad argument definition
s_bubble.dm:37:error: bad argument definition
s_bubble.dm:37:error: bad argument definition
s_bubble.dm:40:error: bad argument definition
s_bubble.dm:40:error: bad argument definition
s_bubble.dm:43:error: bad argument definition
s_bubble.dm:43:error: bad argument definition
s_bubble.dm:46:error: bad argument definition
s_bubble.dm:46:error: bad argument definition
s_bubble.dm:49:error: bad argument definition
s_bubble.dm:49:error: bad argument definition
s_bubble.dm:52:error: bad argument definition
s_bubble.dm:52:error: bad argument definition
s_bubble.dm:55:error: bad argument definition
s_bubble.dm:55:error: bad argument definition
s_bubble.dm:58:error: bad argument definition
s_bubble.dm:58:error: bad argument definition
s_bubble.dm:68:warning: empty 'else' clause
s_bubble.dm:85:warning: empty 'else' clause
weapons.dm:15:warning: empty 'else' clause
weapons.dm:21:warning: empty 'else' clause
weapons.dm:31:warning: empty 'else' clause
weapons.dm:49:warning: empty 'else' clause
weapons.dm:55:warning: empty 'else' clause
weapons.dm:65:warning: empty 'else' clause
weapons.dm:83:warning: empty 'else' clause
weapons.dm:89:warning: empty 'else' clause
weapons.dm:99:warning: empty 'else' clause
weapons.dm:117:warning: empty 'else' clause
weapons.dm:123:warning: empty 'else' clause
weapons.dm:134:warning: empty 'else' clause
weapons.dm:152:warning: empty 'else' clause
weapons.dm:158:warning: empty 'else' clause
weapons.dm:167:warning: empty 'else' clause

MAFIA The City Of blood.dmb - 35 errors, 35 warnings
and all from adding this code.
In response to Drehmini
Drehmini wrote:
proc/CopShoot(mob/M in oview(3,src)

You need an extra ) on the end of that. Amazing how many errors one mistake like that can cause, no? =)
In response to Crispy
Ok ty lol :) thats kewl now it still doesnt work the cop doesnt shoot me so ty anywayz :) I'll post more on the situation