ID:266306
 
When I tried to use Spuzzems' S_Admin, it didn't work, so I'm trying to come up with my own stuff to use. I want to be able to use an attack or spell or something, on whomever I choose to use it on in my game. Heres what I have

mob
proc
hurtanyone()
for(M as mob in world)
if(M.hitpoints <= 100)
usr << "He is too weak, that would be mean"
else
M.hitpoints -= 100
M << "HAHAH!"
This gives me bad var errors, but they are variables, I have them being used in other procs. Can somone help me plz?
I'm trying to come up with my own stuff to use. I want to be able to use an attack or spell or something, on whomever I choose to use it on in my game. Heres what I have
mob
proc
hurtanyone()
for(M as mob in world)
if(M.hitpoints <= 100)
usr << "He is too weak, that would be mean"
else
M.hitpoints -= 100
M << "HAHAH!"
This gives me bad var errors, but they are variables, I have them being used in other procs. Can somone help me plz?

Get rid of the for m as mob in worl and just put
Hurtanyone(mob in world)
then change the M to src or mob



~Richter
In response to Richter
Richter wrote:
I'm trying to come up with my own stuff to use. I want to be able to use an attack or spell or something, on whomever I choose to use it on in my game. Heres what I have
mob
proc
hurtanyone()
for(M as mob in world)
if(M.hitpoints <= 100)
usr << "He is too weak, that would be mean"
else
M.hitpoints -= 100
M << "HAHAH!"
This gives me bad var errors, but they are variables, I have them being used in other procs. Can somone help me plz?

Get rid of the for m as mob in worl and just put
Hurtanyone(mob in world)
then change the M to src or mob



~Richter

no mob wuldnt work, bu mob/M would and the M would in your verb too.
In response to Air _King
Air _King wrote:
no mob wuldnt work, bu mob/M would and the M would in your verb too.

Nope.. need var/mob/M :)
In response to Vortezz
Vortezz wrote:
Air _King wrote:
no mob wuldnt work, bu mob/M would and the M would in your verb too.

Nope.. need var/mob/M :)

in the () of the hurtanyone it would work
In response to Air _King
Bad thing with that is you would get a list of all non-client mobs along with client mobs using it as a var could check for cliet mobs only or non-client mobs only.
My revision:
mob/var/health = 500 as num
mob/verb/HurtAll()
set name = "Hurt Everyone"
var/peoplehurt = 0 as num
var/peoplesafe = 0 as num
var/hitlist = list()
for(var/mob/M in world)
if(M.health >= 100)
peoplehurt += 1
var/newhit = new /obj/ (null)
newhit.name = M.name
hitlist += newhit
M.health -= rand(rand(1,rand(15,20)),rand(21,rand(35,40)))
else
peoplesafe += 1
if(peopehit >= 1)
src << "[peoplehurt] people were hurt in all."
for(var/M as anything in hitlist)
src << "[M] was hit."
else
src << "No people were hit."
if(peoplesafe >= 1)
src << "[peoplesafe] people were safe from your wrath."
else
src << "Noone was safe from damage."


I have not compiled this to make sure it works, but it would sure be a fun proc! I think I'll add it to crazii world!
In response to Nadrew
i have an admin in the lbirary use mine. Also there is a psma guard in there.