i want to delete objs that i have added to the screen
i have tryed
-- code --
var/obj/remove = (/obj/make0 in client.screen)
del(remove)
-- end --
i get a error with this one
-- error --
runtime error: bad del
proc name: remove team menu (/mob/proc/remove_team_menu)
usr: Madpeter (/mob)
src: Madpeter (/mob)
call stack:
Madpeter (/mob): remove team menu()
Madpeter (/mob): team menu()
the team1 (/obj/team1): Click(Wall (22,140,2) (/turf/cant_see_me_wall))
--end --
and
-- code --
client.screen -= /obj/make0
-- end --
but the obj still sits there plz help
ID:147568
![]() Mar 25 2004, 4:18 pm
|
|
Madpeter wrote:
i want to delete objs that i have added to the screen Use the for() proc. --SSJ4_Gohan_Majin |
I typically try to use loops when ONLY necessary. So, naturally, I rely heavily on using the locate() proc to do my biddings.
var/obj/make0/HUD=locate() in src.client.screen if(HUD) del(HUD) Also, for better organizational purposes, I'd suggest making ALL of your screen objects under a sub-type of /obj/hud/ or something that'll let you find those types easier, and so incase you do want to loop, you won't have to do any extra work trying to single certain types out. |
del(P)
That would loop through the mobs client.screen for the "make0" obj and delete each one it finds.