SendFormatMessage and ShowPlayerDialog aren't called. -
Jochemd - 03.03.2012
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
Re: SendFormatMessage and ShowPlayerDialog aren't called. - T0pAz - 03.03.2012
Unknown Paste ID!
Re: SendFormatMessage and ShowPlayerDialog aren't called. -
Jochemd - 03.03.2012
Reposted!
Re: SendFormatMessage and ShowPlayerDialog aren't called. - T0pAz - 03.03.2012
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
Re: SendFormatMessage and ShowPlayerDialog aren't called. -
Jochemd - 03.03.2012
Where the heck is that good for? It works neither, though.
Re: SendFormatMessage and ShowPlayerDialog aren't called. - T0pAz - 03.03.2012
Quote:
Originally Posted by Jochemd
Where the heck is that good for?
|
What? Just replace it. Your SendFormatMessage constant would not work.
Re: SendFormatMessage and ShowPlayerDialog aren't called. -
Jochemd - 03.03.2012
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!
Re: SendFormatMessage and ShowPlayerDialog aren't called. - T0pAz - 03.03.2012
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.
Re: SendFormatMessage and ShowPlayerDialog aren't called. -
Jochemd - 03.03.2012
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.