COMMAND:register(playerid, params[]) { new PlayerName[MAX_PLAYER_NAME]; new password[64]; GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME); if(IsLogged[playerid] == 0) { if(sscanf(params, \"s[64]\", password)) SendClientMessage(playerid, COLOR_ULTRARED, \"Használat: /register [jelszó]\"); else { format(file, sizeof(file), \"scriptfiles/regsystem/users/%s.ini\", PlayerName); if(!dini_Exists(file)) { dini_Create(file); dini_IntSet(file, \"Jelszó\", udb_hash(password)); dini_IntSet(file, \"Pénz\", GetPlayerMoney(playerid)); dini_IntSet(file, \"Pont\", GetPlayerScore(playerid)); SendClientMessage(playerid, COLOR_GREEN, \"Sikeresen regisztráltál! /login a belépéshez.\"); } else { SendClientMessage(playerid, COLOR_ULTRARED, \"Ezzel a névvel már regisztráltak!\"); } } } else { SendClientMessage(playerid, COLOR_ULTRARED, \"Te már regisztrálva vagy!\"); } return 1; }
COMMAND:login(playerid, params[]) { new PlayerName[MAX_PLAYER_NAME]; GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME); if(IsLogged[playerid] == 0) { new password[64]; if(sscanf(params, \"s[64]\", password)) SendClientMessage(playerid, COLOR_ULTRARED, \"Használat: /login [jelszó]\"); else { format(file, sizeof(file), \"scriptfiles/regsystem/users/%s.ini\", PlayerName); if(dini_Exists(file)) { if(strval(dini_Get(file, \"Jelszó\")) == udb_hash(password)) { GivePlayerMoney(playerid, dini_Int(file, \"Pénz\")); SetPlayerScore(playerid, dini_Int(file, \"Pont\")); IsLogged[playerid] = 1; SendClientMessage(playerid, COLOR_GREEN, \"Sikeresen bejelentkeztél\"); } else { SendClientMessage(playerid, COLOR_ULTRARED, \"Rossz jelszó!\"); } } else { SendClientMessage(playerid, COLOR_ULTRARED, \"Elõször regisztrálj: /register \"); } } } else { SendClientMessage(playerid, COLOR_ULTRARED, \"Te már bevagy jelentkezve!\"); } return 1; }
COMMAND:register(playerid, params[]){ new PlayerName[MAX_PLAYER_NAME];new password[64]; GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME); format(file, sizeof(file), \"scriptfiles/regsystem/users/%s.ini\", PlayerName); if(IsLogged[playerid] != 0) return SendClientMessage(playerid, COLOR_ULTRARED, \"Te már regisztrálva vagy!\");if(sscanf(params, \"s[64]\", password)) return SendClientMessage(playerid, COLOR_ULTRARED, \"Használat: /register [jelszó]\"); if(dini_Exists(file)) return SendClientMessage(playerid, COLOR_ULTRARED, \"Ezzel a névvel már regisztráltak!\"); dini_Create(file); dini_IntSet(file, \"Jelszó\", udb_hash(password)); dini_IntSet(file, \"Pénz\", GetPlayerMoney(playerid)); dini_IntSet(file, \"Pont\", GetPlayerScore(playerid));SendClientMessage(playerid, COLOR_GREEN, \"Sikeresen regisztráltál! /login a belépéshez.\"); return 1;} COMMAND:login(playerid, params[]){ new PlayerName[MAX_PLAYER_NAME]; new password[64]; GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME); if(IsLogged[playerid] != 0) return SendClientMessage(playerid, COLOR_ULTRARED, \"Te már bevagy jelentkezve!\"); if(sscanf(params, \"s[64]\", password)) return SendClientMessage(playerid, COLOR_ULTRARED, \"Használat: /login [jelszó]\"); if(!dini_Exists(file)) return SendClientMessage(playerid, COLOR_ULTRARED, \"Elõször regisztrálj: /register \");if(strval(dini_Get(file, \"Jelszó\")) == udb_hash(password)) { GivePlayerMoney(playerid, dini_Int(file, \"Pénz\")); SetPlayerScore(playerid, dini_Int(file, \"Pont\")); IsLogged[playerid] = 1; SendClientMessage(playerid, COLOR_GREEN, \"Sikeresen bejelentkeztél\"); } else { SendClientMessage(playerid, COLOR_ULTRARED, \"Rossz jelszó!\"); } return 1;}
format(file, sizeof(file), \"scriptfiles/regsystem/users/%s.ini\", PlayerName);
format(file, sizeof(file), \"regsystem/users/%s.ini\", PlayerName);
format(file, sizeof(file), \"scriptfiles/regsystem/users/%s.ini\", PlayerName); format(file, sizeof(file), \"regsystem/users/%s.ini\", PlayerName); Illetve a mappának léteznie kell (regsystem/users) a scriptfiles mappában!