08.05.2011, 08:57
Having a little trouble with this.
The problem is that when I type a password below 6 characters my register count goes up. But the dialog comes back which is what i want!
Код:
switch(dialogid) { case PLAYER_REGISTER: { if(strlen(inputtext) < 6) { SendClientMessage(playerid, COLOR_RED, "You Must Have More Than 5 Characters In Your Password"); ShowPlayerDialog(playerid, PLAYER_REGISTER, DIALOG_STYLE_INPUT, "Welcome(0.3c)", "Your account is:{FF0000}not registered!\n{F2F2F2}Enter a password to register", "Register", "Leave"); return false; } new name[MAX_PLAYER_NAME], file[256], string[128], ip[16]; GetPlayerName(playerid, name, sizeof(name)); format(file, sizeof(file), SERVER_USER_FILE, name); if(!response) return Kick(playerid); if (!strlen(inputtext)) return ShowPlayerDialog(playerid, PLAYER_REGISTER, DIALOG_STYLE_INPUT, "Welcome(0.3c)", "Your account is:{FF0000}not registered!\n{F2F2F2}Enter a password to register", "Register", "Leave"); dini_Create(file); dini_Set(file, "Name", name); dini_Set(file, "Ip", ip); dini_IntSet(file, "Password", udb_hash(inputtext)); dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][AdminLevel] = 0); dini_IntSet(file, "Money",PlayerInfo[playerid][Cash] = 7500); dini_IntSet(file, "Score",PlayerInfo[playerid][Score] = 0); dini_IntSet(file, "Banned",PlayerInfo[playerid][Banned] = 0); dini_IntSet(file, "Locked",PlayerInfo[playerid][Locked] = 0); dini_IntSet(file, "BankMoney",PlayerInfo[playerid][BankMoney] = 10000); dini_IntSet(file, "Warnings",PlayerInfo[playerid][Warnings] = 0); dini_IntSet(file,"OnlineTime",PlayerInfo[playerid][OnlineTime] = 0); dini_IntSet(file, "Level", 0); dini_IntSet(file, "Muted", 0); dini_IntSet(file, "SwatRights", 0); dini_IntSet(file, "ArmyRights", 0); dini_IntSet(file, "VIP", 0); format(string, 128, "Name: %s - Password: %s, you have been auto logged in. Make sure you keep this password safe!", name, inputtext); bank account for being new to the city"); IsPlayerLogged[playerid] = 1; new string2[128]; format(string2, sizeof(string2), ""COL_LIGHTBLUE"%s[%d] Has Registered!"COL_WHITE" Users Registered = %d",name ,playerid, dini_Int(SERVER_DUMP, "RegisterCount")); SendClientMessageToAll(COLOR_DEADCONNECT, string2); ServerData[E_REG_COUNT] = dini_Int(SERVER_DUMP, "RegisterCount")+1; if(!fexist(SERVER_DUMP)) { dini_Create(SERVER_DUMP); dini_IntSet(SERVER_DUMP, "RegisterCount", ServerData[E_REG_COUNT]); } else { dini_IntSet(SERVER_DUMP, "RegisterCount", ServerData[E_REG_COUNT]); } }