SendFormatMessage and ShowPlayerDialog aren't called.
#1

Hello,

This is a strange problem. The entire code here works fine, except the last SendFormatMessage and ShowPlayerDialog. They aren't called at all. It's like the compiler skips them, because when I add debug lines till the end of the code, it prints till the end of the code.

pawn Код:
case DIALOG_REGISTER:
        {
            if(response)
            {
                if(!isnull(inputtext))
                {
                    new string[129],IP_Address[16];
                    WP_Hash(string,sizeof(string),inputtext);
                    GetPlayerIp(playerid,IP_Address,sizeof(IP_Address));
                    SetPVarString(playerid,"IP",IP_Address);
                    SetPVarString(playerid,"Password",string);
                    mysql_format(1,string,"INSERT INTO `PlayerInfo` (`PlayerName`, `Password`, `RegisteredIP`) VALUES ('%s', '%s', '%s')",PlayerName(playerid),string,IP_Address);
                    //mysql_query(string);
                    SetPVarInt(playerid,"IsRegistering",1);
                    SendFormatMessage(playerid,COLOR_GREEN,"» EG:RP{FFFFFF}: Account '%s' has successfully been registered.",PlayerName(playerid));
                    ShowPlayerDialog(playerid,DIALOG_REGISTER2,DIALOG_STYLE_INPUT,""#EMBED_GREEN"Expression Gaming Roleplay - "#EMBED_WHITE"Register",""#EMBED_WHITE"Could you please tell me if you are a "#EMBED_BLUE"male"#EMBED_WHITE" or a "#EMBED_PINK"female"#EMBED_WHITE"?","Continue");
                    return 1;
                }
                else return ShowRegisterDialog(playerid);
            }
            else return Kick(playerid);
        }
So the last SendFormatMessage and ShowPlayerDialog aren't working.

For your information, the defines:

http://pastebin.com/xYCFU7JR

I hope to hear your answer!

- Jochem
Reply
#2

Unknown Paste ID!
Reply
#3

Reposted!
Reply
#4

Replace SendFormatMessage with this.
pawn Код:
#define SendFormatMessage(%0,%1,%2,%3)                  \
    do                                              \
    {                                               \
        format(str_f, sizeof (str_f), (%2), %3);    \
        SendClientMessage((%0), (%1), str_f);       \
    }                                               \
    while (FALSE)
And put this before it
pawn Код:
#if !defined FALSE // by ******
    stock bool:FALSE = false;
#endif
Reply
#5

Where the heck is that good for? It works neither, though.
Reply
#6

Quote:
Originally Posted by Jochemd
Посмотреть сообщение
Where the heck is that good for?
What? Just replace it. Your SendFormatMessage constant would not work.
Reply
#7

Quote:
Originally Posted by T0pAz
Посмотреть сообщение
What? Just replace it. Your SendFormatMessage constant would not work.
It has worked in my previous gamemodes, that's why it's weird! But ****** one doesn't work either.

Edit: I've fixed it. The problem was in mysql_format! Do you see I store the output in string, while password is also in string? That caused the problem.

Thanks for your help, T0paz!
Reply
#8

Quote:
Originally Posted by Jochemd
Посмотреть сообщение
It has worked in my previous gamemodes, that's why it's weird! But ****** one doesn't work either.

Edit: I've fixed it. The problem was in mysql_format! Do you see I store the output in string, while password is also in string? That caused the problem.

Thanks for your help, T0paz!
Just what I suspected but you were fast to spot it.
Reply
#9

Quote:
Originally Posted by T0pAz
Посмотреть сообщение
Just what I suspected but you were fast to spot it.
Meh, fast is different, I was camping with this for two hours.

But thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)