ID:286507
 
Keywords: help, message, src
(See the best response by LordAndrew.)
I'm trying to learn more about codes, so I make a small world to test my habilities. In this test, I send a message to the player alerting him what I will do and just after I delete him. Its very simple, but my question is: How I send this message only to the player. I tryed use src >>, but nothing happens. Also, i want know more about 'src'. I think this is used to substitute the subject of an code, like I do in my code.

world
mob = /mob/usr
fps = 25
icon_size = 32
view = 6

atom
icon = 'icones.dmi'

mob
usr
icon_state = "bola"
step_size = 1
New()
deletar()
obj
step_size = 8

turf
icon_state = "grama"

mob
proc
deletar()
world << "I will delete you"
sleep (10)
del(src)
Best response
Please place code between the <dm> tags, thanks.

I suggest you have a look at the Guide, specifically chapter five if you want to know more about src.

The problem I can see with your code is that there is no delay whatsoever, the second the player logs in, New() is called and they're deleted after a second. The message probably has no time to show up at all before the player is shown out the door.

world
mob = /mob/player

mob
player
proc
delete_me()
src << "You're probably going to get deleted!"

sleep(10)

del src

New()
// Create a separate thread for the procedure to run in after three seconds.
spawn(30)
delete_me()
sorry, i never use forum, so I have no ideia how to post my codes, thanks to alert me. And thanks to show me the guide, it will help me alot. And finally, thanks to answer me, i will study your code.