ID:145422
 
Code:
mob/Guild/verb
Guilds()
set name = "Guild Commands"
set category="Guild"
switch(input("What would you like to do?")in list("Invite","Cancel"))
if("Invite")
var/list/X=list()
var/gu=src.Guild
for(var/mob/Y in world) if(Y.client) X+=Y
var/mob/NEW=input("Invite Who?","Guild Invites") in X+"Cancel"
if(NEW != "Cancel")
NEW << "<B>You have been invited to join the [src.Guild] Guild. Do you accept?</B>"
src << "<B>You have invited [NEW]! Awaiting reply...</B>"
Reply(NEW, gu, src)
if("Cancel")
return

mob/Guild/proc
Reply(mob/M, atom/guild, mob/R)//R - send back to the person who invited M - person being invited
var/mob/REPLY=alert("Want to join the Guild [guild]?",,"Yes","No")
if(REPLY=="Yes")
M << "<b>Congratulations! You have joined the Guild [guild]!</B>"
R << "<b>Congratulations! [M] has decided to accept your offer!</B>"
M.Guild = R.Guild
return
else if(REPLY=="No")
M << "<b>You did not join the Guild [guild]!</B>"
R << "<b>[M] has decided not to accept your offer.</B>"
return
return

Problem description:

This compiles ok but when i get the runtime error...

runtime error: undefined proc or verb /mob/players/Newen/Reply().

proc name: Guild Commands (/mob/Guild/verb/Guilds)
source file: Guilds.dm,31
usr: Newen (/mob/players/Newen)
src: Newen (/mob/players/Newen)
call stack:
Newen (/mob/players/Newen): Guild Commands()
You have been invited to join the None Guild. Do you accept?
You have invited Newen! Awaiting reply...

and suggestions?



Or is it giving me that because i'm trying to invite myself? though i dont know why that'd matter
its becase you've made that proc a /mob/guild in stead of just a /mob/proc. Take off the guild and you should be fine.
/mob/proc
for(var/mob/Y in world) if(Y.client) X+=Y


To prevent your self from inviting your self to you own guild you should:

for(var/mob/Y in world) if(Y.client&&usr!=Y) X+=Y


It could be the other way around (usr!=Y) or (Y!=usr) not sure.
Putting "Cancel" inside of the input list is bad.
var/t=input(src,"Who would you want to invite?")as null|anything in X
if(!t) return


This will make "Cancel become a button outside of the list.

And for alert() checks:
if(alert(M,"Do you want to join Guild [Guild]?","Yes","No")=="Yes")
...


Anyways, on the the point. The reason this isn't working is because you're abusing 'usr'. alert() defaults to usr, so basically you're just asking yourself to join the guild.
In response to Pyro_dragons
Thanks to Crzylme, Pyro_dragons and Mega fart cannon! :D

Works fine now :D