PDA

View Full Version : Player can register with no or short password help


mrsamp
03/08/2012, 03:50 PM
This code is supposed to show the dialog again if the player entered too short password but it aint working but no errors or warnings. Help? I guess its simple :s

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case DIALOG_REGISTER:
{
new dialog[128];{
if(inputtext[0] < 5) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,""COL_RED"Password must be longer than 4 characters!", dialog, "Register", "Exit");}
if(response)
{

new
string[179],pFile[35];

format(pFile, 35, Player_File, GetName(playerid));

new
INI:UserFile = INI_Open(pFile);

INI_WriteInt(UserFile, "Password", udb_hash(inputtext));
INI_WriteInt(UserFile, "Admin", 0);
INI_WriteInt(UserFile, "Money", START_MONEY);
INI_WriteInt(UserFile, "Score", 0);
INI_WriteInt(UserFile, "Skin", SKIN_ID);
INI_WriteInt(UserFile, "Warn", 0);
INI_WriteInt(UserFile, "VIP", 0);
INI_WriteInt(UserFile, "B_Time", 0);
INI_WriteInt(UserFile, "B_Till", 0);
INI_Close(UserFile);

SetPVarInt(playerid, "Registered", 1);
SetPVarInt(playerid, "Logged", 1);
SpawnPlayer(playerid);

format(string, 125, ""COL_YELLOW"Name: "COL_WHITE"%s "COL_YELLOW"Password: "COL_WHITE"%s "COL_YELLOW"succesfuly registerd", GetName(playerid), inputtext);
SCM(playerid, 0x46BA29FF, string);
ShowPlayerDialog(playerid,100,DIALOG_STYLE_MSGBOX,"Rules","1.Cheating and hacking - Permban\n2./ask if you want help.\n3Disrespect will end in a ban.\nOnly English in chat.\nDifferent language in chat will end in ban.\n4.Respect All Players!","Agree","Deny");
SpawnPlayer(playerid);
}
else Kick(playerid);
}
/// I didnt post the rest...

Makaveli93
03/08/2012, 03:52 PM
if(strlen(inputtext) < 5) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,""COL_RED"Password must be longer than 4 characters!", dialog, "Register", "Exit");}

mrsamp
03/08/2012, 03:54 PM
No it's still not showing the dialog if he doesn't type any password atall or too short. :s