21.07.2012, 14:27
pawn Код:
INI_Int("Health",pInfo[playerid][pHealth]);//As explained above
INI_Int("PosX",pInfo[playerid][pPosX]);//As explained above
INI_Int("PosY",pInfo[playerid][pPosY]);//As explained above
INI_Int("PosZ",pInfo[playerid][pPosZ]);//As explained above
pawn Код:
INI_Float("Health",pInfo[playerid][pHealth]);//As explained above
INI_Float("PosX",pInfo[playerid][pPosX]);//As explained above
INI_Float("PosY",pInfo[playerid][pPosY]);//As explained above
INI_Float("PosZ",pInfo[playerid][pPosZ]);//As explained above
pawn Код:
INI_Float("Armor",pInfo[playerid][pArmor]);
EDIT:
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
//Same as OnDialogResponse, we will save their stats inside of their user's account
if(fexist(Path(playerid)))//Will check if the file is exit or not inside of User's folder that we have created.
{
new Float:PosX, Float:PosY, Float:PosZ;
GetPlayerPos(playerid, PosX, PosY, PosZ);
new Float:health, Float:armour;
GetPlayerHealth(playerid,health);
GetPlayerArmour(playerid, armour);
new INI:file = INI_Open(Path(playerid)); //will open their file
INI_SetTag(file,"Player's Data");//We will set a tag inside of user's account called "Player's Data"
INI_WriteInt(file,"Admin",pInfo[playerid][pAdmin]); //If you've set his/her admin level, then his/her admin level will be saved inside of his/her account
INI_WriteInt(file,"Donator",pInfo[playerid][pDonator]);//As explained above
INI_WriteInt(file,"Money",pInfo[playerid][pMoney]);//We will save his money inside of his account
INI_WriteInt(file,"Level",pInfo[playerid][pLevel]);//We will save his score inside of his account
INI_WriteInt(file,"Kills",pInfo[playerid][pKills]);//As explained above
INI_WriteInt(file,"Deaths",pInfo[playerid][pDeaths]);//As explained above
INI_WriteInt(file,"Skin",pInfo[playerid][pSkin]);//As explained above
INI_WriteFloat(file,"Health",health);//As explained above
INI_WriteFloat(file,"Armor",armour);//As explained above
INI_WriteFloat(file,"PosX",PosX);
INI_WriteFloat(file,"PosY",PosY);
INI_WriteFloat(file,"PosZ",PosZ);
INI_WriteInt(file,"Faction",pInfo[playerid][pFaction]);//As explained above
INI_WriteInt(file,"Job",pInfo[playerid][pJob]);//As explained above
INI_WriteInt(file,"Banned",pInfo[playerid][pBanned]);//As explained above
new plrIP[16];
GetPlayerIp(playerid, plrIP, sizeof(plrIP));
INI_WriteString(file,"IP",plrIP);//As explained above
INI_Close(file);//Now after we've done saving their data, we now need to close the file
return 1;
}
return 1;
}