ID:162869
 
Here is the code

mob/Vaizard
verb
MakeVaizardLeader(mob/M in world)
set category = "Leaders"
if(M.race == "Human")
return
if(M.race == "Shinigami")
return
if(M.race == "Quincy")
return
if(M.race == "Sado")
return
if(M.race == "Espada")
return
if(M.race == "Mod Soul")
return
if(M.race == "Arrancar")
return
if(M.race == "Arrancar")
return
if(M.race == "Hollow")
return
switch(input("Are you sure you want to make them vaizard leader?", text) in list ("Yes","No"))
if("Yes")
M.race="Vaizard"
M.leader="Elites Leader"
M<<"<b>You are now the Vaizard Leader!!"
if(usr.lock)
return
world << "<b><font color = aqua>Upgrade Info: [M] is now the Vaizard Leader!"
flashstep = 1
gotflash = 1

mob/Vaizard
verb
RemoveVaizardLeader(mob/M in world)
set category = "Leaders"
world << "<b><font color = aqua>Upgrade Info: [M] is not the Vaizard Leader anymore!"
M.race = "Vaizard"
M.leader = ""



I want to know how i can make it so without having the person on to remove the leader.

So basically if someone already has leader but isn't online i make another leader and it replaces them, if that's possible please post back and tell me how.
Make the status of Leader not saved with the player, but saved to a world variable that gets saved and loaded when the world is started/closed.

Each time a character is loaded, check the list of Leaders and promote the character when appropriate.

This method will 'rollback' leader status if the world crashes though.
In response to Cheeseburgermafia
Hmmm is there any other way?
In response to ItachiUchihaClan
ItachiUchihaClan wrote:
Hmmm is there any other way?

You could store the leader globally and strip leader status when the player that was previously the leader logs in, but it's still a variable you'll have to save to avoid getting two leaders.

Or you could open up the savefile of the player who was previously leader manually and set the variable to null. But by the looks of things you're going to have to open the savefile of every single player you've got to figure that out, unless, yet again, you use a global variable.

You should really learn how to use datums, and just save those instead.

-- Data