ID:142930
 
Code:
turf/teleport/GhostToHell//the name of our turf
Entered(mob/M)
if(istype(M,/mob))//is it a mob thatentered?
M.loc=locate(/turf/Area/EvilGhost)
M << "You are starting to get ressurected"
sleep(25)
M << "You are transfered to the Safe Zone"
M.death=0
M.icon = 'chars.dmi'
M.icon_state = M.original_icon
M.loc=locate(/turf/Area/Hell)
world << "<font color=blue>[M] is alive again</font>"
M.RolePlaying = 1
M.statuschecker()


ok when a person dies ther icon changes to ghost but when the resserect they loose ther icon i think the problems with the icon state but im pants at coding code someone help please:

Who is M.original_icon.

Curz.
In response to Curzon
its the icon state the char had before dieing
i need when the person revives to have the icon they had before they died which is woth that bit of code is for but dosnt work
In response to Kel87
I think what he's asking is does M.original_icon have something stored in it. So does M.original_icon=='Human' or something like that?
In response to Jholder84
no M.Orginal_icon is supposed to be the icon the player had before they died but doesnt work players have lots of different icons so they need to have there own when the revive and thanks for helping
In response to Kel87
I think his point is whether M.original_icon is actually getting set. Do have have a line like
M.original_icon = M.icon_state
or something similar at the point where you change the mob's icon into a ghost?

Remember also the use of debug messages for printing out variables that aren't working right. Temporarily add a line to your Entered procedure:
world << "GhostToHell/Entered: Restoring icon_state of [M] to '[M.original_icon]'"


Then when it happens, you'll see what mob is being affected and what you're trying to set its icon_state to. That'll tell you if there's a problem with storing M.original_icon.
In response to Hobnob
ok the original icon isnt a set icon most players will have different icons so say i have icon_state = blue i die my icon changes to icon_state = evilghost then when i revive the icon(should) will change back to icon_state = blue


so if another player has icon_state = red then die and revive it should change back to icon_state = red

i can make all players revive with the same icon but i need them to have the icon they had before dieing
In response to Kel87
When you're killing the mob and changing the icon make sure it does this:

KillMob(mob/M)
M.original_icon = M.icon_state //saves their living icon state (no matter what icon they have) to original_icon
M.icon_state = 'Ghost' //changes icon_state to the Ghost form
...
... //whatever's left...
...

ReviveMob(mob/M)
M.icon_state = M.original_icon //returns their icon state to what it was when they died (no matter what icon they have)
M.original_icon = null //Not necessary but it clears that variable
...
... //whatever's left...
...


JUST MAKE SURE THAT YOU ADD original_icon AS A VAR FOR MOBS SO YOU CAN USE IT