06.11.2010, 12:09
So I have my registration/login system but it doesn't working normally how it should have...So whith register system everything is ok, when i register, creates my file in users folder, but something bad with login system, because there's no difference what password i will type it will always log me in...So that my login code:
Код:
dcmd_login(playerid, params[]) { new file[256]; new name[MAX_PLAYER_NAME]; new string[128]; GetPlayerName(playerid, name, sizeof(name)); format(file, sizeof(file), "\\Users\\%s.ini", name); if(!dini_Exists(file)) return SendClientMessage(playerid, 0xFFFFFFFF, "You aren't registered, to do so type /register [password] command!"); if(!strlen(params)) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE:/register [password]"); if(logged[playerid] == 1) return SendClientMessage(playerid, 0xFFFFFFFF, "You are already logged in!"); new variable[256]; variable = dini_Get(file,"password"); if(!strcmp(params, variable)) { format(string, sizeof(string), "%s, you typed your pasword incorrectly", name); SendClientMessage(playerid, 0xFFFFFFFF, string); return 1; } if(strcmp(params, variable)) { logged[playerid] = 1; SendClientMessage(playerid, 0xFFFFFFFF, "You successfully logged in!"); return 1; } return 0; }