ID:263278
 
Code:
mob
proc
FullGameCheck()
if(colmustard == 1 && profplum == 1 && mrspeacock == 1 && msscarlet == 1 && mrgreen == 1 && mrswhite == 1)
alert("Sorry, the game is currently full",src,"Observe","Leave")
if("Observe")
usr.loc = locate(15,15,1)
src = new /mob/observer
if("Leave")
src = new /mob/kickme
src.LogMeOut()
else
return

mob/kickme/proc
LogMeOut()
src.Logout()




mob/observer/verb
Spam()
world << "Ahhhh!"


Problem description:

now checking for the game to be full works perfectly fine. however i'm having a problem disconnecting them people who want to disconnect. it disconnects myself as well. i've done about 10 attempts at a workaround but i can't seem to find any that work.

another problem is, the observers aren't getting the Spam() verb. so am i going about this wrong or what?
I think your problem can be summed up in one line of code.
What it seems you are TRYING to do is change a player's mob and for that you need:

src.client.mob = new/mob/observer

That will create a new mob, assign the player to it, and log them out of the other mob. As for people leaving, that code is unneccessary. Just put this:

if("Leave")
del src //Delete player's mob, and thus disconnect the player


If the verbs still don't show, simply add a proc like this:
mob/proc/GetVerbs()
for(var/v in typesof(/mob/observer/verb))
src.verbs += v


Hope that helps!
Purpetr8r the... Oh, I give up. wrote:
If the verbs still don't show, simply add a proc like this:
> mob/proc/GetVerbs()
> for(var/v in typesof(/mob/observer/verb))
> src.verbs += v
>



No need to call for(), simply add them as a list:
verbs += typesof(/mob/observer/verb)
=)
In response to DivineO'peanut
DivineO'peanut wrote:
Purpetr8r the... Oh, I give up. wrote:
If the verbs still don't show, simply add a proc like this:
> > mob/proc/GetVerbs()
> > for(var/v in typesof(/mob/observer/verb))
> > src.verbs += v
> >

No need to call for(), simply add them as a list:
verbs += typesof(/mob/observer/verb)
=)

lol You like my key, I see XDD
Eh... leave it to the experienced programmers to know the shortcuts. I personally just make things work XD
Too bad I'm no-where near advanced =(

Oh,a nd it isn't really a shortcut, you just made a longpaste :D
In response to DivineO'peanut
Just tried to clean it up a bit, delete the comments if you want too, just decided to type it in the code instead of message boards

mob/proc/FullGameCheck()
if(colmustard&&profplum&&mrspeacock&&msscarlet&&mrgreen&&mrswhite)
if(alert(src,"Sorry, the game is currently full","Full Game","Observe","Leave")=="Observe")
src.loc = locate(15,15,1)
//Right here I'm not sure if your trying to change the sources type
//or give him observer verbs.
src.client.mob=new/mob/observer//Changes the mob type... I THINK
//I never really had to change the mob type so I just put what
//Perpetr8r the Perpetu8r said to put =P.

//or you can put this to give him Observer verbs
src.verbs+=typesof(/mob/observer/verb)
else
//src = new /mob/kickme Umm.. Not sure what your trying to do here but I think your just
//trying to log someone out so..
src.Logout()
//or if you want to keep it the same way
src.client.mob=new/mob/kickme
src.LogMeOut()

mob/kickme/proc/LogMeOut()
src.Logout()




mob/observer/verb
Spam()
world << "Ahhhh!"