ID:165353
 
how do i make a verb where a GM can change the owner of a guild house.

    Enter(mob/PC/M)
if(M.in_guild)
if(M.Guild_Name == "??")//this is where the new guild house owner should be
M.loc = locate(154,240,5)
M.density = 1
M.it_blocked = 1
M.it_lock = 1
else
M << "You aren't in the Guild "
else
M << "You must be in a Guild to enter the Guild Hall"

The verb should be able to edit the "??" to a guild in world (World_Guilds). I should also mension this is a turf. If there is any other way to do this then please tell me. Big thanks
Make the "??" into a variable.

in the turf, do this

turf
guildhouseturf
var/owner = "??" //guild tha towns this house


then, simply do
if(M.Guild_Name == src.owner)


then, when you want to change the guild owner with a GM command, do this:

for(var/turf/guildhouseturf/t in world)
if(t.owner == chosenname) //chosen name should be inputed before this
t.owner = newname //new name should be inputed before this as well


2 things about that though, hopefully guilds wont have more than 2 guild houses (Which should probably be so), and the other thing is that's probably not the most efficient way to do the last part, but I'm alittle sloppy for checking for that stuff. If you use that anyway, you might want to do a "Do you want to change the owner of [housenanme]?" so that you can choose if they can have more than 1.
In response to Polantaris
i don't get the last part where u write the 'chosen name should be inputted here and new name should be inputed before this as well. This is not very clear for me.
This is what i have then:
for(var/turf/guildhouseturf/t in world)
var/chosenname = input("Please input the new guild house owner!","Input new Guild House Owner")
if(t.owner == chosenname) //chosen name should be inputed before this
t.owner = newname //new name should be inputed before this as well
I know this isn't correct but i can't figure out what u mean with input chosen name and new name.
In response to Krayzy
*bump*
In response to Krayzy
*BUMP* Wiat what's that meen anyways?
In response to Krayzy
what I mean is what you have:

"inputed before this" means that you should do something like
var/chosenname = input("What guild are you wishing to edit?")

If the guilds that are in the game a list, even better, but probably not so.