27.07.2015, 20:13
(
Последний раз редактировалось Mariciuc223; 28.07.2015 в 04:21.
)
Код:
public OnPlayerDisconnect(playerid, reason) { new INI:File = INI_Open(UserPath(playerid)); INI_SetTag(File,"data"); INI_WriteInt(File, "Password", pInfo[playerid][pPass]); INI_WriteInt(File, "Level", pInfo[playerid][pLevel]); INI_WriteInt(File, "Gender", pInfo[playerid][pSex]); INI_WriteInt(File, "Age", pInfo[playerid][pAge]); INI_WriteInt(File, "FirstSpawn", pInfo[playerid][pFirstSpawn]); INI_WriteInt(File, "SpawnHealth", pInfo[playerid][pSpawnHealth]); INI_WriteInt(File, "Money", pInfo[playerid][pCash]); INI_WriteInt(File, "BankMoney", pInfo[playerid][pBankCash]); INI_WriteInt(File, "PhoneNr", pInfo[playerid][pPhoneNr]); INI_WriteInt(File, "RespectPoints", pInfo[playerid][pRespectPoints]); INI_WriteInt(File, "Warnings", pInfo[playerid][pWarnings]); INI_WriteInt(File, "FactionWarnings", pInfo[playerid][pFactionW]); INI_WriteInt(File, "Lotto", pInfo[playerid][pLotto]); INI_WriteInt(File, "PowerUser", pInfo[playerid][pPowerUser]); INI_WriteInt(File, "UpgradePoints", pInfo[playerid][pUpgradePoints]); INI_WriteInt(File, "WantedLevel", pInfo[playerid][pWanted]); INI_WriteInt(File, "Jail", pInfo[playerid][pJail]); INI_WriteInt(File, "JailTime", pInfo[playerid][pJailTime]); INI_WriteInt(File, "RobPoints", pInfo[playerid][pRobPoints]); INI_WriteInt(File, "Kills", pInfo[playerid][pKills]); INI_WriteInt(File, "Deaths", pInfo[playerid][pDeaths]); INI_WriteInt(File, "Job", pInfo[playerid][pJob]); INI_WriteInt(File, "Drugs", pInfo[playerid][pDrugs]); INI_WriteInt(File, "Materials", pInfo[playerid][pMaterials]); INI_WriteInt(File, "FactionBlackList", pInfo[playerid][pFBlackList]); INI_WriteInt(File, "AdminLevel", pInfo[playerid][pAdmin]); INI_WriteInt(File, "HelperLevel", pInfo[playerid][pHelper]); INI_WriteInt(File, "Leader", pInfo[playerid][pLeader]); INI_WriteInt(File, "Faction", pInfo[playerid][pFaction]); INI_WriteInt(File, "Rank", pInfo[playerid][pRank]); INI_WriteInt(File, "Skin", pInfo[playerid][pSkin]); INI_WriteInt(File, "Tutorial", pInfo[playerid][pTutorial]); INI_SetTag(File, "time"); INI_WriteInt(File, "PowerUser_Year", pInfo[playerid][pPUYear]); INI_WriteInt(File, "PowerUser_Month", pInfo[playerid][pPUMonth]); INI_WriteInt(File, "PowerUser_Day", pInfo[playerid][pPUDay]); INI_WriteInt(File, "PowerUser_Hour", pInfo[playerid][pPUHour]); INI_WriteInt(File, "PowerUser_Minute", pInfo[playerid][pPUMinute]); INI_WriteInt(File, "PowerUser_Second", pInfo[playerid][pPUSecond]); INI_Close(File); KillTimer(SetTimerEx("Spawn", 3, false, "i", playerid)); KillTimer(SetTimerEx("Tutorial", 10000, false, "i", playerid)); KillTimer(SetTimerEx("Freeze", 2000, false, "i", playerid)); KillTimer(SetTimerEx("UnFreeze", 2000, false, "i", playerid)); KillTimer(SetTimerEx("JailTime", 1000, true, "i", playerid)); KillTimer(SetTimerEx("Check", 1000, true, "i", playerid)); TextDrawHideForPlayer(playerid, Time); TextDrawHideForPlayer(playerid, Date); return 1; }
Bonus: How i save [EDIT:load i was drank last nigt :P]
Код:
public LoadUser_data(playerid,name[],value[]) { INI_Int("Password", pInfo[playerid][pPass]); INI_Int("Level", pInfo[playerid][pLevel]); INI_Int("Age", pInfo[playerid][pAge]); INI_Int("FirstSpawn", pInfo[playerid][pFirstSpawn]); INI_Int("Gender", pInfo[playerid][pSex]); INI_Int("SpawnHealth", pInfo[playerid][pSpawnHealth]); INI_Int("Money", pInfo[playerid][pCash]); INI_Int("BankMoney", pInfo[playerid][pBankCash]); INI_Int("PhoneNr", pInfo[playerid][pPhoneNr]); INI_Int("RespectPoints", pInfo[playerid][pRespectPoints]); INI_Int("Warnings", pInfo[playerid][pWarnings]); INI_Int("FactionWarnings", pInfo[playerid][pFactionW]); INI_Int("Lotto", pInfo[playerid][pLotto]); INI_Int("PowerUser", pInfo[playerid][pPowerUser]); INI_Int("UpgradePoints", pInfo[playerid][pUpgradePoints]); INI_Int("WantedLevel", pInfo[playerid][pWanted]); INI_Int("Jail", pInfo[playerid][pJail]); INI_Int("RobPoints", pInfo[playerid][pRobPoints]); INI_Int("Kills", pInfo[playerid][pKills]); INI_Int("Deaths", pInfo[playerid][pDeaths]); INI_Int("Job", pInfo[playerid][pJob]); INI_Int("Drugs", pInfo[playerid][pDrugs]); INI_Int("Materials", pInfo[playerid][pMaterials]); INI_Int("FactionBlackList", pInfo[playerid][pFBlackList]); INI_Int("AdminLevel", pInfo[playerid][pAdmin]); INI_Int("HelperLevel", pInfo[playerid][pHelper]); INI_Int("Leader", pInfo[playerid][pLeader]); INI_Int("Faction", pInfo[playerid][pFaction]); INI_Int("Rank", pInfo[playerid][pRank]); INI_Int("pSkin", pInfo[playerid][pSkin]); INI_Int("Tutorial", pInfo[playerid][pTutorial]); INI_Int("PowerUser_Year", pInfo[playerid][pPUYear]); INI_Int("PowerUser_Month", pInfo[playerid][pPUMonth]); INI_Int("PowerUser_Day", pInfo[playerid][pPUDay]); INI_Int("PowerUser_Hour", pInfo[playerid][pPUHour]); INI_Int("PowerUser_Minute", pInfo[playerid][pPUMinute]); INI_Int("PowerUser_Second", pInfo[playerid][pPUSecond]); return 1; }