ID:263473
 
i have a weird problem:

Code:
i have a weird problem:
var/list/DM = list("Key1","Key2")
obj
dojostar
icon = 'aa.dmi'
pixel_y = 32

mob/Login()
for(var/mob/M in DM)
src.overlays += new /obj/dojostar

The problem is that the object doesnt appear above the users head. But when i do this with -32 for GM's, then the GM icon appears.
GM code:

obj
GMstar
icon = 'GMstar.dmi'
pixel_y = -32

mob/Login()
if(src.GMlevel <=1)
src.overlays += /obj/GMstar


That snippet of coding is absolutely fine (although I do suggest only calling it once, instead of every login... Because it will add another overlay each time you login, and never take one away)

But as I said, that coding will create the icon above the head.

The problem lies in other coding not shown here, or in the icon.

The code you ripped from was really really buggy in all kinds of obscure places. So I can't help you there...
In response to CuriousNeptune (#1)
i'm sorry but i didn't rip this code. I've coded this myself. Like i said this works for the GM with the -32 but not for the icon above the head. And how could i make it so that i only have to call this only once instead of every login?
In response to CuriousNeptune (#1)
CuriousNeptune wrote:
The code you ripped from was really really buggy in all kinds of obscure places. So I can't help you there...

Where? What ripped code?

You can't really tell of the small snippet.

if i coded
mob/Login()world<<"Welcome [src.key] to naruto"

....
In response to Ultimate Productions (#2)
No, as afar as I know, the snippet isnt ripped.
But the rest of the source is :|
Ive had a glance at the game

The maps are the same as the wots/nbotls rips, and it is all setup the same and yeah... Not 100% conclusive, but im sure it could be if i double checked... :P
EDIT: Double Checked. Yes its a rip

Anyway, here's how to resolve the problem.

mob/var
HasStar

mob/Login()
if(!src.HasStar&&src.GM)
src.overlays += 'GMstar.dmi'
src.HasStar=1

mob/staff/verb
GiveStar()
set category="Staff"
set name ="Give GM Star"
set desc="Used to add the GM Star overlay (only visual)"

var/GMList=list()
for(var/mob/M in world)
if(M.GM)
GMList+=M
var/give=input("Who do you wish to give a GM star to?","Give GM Star") as null|anything in GMList
if(give)
give:overlays+='GMstar.dmi'


Note: I took the liberty of adding a verb with which to restore the GM star to a GM that might have lost his overlays...
If the bit from var/GMlist confuses you, make the verb call mob/M in world... But with current set up (and modifcation on your part, if the variables dont match), the verb will bring up a list of all GMs and not all mobs... :)