ID:145806
 
Code:
verb/attack()
for(var/mob/enemies/M in get_step(src,src.dir))
if(istype(M,/mob/enemies)&&(waiter>0))
Attack(M)
else
sleep(attackspeed)
for(var/mob/players/P in get_step(src,src.dir))
if (istype(P,/mob/players)&&(waiter>0)&&(pvp == 1)&&(P.pvp == 1))//check both players have PVP active
PVPAttack(P)
else
sleep(attackspeed)

Bump(mob/enemies/M) //When the mob bumps into another mob
var mob/players/P
if (istype(M,/mob/enemies)&&(waiter>0)) //If the mob is an enemy...
Attack(M)
if (istype(P,/mob/players)&&(waiter>0)&&(pvp == 1)&&(P.pvp == 1))//check both players have PVP active
PVPAttack(P)// I think the prob is here and it sholud be PVPAttack(M)????
sleep(attackspeed)


Problem description:

The attack verb works fine but it wont work with bump when using directional keys no errors just no dmg.. Its been a long night and cant see the prob.. Please help anyone?

(Supaz)
you need:
P = usr
In response to Rky_nick
Rky_nick wrote:
you need:
> P = usr
>


P is supposed to be the player not the usr... What did I do wrong?

It compiles and runs as it is but no damage is delt
In response to Supanova
P isnt defined. you just made a varible for P.
P is currently only a typepath.
you want it to be the player. P = usr.
In response to Rky_nick
Rky_nick wrote:
P isnt defined. you just made a varible for P.
P is currently only a typepath.
you want it to be the player. P = usr.

aye thank you that worked... Although not right away... Ended up hitting myself but I think I sorted it

Thank you
In response to Rky_nick
Please go shoot yourself the next time you think about giving advice to newbies. That's AWFUL. NO PUT USR IN PROC. ESPECIALLY MOVEMENT PROCS!

I've only had a cursory glance at the code, but the player is either src or the argument to Bump().
In response to Jp
oops.