ID:767759
 
(See the best response by A.T.H.K.)
Code:
obj
cheese
icon = 'cheese.dmi'

verb/kill(mob/M in oview())
set src = usr.contents //implicit src
del(M)


Problem description:

bare with me as i am still fairly new here.

what i have is a chesse that once it is picked up, there is a 'kill' command in the commands window that can kill a monster.

i would like to delete the kill proc or stop it from working after three kills.

also, a bit off topic, but anyways, i have two windows open when the game starts. one is inventory and the other is commands. the inventory is the default when the game starts but i would like it to default to be the commands window.

thank you
Best response
I would add a variable to that and count upwards.
obj
cheese
var/counter
icon = 'cheese.dmi'
verb/kill(mob/M in oview())
set src = usr.contents //implicit src
if(src.counter >= 3)
usr << "Sorry 3 max :D"
return
else
src.counter ++
del(M)


Something to like the above
++ | adds one to the variable
| >= | higher than 3 or equals 3 (without the |)