27.07.2015, 20:19
PHP код:
//in your pInfo:
pClassSelection
//if you are through the class selection:
pInfo[playerid][pClassSelection] = 1;
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_WriteInt(File, "Class", pInfo[playerid][pClassSelection]);
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;
}
//where you set in the class selection
INI_Int("Class",pInfo[playerid][pClassSelection]);
if(pInfo[playerid][pClassSelection] == 1)
{
//Set out of the class selection
}
else
{
//the player never was in the class selection
}