10.12.2012, 15:54
Saving problem aint working. I get everything saved besides the score...
Код:
if (dialogid == 101) { new name[MAX_PLAYER_NAME], file[256]; GetPlayerName(playerid, name, sizeof(name)); format(file, sizeof(file), SERVER_USER_FILE, name); if(!response) return Kick(playerid); if (!strlen(inputtext)) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Hi your registered", "Fucken awesome mate, your registered :D. Inpute your pw below", "Login", "Leave"); new tmp; tmp = dini_Int(file, "Password"); if(udb_hash(inputtext) != tmp) { SendClientMessage(playerid, COLOR_RED, "Wrong PW sir."); ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Hi your registered", "Fucken awesome mate, your registered :D. Inpute your pw below", "Login", "Leave"); } else { gPlayerLogged[playerid] = 1; PlayerInfo[playerid][pAdminLevel] = dini_Int(file, "AdminLevel"); SetPlayerScore(playerid, PlayerInfo[playerid][pScore]); GivePlayerMoney(playerid, dini_Int(file, "Money")-GetPlayerMoney(playerid)); SendClientMessage(playerid,COLOR_RED, "[SYSTEM]: Successfully logged in!"); } }
Код:
new name[MAX_PLAYER_NAME], file[256]; GetPlayerName(playerid, name, sizeof(name)); format(file, sizeof(file), SERVER_USER_FILE, name); if (!dini_Exists(file)) { ShowPlayerDialog(playerid, 100, DIALOG_STYLE_INPUT, "Error. No Account found. Register", "Welcome. We didnt find any accounts with this name in our database. Please register", "Register", "Leave"); } if(fexist(file)) { ShowPlayerDialog(playerid, 101, DIALOG_STYLE_INPUT, "We have found your account in the database", "Enter your password bellow.", "Login", "Leave"); }
Код:
new name[MAX_PLAYER_NAME], file[256]; GetPlayerName(playerid, name, sizeof(name)); format(file, sizeof(file), SERVER_USER_FILE, name); if(gPlayerLogged[playerid] == 1) { dini_IntSet(file, "Score", PlayerInfo[playerid][pScore]); dini_IntSet(file, "Money", PlayerInfo[playerid][pCash]); dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel]); dini_IntSet(file, "pExp",PlayerInfo[playerid][pExp]); dini_IntSet(file, "pLevel",PlayerInfo[playerid][pLevel]); dini_IntSet(file, "pAFK",PlayerInfo[playerid][pAFK]); } gPlayerLogged[playerid] = 0;
Код:
enum pInfo { bool:SpawnDance, Float:SpawnAngle, SpawnTimer, pAdminLevel, pCash, pScore, pAFK, pExp, pLevel };