ID:264696
 
Code:
mob
admin
verb
Take_Rank(var/M in SPlayers)
set name = "Take Rank"
set category = "Staff"
set desc = "Take the rank from a character"
if(ctype=="Shinigami")
Captain = 0
Lieutenant = 0
Member = 1
usr.overlays -= 'CaptainSuit.dmi'
usr.overlays -= 'CaptainSuit2.dmi'
usr.overlays -= 'CaptainSuit3.dmi'
usr.overlays -= 'CaptainSuit4.dmi'
SPlayers -= M
usr.rank = "Member "
world << output ("<font color=yellow>[usr.name] has been demoted!</font>", "OOC")


Problem description: That's only a small part of the code to save for time. My problem is that in my "Give Rank" verb, if they are a Shinigami, they get a CaptainS in the usr's loc. How do I delete the Captain suit from their inventory when I use this verb?

var/obj/CaptainS/x = locate() in M
if(x) del(x)
In response to Emasym
It says it cannot remove the mob from list...

runtime error: cannot remove from list
proc name: Take Rank (/mob/admin/verb/Take_Rank)
usr: Kyotoshi Takahashi (/mob)
src: Kyotoshi Takahashi (/mob)
call stack:
Kyotoshi Takahashi (/mob): Take Rank(Kyotoshi Takahashi (/mob))
In response to Ryu-Kazuki
Try the first method.
In response to Emasym
Thanks, I figured out a method to get it working. Onto my next problem, XD
In response to Emasym
Yeah, that second one won't work because type paths are not object instances.
In response to Garthor
Well what'd'ya know. Cheers Garthor (for the umpteenth time)