That looks pretty good. There is at least 1 thing that needs to be corrected in that script and it is the line that actually creates the guild:
Code:
quest::CreateGuild(guild_name, leader);
I think if you change that line to the following, it should correct at least that one issue:
Code:
quest::CreateGuild($GuildName , $GuildLeader);
It looks like the quest command is coded to return a value for that command so you know if the guild was created or not. If that was true, then you would probably want to account for that in the script to make sure one was created before saying that their guild was created. Though, it looks like in quest_mgr.cpp the actual function is set to void, so it won't return anything, unless I am missing something.