Help with inputtext - 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: Help with inputtext (
/showthread.php?tid=547252)
Help with inputtext -
ilepopivanov - 21.11.2014
I made if player enter true code to show another dialog:
http://prntscr.com/58nwy9
My pKod is 34834 here is image from scriptfiles:
http://prntscr.com/58nxhm
When I enter 34834 ingame, server don't show me another dialog, but if I enter without enter code(only click enter) server show me the dialog
How to fix this? I tried with false code, server again don't show me dialog only if enter without code show me dialog
(Sry For My Bad English
)
Код:
if(dialogid == DIALOG_ZPASS2)
{
new imenaigrac[MAX_PLAYER_NAME];
GetPlayerName(playerid, imenaigrac, sizeof(imenaigrac));
if(response)
{
if(!strcmp(inputtext, PlayerInfo[playerid][pEmail], false))
{
new regstring[1000];
format(regstring, sizeof(regstring), "{FFFFFF}Gospodine %s\n{0563FE}>{FFFFFF}Uspesno go pominavte celiot proces za vrakanje na lozinka.", imenaigrac);
format(regstring, sizeof(regstring), "%s\n\n{0563FE}>{FFFFFF}Vasata lozinka e: %s.",regstring, PlayerInfo[playerid][pPass]);
format(regstring, sizeof(regstring), "%s\n{0563FE}>{FFFFFF}Dokolku imate nekoj problem posetete{FFFF00}www.dw-game.info{FFFFFF}",regstring);
ShowPlayerDialog(playerid,DIALOG_ZPASS3, DIALOG_STYLE_INPUT, "{FF2828}Vrakanje na lozinka{FFFFFF}", regstring, "Premini na login", "");
}
}
}
Re: Help with inputtext -
Larceny - 21.11.2014
Quote:
Originally Posted by ilepopivanov
if I enter without enter code(only click enter) server show me the dialog How to fix this?
|
It's because this function also returns 0 if either string is empty.
https://sampwiki.blast.hk/wiki/Strcmp
Check if the inputtext is empty.
pawn Код:
if(strlen(inputtext) < 1) return SomeError.
Is pKod being loaded?
Re: Help with inputtext -
ilepopivanov - 21.11.2014
Yes..