Rules Dialog Part 2
#1

Hey guys

i have again a problem with my Dialog Rules the problem is

when i join the rules dialog appear and the register or Login dialog doesn't appear
and 2nd its this:



here's the code for the rules cmd

pawn Код:
CMD:rules(playerid, params[])
{
    new string[1024];

    format(string, 1024, "{FFFF00}1- {FF0000}No hacking/Cheating to get advantage over other players!\n{FF0000}2- {FFFF00}No Bug Abusing, c-bug, g-abuse and all other bugs are not allowed[2shot is allowed, you can also switch the weapons to reload]\n{FFFF00}3- {FF0000}No Blocking, Carjacking, Drive-by etc.. ,");
    format(string, 1024, "%sPlayers wanna have fun and dont wanna be always blocked in ramps, helikilled by someone.\n{FFFF00}4- {FFFF00}No Spawnkill, Players dont wanna be killed everytime they spawn.\n{FFFF00}5- {FF0000}No Advertisement, do NOT send any other server IP!\n{FF0000}6- {FFFF00}NO Racism/Insults,");
    format(string, 1024, "%sEveryone is allowed to play here.Not supporting any intolerance to other races, if so, please grow up.\n{FFFF00}7- {FF0000}Respect Everyone, Treat other players the way that you would want to be treated.\n \n{FFFF00}[NOTE] {00FF29}Players Seen Rule Breaking will be Punished the way it need to be.\n \n{FFFF00}If you see a player");
    format(string, 1024, "%sRuleBreaking Please Use {FF0000}/report, {FFFF00}if the Admins are not Online take some {00FF29}Valid and Solid Proofs {FF0000}and Report him on Forums.\n \n {00FF29} Thank you for Reading our Rules and Enjoy your Gameplay!", string);
    ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX ,"{002FFF}Supreme {1AFF00}Stunt {FF0000}World {FFFF00}Rules",string,"Ok","");
    return 1;
}
and here's the code for the OnPlayerConnect

pawn Код:
public OnPlayerConnect(playerid)
{   // Login Message
    new pName[24];
    new str[128];
    GetPlayerName(playerid, pName, 24);
    format(str, 128, "[SERVER] %s Joined Supreme Stunt World", pName);
    SendClientMessageToAll(0xB8860BAA, str);
    // Auto Repair
    SetTimerEx("AutoRepair",500,true,"d",playerid);
    // Login and Register System
    if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
    }
    // Rules Dialog

    new string[1024];

    format(string, 1024, "{FFFF00}1- {FF0000}No hacking/Cheating to get advantage over other players!\n{FF0000}2- {FFFF00}No Bug Abusing, c-bug, g-abuse and all other bugs are not allowed[2shot is allowed, you can also switch the weapons to reload]\n{FFFF00}3- {FF0000}No Blocking, Carjacking, Drive-by etc.. ,");
    format(string, 1024, "%sPlayers wanna have fun and dont wanna be always blocked in ramps, helikilled by someone.\n{FFFF00}4- {FFFF00}No Spawnkill, Players dont wanna be killed everytime they spawn.\n{FFFF00}5- {FF0000}No Advertisement, do NOT send any other server IP!\n{FF0000}6- {FFFF00}NO Racism/Insults,");
    format(string, 1024, "%sEveryone is allowed to play here.Not supporting any intolerance to other races, if so, please grow up.\n{FFFF00}7- {FF0000}Respect Everyone, Treat other players the way that you would want to be treated.\n \n{FFFF00}[NOTE] {00FF29}Players Seen Rule Breaking will be Punished the way it need to be.\n \n{FFFF00}If you see a player");
    format(string, 1024, "%sRuleBreaking Please Use {FF0000}/report, {FFFF00}if the Admins are not Online take some {00FF29}Valid and Solid Proofs {FF0000}and Report him on Forums.\n \n {00FF29} Thank you for Reading our Rules and Enjoy your Gameplay!", string);
    ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX ,"{002FFF}Supreme {1AFF00}Stunt {FF0000}World {FFFF00}Rules",string,"Ok","");
    return 1;
}
Hope you can help me
Reply
#2

Show me dialogg response?

I think correct way is:
pawn Код:
public OnPlayerConnect(playerid)
{   // Login Message
    new pName[24];
    new str[128];
    GetPlayerName(playerid, pName, 24);
    format(str, 128, "[SERVER] %s Joined Supreme Stunt World", pName);
    SendClientMessageToAll(0xB8860BAA, str);
    // Auto Repair
    SetTimerEx("AutoRepair",500,true,"d",playerid);
    // Login and Register System
    if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
    }
And separate rules dialog to command:
pawn Код:
CMD:rules(playerid, params[])
{
    new string[1024];

    format(string, 1024, "{FFFF00}1- {FF0000}No hacking/Cheating to get advantage over other players!\n{FF0000}2- {FFFF00}No Bug Abusing, c-bug, g-abuse and all other bugs are not allowed[2shot is allowed, you can also switch the weapons to reload]\n{FFFF00}3- {FF0000}No Blocking, Carjacking, Drive-by etc.. ,");
    format(string, 1024, "%sPlayers wanna have fun and dont wanna be always blocked in ramps, helikilled by someone.\n{FFFF00}4- {FFFF00}No Spawnkill, Players dont wanna be killed everytime they spawn.\n{FFFF00}5- {FF0000}No Advertisement, do NOT send any other server IP!\n{FF0000}6- {FFFF00}NO Racism/Insults,");
    format(string, 1024, "%sEveryone is allowed to play here.Not supporting any intolerance to other races, if so, please grow up.\n{FFFF00}7- {FF0000}Respect Everyone, Treat other players the way that you would want to be treated.\n \n{FFFF00}[NOTE] {00FF29}Players Seen Rule Breaking will be Punished the way it need to be.\n \n{FFFF00}If you see a player");
    format(string, 1024, "%sRuleBreaking Please Use {FF0000}/report, {FFFF00}if the Admins are not Online take some {00FF29}Valid and Solid Proofs {FF0000}and Report him on Forums.\n \n {00FF29} Thank you for Reading our Rules and Enjoy your Gameplay!", string);
    ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX ,"{002FFF}Supreme {1AFF00}Stunt {FF0000}World {FFFF00}Rules",string,"Ok","");
    return 1;
}
Your problem was: rules dialog shows when player connect to server.
Reply
#3

The register/login dialog don't show because you force them to watch the rules dialog. Show the rules dialog AFTER they have successfully logged in/registered, and not in the same callback.
Reply
#4

I have no Dialog response and how can i do that Mionee ? :/
Reply
#5

someone ? D: i need help please
Reply
#6

Paste your dialog login response code with players can login and register too
Reply
#7

here's the OnDialogResponse
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch( dialogid )
    {
        case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File,"Money",0);
                INI_WriteInt(File,"Score",0);
                INI_WriteInt(File,"AdminLvl",0);
                INI_WriteInt(File,"Kills",0);
                INI_WriteInt(File,"Deaths",0);
                INI_Close(File);

                ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"Great! You're now Registered on your Community!","Ok","");
            }
        }

        case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                    ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"You have successfully logged in!","Ok","");
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
                }
                return 1;
            }
        }
    }
    return 1;
}
Reply
#8

pawn Код:
CMD:rules(playerid, params[])
{
    new string[1024];

    format(string, 1024, "{FFFF00}1- {FF0000}No hacking/Cheating to get advantage over other players!\n");
    format(string, 1024, "{FF0000}2- {FFFF00}No Bug Abusing, c-bug, g-abuse and all other bugs are not allowed [2shot is allowed, you can also switch the weapons to reload]\n");
    format(string, 1024, "{FFFF00}3- {FF0000}No Blocking, Carjacking, Drive-by etc..\n");");
    format(string, 1024, "
Players wanna have fun and dont wanna be always blocked in ramps, helikilled by someone.\n");
    format(string, 1024, "
{FFFF00}4- {FFFF00}No Spawnkill, Players dont wanna be killed everytime they spawn.\n");
    format(string, 1024, "
{FFFF00}5- {FF0000}No Advertisement, do NOT send any other server IP!\n
    format(string, 1024, "{FF0000}6- {FFFF00}NO Racism/Insults);
    format(string, 1024, "
Everyone is allowed to play here.Not supporting any intolerance to other races, if so, please grow up.\n");
    format(string, 1024, "
{FFFF00}7- {FF0000}Respect Everyone, Treat other players the way that you would want to be treated.\n");
    format(string, 1024, "
{FFFF00}[NOTE] {00FF29}Players Seen Rule Breaking will be Punished the way it need to be.\n \n")
    format(string, 1024, "
{FFFF00}If you see a player RuleBreaking Please Use {FF0000}/report, {FFFF00}if the Admins are not Online take some {00FF29}Valid and Solid Proofs {FF0000}and Report him on Forums.\n \n");
    format(string, 1024, "
{00FF29} Thank you for Reading our Rules and Enjoy your Gameplay!\n\n");
    ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX ,"
{002FFF}Supreme {1AFF00}Stunt {FF0000}World {FFFF00}Rules",string,"Ok","");
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch( dialogid )
    {
        case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "
"COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"
data");
                INI_WriteInt(File,"
Password",udb_hash(inputtext));
                INI_WriteInt(File,"
Money",0);
                INI_WriteInt(File,"
Score",0);
                INI_WriteInt(File,"
AdminLvl",0);
                INI_WriteInt(File,"
Kills",0);
                INI_WriteInt(File,"
Deaths",0);
                INI_Close(File);

                ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,"
"COL_WHITE"Success!",""COL_GREEN"Great! You're now Registered on your Community!","Ok","");
                format(string, 1024, "{FFFF00}1- {FF0000}No hacking/Cheating to get advantage over other players!\n{FF0000}2- {FFFF00}No Bug Abusing, c-bug, g-abuse and all other bugs are not allowed[2shot is allowed, you can also switch the weapons to reload]\n{FFFF00}3- {FF0000}No Blocking, Carjacking, Drive-by etc.. ,");
                format(string, 1024, "%sPlayers wanna have fun and dont wanna be always blocked in ramps, helikilled by someone.\n{FFFF00}4- {FFFF00}No Spawnkill, Players dont wanna be killed everytime they spawn.\n{FFFF00}5- {FF0000}No Advertisement, do NOT send any other server IP!\n{FF0000}6- {FFFF00}NO Racism/Insults,");
                format(string, 1024, "%sEveryone is allowed to play here.Not supporting any intolerance to other races, if so, please grow up.\n{FFFF00}7- {FF0000}Respect Everyone, Treat other players the way that you would want to be treated.\n \n{FFFF00}[NOTE] {00FF29}Players Seen Rule Breaking will be Punished the way it need to be.\n \n{FFFF00}If you see a player");
                format(string, 1024, "%sRuleBreaking Please Use {FF0000}/report, {FFFF00}if the Admins are not Online take some {00FF29}Valid and Solid Proofs {FF0000}and Report him on Forums.\n \n {00FF29} Thank you for Reading our Rules and Enjoy your Gameplay!", string);
                ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX ,"{002FFF}Supreme {1AFF00}Stunt {FF0000}World {FFFF00}Rules",string,"Ok","");

            }
        }

        case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                    ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"You have successfully logged in!","Ok","");
                    format(string, 1024, "{FFFF00}1- {FF0000}No hacking/Cheating to get advantage over other players!\n{FF0000}2- {FFFF00}No Bug Abusing, c-bug, g-abuse and all other bugs are not allowed[2shot is allowed, you can also switch the weapons to reload]\n{FFFF00}3- {FF0000}No Blocking, Carjacking, Drive-by etc.. ,");
                    format(string, 1024, "%sPlayers wanna have fun and dont wanna be always blocked in ramps, helikilled by someone.\n{FFFF00}4- {FFFF00}No Spawnkill, Players dont wanna be killed everytime they spawn.\n{FFFF00}5- {FF0000}No Advertisement, do NOT send any other server IP!\n{FF0000}6- {FFFF00}NO Racism/Insults,");
                    format(string, 1024, "%sEveryone is allowed to play here.Not supporting any intolerance to other races, if so, please grow up.\n{FFFF00}7- {FF0000}Respect Everyone, Treat other players the way that you would want to be treated.\n \n{FFFF00}[NOTE] {00FF29}Players Seen Rule Breaking will be Punished the way it need to be.\n \n{FFFF00}If you see a player");
                    format(string, 1024, "%sRuleBreaking Please Use {FF0000}/report, {FFFF00}if the Admins are not Online take some {00FF29}Valid and Solid Proofs {FF0000}and Report him on Forums.\n \n {00FF29} Thank you for Reading our Rules and Enjoy your Gameplay!", string);
                    ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX ,"{002FFF}Supreme {1AFF00}Stunt {FF0000}World {FFFF00}Rules",string,"Ok","");

                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
                }
                return 1;
            }
        }
    }
    return 1;
}
I think something went wrong with your rules dialog command so I fixed if it now works use your old dialog
Reply
#9

pawn Код:
C:\Users\xxx\Desktop\Samp Script\.pwn , .amx\GM\SupremeTestWorld.pwn(591) : error 001: expected token: ";", but found "-identifier-"
C:\Users\xxx\Desktop\Samp Script\.pwn , .amx\GM\SupremeTestWorld.pwn(688) : error 001: expected token: ";", but found "-identifier-"
C:\Users\xxx\Desktop\Samp Script\.pwn , .amx\GM\SupremeTestWorld.pwn(985) : error 001: expected token: ";", but found "-identifier-"
C:\Users\xxx\Desktop\Samp Script\.pwn , .amx\GM\SupremeTestWorld.pwn(1013) : error 001: expected token: ";", but found "-identifier-"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
here's the lines:

pawn Код:
Line 591 : format(string, 1024, "{FFFF00}If you see a player RuleBreaking Please Use {FF0000}/report, {FFFF00}if the Admins are not Online take some {00FF29}Valid and Solid Proofs {FF0000}and Report him on Forums.\n \n");
Line 688 : format(string, 1024, "{FFFF00}If you see a player RuleBreaking Please Use {FF0000}/report, {FFFF00}if the Admins are not Online take some {00FF29}Valid and Solid Proofs {FF0000}and Report him on Forums.\n \n");
Line 985 : format(string, 1024, "{FFFF00}If you see a player RuleBreaking Please Use {FF0000}/report, {FFFF00}if the Admins are not Online take some {00FF29}Valid and Solid Proofs {FF0000}and Report him on Forums.\n \n");
Line 1013 : format(string, 1024, "{FFFF00}If you see a player RuleBreaking Please Use {FF0000}/report, {FFFF00}if the Admins are not Online take some {00FF29}Valid and Solid Proofs {FF0000}and Report him on Forums.\n \n");
Reply
#10

pawn Код:
format(string, 1024, "{FFFF00}1- {FF0000}No hacking/Cheating to get advantage over other players!\n");
    format(string, 1024, "{FF0000}2- {FFFF00}No Bug Abusing, c-bug, g-abuse and all other bugs are not allowed [2shot is allowed, you can also switch the weapons to reload]\n");
    format(string, 1024, "{FFFF00}3- {FF0000}No Blocking, Carjacking, Drive-by etc..\n");");
    format(string, 1024, "
Players wanna have fun and dont wanna be always blocked in ramps, helikilled by someone.\n");
    format(string, 1024, "
{FFFF00}4- {FFFF00}No Spawnkill, Players dont wanna be killed everytime they spawn.\n");
    format(string, 1024, "
{FFFF00}5- {FF0000}No Advertisement, do NOT send any other server IP!\n
    format(string, 1024, "{FF0000}6- {FFFF00}NO Racism/Insults);
    format(string, 1024, "
Everyone is allowed to play here.Not supporting any intolerance to other races, if so, please grow up.\n");
    format(string, 1024, "
{FFFF00}7- {FF0000}Respect Everyone, Treat other players the way that you would want to be treated.\n");
    format(string, 1024, "
{FFFF00}[NOTE] {00FF29}Players Seen Rule Breaking will be Punished the way it need to be.\n \n")
    format(string, 1024, "
{FFFF00}If you see a player RuleBreaking Please Use {FF0000}/report, {FFFF00}if the Admins are not Online take some {00FF29}Valid and Solid Proofs {FF0000}and Report him on Forums.\n \n");
    format(string, 1024, "
{00FF29} Thank you for Reading our Rules and Enjoy your Gameplay!\n\n");
Replace with these lines
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)