SA-MP Forums Archive
Simple Question - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Simple Question (/showthread.php?tid=371010)



Simple Question - _Khaled_ - 22.08.2012

I have two dialogs, Rules and login/register
When I
pawn Код:
/*The login/register*/
the Rules box appears..
But when I appear them the rules don't appear

I want the rules appear, and when they accept, the other box appears.
pawn Код:
public OnPlayerConnect(playerid)
{
    {
        new pname[MAX_PLAYER_NAME], string[63 + MAX_PLAYER_NAME];
        SendClientMessage(playerid,COLOR_GREEN,"Welcome to **********");
        SendClientMessage(playerid,COLOR_GREEN,"Make sure you read and Abide by our /rules, and obey our admins.");
        new C_Rules;
        new BigString[1900];
        strcat(BigString, "\n{FFFFFF}1. {F81414}Respect and obey all Admins.", 1900 );
        strcat(BigString, "\n{FFFFFF}2. {F81414}Do not Deathmatch or Teamkill.", 1900 );
        strcat(BigString, "\n{FFFFFF}3. {F81414}Do not Spam.", 1900 );
        strcat(BigString, "\n{FFFFFF}4. {F81414}Do not use cheats or hacks.", 1900 );
        strcat(BigString, "\n{FFFFFF}5. {F81414}Respect all other players.", 1900 );
        strcat(BigString, "\n{FFFFFF}6. {F81414}******.", 1900 );
        strcat(BigString, "\n{FFFFFF}7. {F81414}Never quit to avoid anything.", 1900 );
        strcat(BigString, "\n{FFFFFF}8. {F81414}********other players.", 1900 );
        strcat(BigString, "\n{FFFFFF}9. {F81414}****.", 1900 );
        strcat(BigString, "\n{FFFFFF}10. {F81414}No mods are allowed.", 1900 );
        ShowPlayerDialog(playerid,C_Rules, DIALOG_STYLE_MSGBOX, "{ff0000}Rules", BigString, "Accept","Ignore");
        if(fexist(UserPath(playerid)))
        {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"{F81414}San Andreas *****.","{FFFFFF}Welcome, Type your password below to login.\nIf it's not you, relog with a different username","Login","Quit");
        }
        else
        {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"{F81414}San Andreas ********** ","{FFFFFF}Welcome, Type your password below to register a new account.","Register","Quit");
        }
        GetPlayerName(playerid, pname, sizeof(pname));
        format(string, sizeof(string), "%s has Joined the server.", pname);
        SendClientMessageToAll(COLOR_CYAN, string);
        return 1;
     }
}
Note: No Compiling error or warning.


Re: Simple Question - Akira297 - 22.08.2012

It's setup so you only see the rules once.


Re: Simple Question - _Khaled_ - 22.08.2012

Now I just used another nickname, and the rules box didn't appear, register one did


Re: Simple Question - _Khaled_ - 22.08.2012

It appears for a second then BOOM register pwns it.


Re: Simple Question - Akira297 - 22.08.2012

I'm super tired, why don't you make the Rules appear on,

OnPlayerSpawn?


Re: Simple Question - _Khaled_ - 22.08.2012

It's stupid to kick someone after they actually spawn, + I'm willing to make another helping textdraw after every class spawn.


Re: Simple Question - Devilxz97 - 22.08.2012

pawn Код:
strcat(BigString, "\n{FFFFFF}1. {F81414}Respect and obey all Admins.", 1900 );
pawn Код:
strcat(BigString, "\n{FFFFFF}1. {F81414}Respect and obey all Admins.", sizeof(BigString));
:\


Re: Simple Question - Akira297 - 22.08.2012

Why don't you have it after they entered there login information? So, it's directly before the "OnPlayerSpawn"


Re: Simple Question - Kirollos - 22.08.2012

you cant show 2 dialogs in the same momment.

so

you have to do when the player agrees to read the rules.

the login/register box appears.

like that:

pawn Код:
#define C_Rules randomid
#define DIALOG_LOGIN randomid
#define DIALOG_REGISTER randomid

public OnPlayerConnect(playerid)
{
    new BigString[1900];
        strcat(BigString, "\n{FFFFFF}1. {F81414}Respect and obey all Admins.", 1900 );
        strcat(BigString, "\n{FFFFFF}2. {F81414}Do not Deathmatch or Teamkill.", 1900 );
        strcat(BigString, "\n{FFFFFF}3. {F81414}Do not Spam.", 1900 );
        strcat(BigString, "\n{FFFFFF}4. {F81414}Do not use cheats or hacks.", 1900 );
        strcat(BigString, "\n{FFFFFF}5. {F81414}Respect all other players.", 1900 );
        strcat(BigString, "\n{FFFFFF}6. {F81414}******.", 1900 );
        strcat(BigString, "\n{FFFFFF}7. {F81414}Never quit to avoid anything.", 1900 );
        strcat(BigString, "\n{FFFFFF}8. {F81414}********other players.", 1900 );
        strcat(BigString, "\n{FFFFFF}9. {F81414}****.", 1900 );
        strcat(BigString, "\n{FFFFFF}10. {F81414}No mods are allowed.", 1900 );
    ShowPlayerDialog(playerid,C_Rules, DIALOG_STYLE_MSGBOX, "{ff0000}Rules", BigString, "Accept","Ignore");
    //some of your stuffs
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == C_Rules)
    {
        if(response)
        {
            if(fexist(UserPath(playerid)))
            {
            INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
            ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"{F81414}San Andreas *****.","{FFFFFF}Welcome, Type your password below to login.\nIf it's not you, relog with a different username","Login","Quit");
            return 1;
            }
            else
            {
                ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"{F81414}San Andreas ********** ","{FFFFFF}Welcome, Type your password below to register a new account.","Register","Quit");
                return 1;
            }
        }
    }
   
    //some of your stuffs
}



Re: Simple Question - Lordzy - 22.08.2012

Keep your login/register box under OnPlayerSpawn to show login/register box,when player gets spawned.

Or keep your login/register dialog boxes OnDialogResponse.

Response of Accept rules button of the rules box.