Jump to content
  • 0

Check Guild If Already Exist


Question

Posted (edited)

I'm implementing a guild maker on my server........

i would like to know how to check if the one i've input already exist in the database?

 

 
prontera,150,150,1    script    Guild Creator    50,{
 
mes "[Guild Creator]";
mes "Hi. Want a guild?";
switch(select("No!:Yes!")) {
case 1:
    next;
    mes "[Guild Creator]";
    mes "Very well.";
    close;
case 2:
    if(getcharid(2) == 1) { // Check for belonging to a guild
        next;
        mes "[Guild Creator]";
        mes "You are already in a guild!";
        mes "Please leave your current guild before trying to create a new one.";
        close;
    }
    goto L_guildname;
 
L_guildname:
    next;
    mes "[Guild Creator]";
    mes "What would you like the name to be?";
    input .@gname$;
    next;
    mes "[Guild Creator]";
    mes "Is this right?";
    mes "''"+.@gname$+"''";
    switch(select("No, I'd like to retry.:Perfect!")) {
    case 1:
        mes "[Guild Creator]";
        mes "Sorry!";
        goto L_guildname;
    case 2:
        atcommand "@guild "+.@gname$;
        mes "[Guild Creator]";
        mes "Enjoy!";
        close;
        }
    }
}
Edited by caspa

3 answers to this question

Recommended Posts

Posted
atcommand "@guild "+.@gname$;

if the name is already used, the serveur send a message to the player which used @guild

You are already in a Guild.

just to point it out

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...