#define green 0x33FF33AA
CMD:register(playerid,params[]){ if (PlayerInfo[playerid][LoggedIn] == 1) return SendClientMessage(playerid,red,\"ACCOUNT: MÁr regisztráltál.\"); if (udb_Exists(PlayerName2(playerid))) return SendClientMessage(playerid,red,\"ACCOUNT: Már regisztráltál, kérlek jelentkezz be \'/login [password]\'.\"); if (strlen(params) == 0) return SendClientMessage(playerid,red,\"ACCOUNT: Correct HASZNÁLAT: \'/register [jelszó]\'\"); if (strlen(params) < 4 || strlen(params) > 20) return SendClientMessage(playerid,red,\"ACCOUNT: A jelszó túl hosszú\"); if (udb_Create(PlayerName2(playerid),params)){ new file[256],name[MAX_PLAYER_NAME], tmp3[100]; new strdate[20], year,month,day; getdate(year, month, day);GetPlayerName(playerid,name,sizeof(name)); format(file,sizeof(file),\"/ladmin/users/%s.sav\",udb_encode(name)); GetPlayerIp(playerid,tmp3,100); dini_Set(file,\"ip\",tmp3);// dini_Set(file,\"password\",params); dUserSetINT(PlayerName2(playerid)).(\"registered\",1); format(strdate, sizeof(strdate), \"%d/%d/%d\",day,month,year);dini_Set(file,\"RegisteredDate\",strdate);dUserSetINT(PlayerName2(playerid)).(\"loggedin\",1);dUserSetINT(PlayerName2(playerid)).(\"banned\",0);dUserSetINT(PlayerName2(playerid)).(\"level\",0); dUserSetINT(PlayerName2(playerid)).(\"LastOn\",0); dUserSetINT(PlayerName2(playerid)).(\"money\",0); dUserSetINT(PlayerName2(playerid)).(\"kills\",0); dUserSetINT(PlayerName2(playerid)).(\"deaths\",0); PlayerInfo[playerid][LoggedIn] = 1; PlayerInfo[playerid][Registered] = 1; SendClientMessage(playerid, green, \"ACCOUNT: Sikeresen regisztráltál!\");PlayerPlaySound(playerid,1057,0.0,0.0,0.0);return 1;} return 1;}CMD:login(playerid,params[]){ if (PlayerInfo[playerid][LoggedIn] == 1) return SendClientMessage(playerid,red,\"ACCOUNT: Már be vagy jelentkezve.\"); if (!udb_Exists(PlayerName2(playerid))) return SendClientMessage(playerid,red,\"ACCOUNT: Még nem vagy ragisztrálva, kérlek tedd meg most \'/register [password]\'.\"); if (strlen(params)==0) return SendClientMessage(playerid,red,\"ACCOUNT: Correct HASZNÁLAT: \'/login [password]\'\"); if (udb_CheckLogin(PlayerName2(playerid),params)){ new file[256], tmp3[100], string[128]; format(file,sizeof(file),\"/ladmin/users/%s.sav\",udb_encode(PlayerName2(playerid)) ); GetPlayerIp(playerid,tmp3,100); dini_Set(file,\"ip\",tmp3);LoginPlayer(playerid);PlayerPlaySound(playerid,1057,0.0,0.0,0.0);if(PlayerInfo[playerid][Level] > 0) { format(string,sizeof(string),\"ACCOUNT: Sikeresen bejelenteztél. (Szint %d)\", PlayerInfo[playerid][Level] ); return SendClientMessage(playerid,green,string); } else return SendClientMessage(playerid,green,\"ACCOUNT: Sikeresen bejelentkeztél!\");}else {PlayerInfo[playerid][FailLogin]++;printf(\"BEJELENTKEZÉS: %s sikertelen bejelentkezés, rossz jelszó (%s) Kisérlet (%d)\", PlayerName2(playerid), params, PlayerInfo[playerid][FailLogin] );if(PlayerInfo[playerid][FailLogin] == MAX_FAIL_LOGINS){ new string[128]; format(string, sizeof(string), \"%s kidobva a szerverrõl (Sikertelen bejelentkezés)\", PlayerName2(playerid) ); SendClientMessageToAll(grey, string); print(string); Kick(playerid);}return SendClientMessage(playerid,red,\"ACCOUNT: Bejelentkezés sikertelen! Hibás jelszó\");}}
if(strlen(dini_Get(\"ladmin/config/aka.txt\", tmp3)) == 0) dini_Set(\"ladmin/config/aka.txt\", tmp3, PlayerName);else{ if( strfind( dini_Get(\"ladmin/config/aka.txt\", tmp3), PlayerName, true) == -1 ){ format(string,sizeof(string),\"%s,%s\", dini_Get(\"ladmin/config/aka.txt\",tmp3), PlayerName); dini_Set(\"ladmin/config/aka.txt\", tmp3, string);}}//-----------------------------------------------------if(!udb_Exists(PlayerName2(playerid))) SendClientMessage(playerid,orange, \"ACCOUNT: Használd: /register [jelszó] a felhasználónév regisztrálására\");else{ PlayerInfo[playerid][Registered] = 1;format(file,sizeof(file),\"/ladmin/users/%s.sav\",udb_encode(PlayerName));new tmp2[256]; tmp2 = dini_Get(file,\"ip\");if( (!strcmp(tmp3,tmp2,true)) && (ServerInfo[AutoLogin] == 1) ){ LoginPlayer(playerid); if(PlayerInfo[playerid][Level] > 0) { format(string,sizeof(string),\"ACCOUNT: Automatikusan bejelentkeztél. (Szint: %d)\", PlayerInfo[playerid][Level] ); SendClientMessage(playerid,green,string); } else SendClientMessage(playerid,green,\"ACCOUNT: Automatikusan bejelentkeztél.\"); } else SendClientMessage(playerid, green, \"ACCOUNT: Ez a felhasználónév már regisztrálva van, használd: /login [jelszó]\");}return 1;}
CMD:register(playerid, params[]){new jelszo, file[128], name[MAX_PLAYER_NAME], string[200];GetPlayerName(playerid, name, sizeof(name));Info[playerid][as] = 0;if(sscanf(params, \"n\", jelszo)) return SendClientMessage(playerid, 0xff0000AA, \"Használat: /register [jelszó]\");format(file,sizeof(file),\"/user/%s.ini\",name);if(strlen(jelszo) > 0){ SendClientMessage(playerid,0x7bff00AA,\"Sikeresen beregisztráltál!\");if(!fexist(file)){ dini_Create(file); dini_IntSet(file,\"Password\", udb_hash(jelszo)); dini_IntSet(file,\"Admin\", 0); dini_IntSet(file,\"Olesek\", 0); dini_IntSet(file,\"Halal\", 0); dini_IntSet(file,\"ban\", 0); dini_IntSet(file,\"warn\", 0); PlayerPlaySound(playerid,1057,0.0,0.0,0.0); GetPlayerName(playerid, name, sizeof(name)); printf(\"{FFFF00}[D-Admin] {FF8C00}%s {FFFF00}Sikeresen Regisztrált!\", name);}else{ SendClientMessage(playerid,0xff0000AA,\"Ez a név már foglalt! Válassz másikat!\");}else{ SendClientMessage(playerid,0xff0000AA,\"A jelszó túl rövid!\");}return 1;}