How Would I make a Mass Delete verb for a building game...where GMs can click 1 button in there verbs,click the name of the person they want to delete all there objects of, and BAM world << "[usr] deletes all objects in the world by [M]!"
mob/GM
verb
Mass_Delete(M as mob,var/obj/o in view())
del o
world << "[usr] deletes all objects in the world by [M]
1
2
ID:263930
Mar 7 2008, 4:57 pm
|
|
Mar 7 2008, 5:08 pm
|
|
The players would need a list objects they created:
|
If you just have a basic owner var for all the objects, an easy way to do it would be...
mob/GM/verb/Mass_delete(var/mob/M in world) |
In response to Jeff8500
|
|
That's a poor and screwed-up way of doing it, I must say.
|
In response to Popisfizzy
|
|
Yeah, but it works and its easy...
Or atleast I think it works xD |
In response to Jeff8500
|
|
Easy does not make it good. Good practice comes first.
|
In response to Popisfizzy
|
|
Yes, but it helps to start out easy and work your way up.
|
In response to Jeff8500
|
|
Not if someone gives you code that works better.
|
In response to Popisfizzy
|
|
How can you learn from something you don't understand though?
|
In response to Popisfizzy
|
|
You might also want to make the created_objects list a tmp var, just so it doesn't save them...
|
In response to Jeff8500
|
|
...by asking questions.
|
In response to Jeff8500
|
|
I'd think you'd want to save what they created, as a player could simply relog to avoid getting all their stuff deleted, causing problems for the administration.
|
Yo...Jeff and Pop...Jeff, where would you put - world << "[src] deleted all objects in the world by [M.key]." -in that code u gave me? and Pop..Yours world message thing works but it doesnt delete the objects..
|
In response to Popisfizzy
|
|
Yes, but creating alot of objects upon loading could cause problems for the server...
I'm not sure if that would cause problems in 4.0 with its object limit, but if someone's objects aren't periodically deleted while they are on it could eventually cause problems. |
In response to Reno Kujika
|
|
In mine, you would put it below the switch/if part and above the for proc. Also, if your using Popisfizzy's code, you have to remember to make your build verbs look kind of like this.
mob/verb/Build_Pie() |
In response to Jeff8500
|
|
Then you modify it so that the list is saved for a time, and then deleted, giving the administration time to handle clean up.
|
In response to Popisfizzy
|
|
Popisfizzy wrote:
I'd think you'd want to save what they created, as a player could simply relog to avoid getting all their stuff deleted, causing problems for the administration. Uh, that's what you could do if they were saved. If they weren't saved, you couldn't do that. |
In response to Jeff8500
|
|
Your a life savor Jeff :P really needed that verb
|
In response to Popisfizzy
|
|
Thanks Jeff for a working code, thanks Popisfizzy for trying. I appreciate it ^_^
|
In response to Reno Kujika
|
|
...no, you see, mine does work. Whether or not you could implement it is irrelevant.
|
1
2