SA-MP Forums Archive
[HELP] Score & other stuff doesn't save - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP] Score & other stuff doesn't save (/showthread.php?tid=317760)



[HELP] Score & other stuff doesn't save - ServerScripter - 12.02.2012

the problem is whene i disconnect the score+weapons+weapons' s ammo+kill+death doesn't save ...

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new string[128];
    format(string,sizeof(string),"%d Minutes",TimE[playerid]);
    new Float:Health,Float:Armour; GetPlayerHealth(playerid,Health); GetPlayerArmour(playerid,Armour);
    KillTimer(timeupdate);
    if(pInfo[playerid][Registered] == 1 && pInfo[playerid][LoggedIn] == 1)
    {
    new file[100],Name[MAX_PLAYER_NAME]; GetPlayerName(playerid,Name,MAX_PLAYER_NAME);
    format(file,sizeof(file),PlayerFile,Name);
    new pName[24]; GetPlayerName(playerid,pName,24); new IP[16]; GetPlayerIp(playerid,IP,16);
    dini_Set(file, "Name", pName);
    dini_Set(file, "Ip Adress", IP);
    dini_IntSet(file,"Money",GetPlayerMoney(playerid));
    dini_IntSet(file,"Score",GetPlayerScore(playerid));
    dini_IntSet(file,"Kills",pInfo[playerid][Kills]);
    dini_IntSet(file,"VipLevel",pInfo[playerid][VipLevel]);
    dini_IntSet(file,"Deaths",pInfo[playerid][Deaths]);
    dini_IntSet(file,"Skin",GetPlayerSkin(playerid));
    dini_IntSet(file,"Wanted Level",GetPlayerWantedLevel(playerid));
    dini_Set(file,"Time On Server",string);
    GetPlayerWeaponData(playerid,0,pInfo[playerid][Wep1],pInfo[playerid][Ammo1]);
    GetPlayerWeaponData(playerid,1,pInfo[playerid][Wep2],pInfo[playerid][Ammo2]);
    GetPlayerWeaponData(playerid,2,pInfo[playerid][Wep3],pInfo[playerid][Ammo3]);
    GetPlayerWeaponData(playerid,3,pInfo[playerid][Wep4],pInfo[playerid][Ammo4]);
    GetPlayerWeaponData(playerid,4,pInfo[playerid][Wep5],pInfo[playerid][Ammo5]);
    GetPlayerWeaponData(playerid,5,pInfo[playerid][Wep6],pInfo[playerid][Ammo6]);
    GetPlayerWeaponData(playerid,6,pInfo[playerid][Wep7],pInfo[playerid][Ammo7]);
    GetPlayerWeaponData(playerid,7,pInfo[playerid][Wep8],pInfo[playerid][Ammo8]);
    dini_IntSet(file,"Weapon 1",pInfo[playerid][Wep1]);
    dini_IntSet(file,"Ammo 1",pInfo[playerid][Ammo1]);
    dini_IntSet(file,"Weapon 2",pInfo[playerid][Wep2]);
    dini_IntSet(file,"Ammo 2",pInfo[playerid][Ammo2]);
    dini_IntSet(file,"Weapon 3",pInfo[playerid][Wep3]);
    dini_IntSet(file,"Ammo 3",pInfo[playerid][Ammo3]);
    dini_IntSet(file,"Weapon 4",pInfo[playerid][Wep4]);
    dini_IntSet(file,"Ammo 4",pInfo[playerid][Ammo4]);
    dini_IntSet(file,"Weapon 5",pInfo[playerid][Wep5]);
    dini_IntSet(file,"Ammo 5",pInfo[playerid][Ammo5]);
    dini_IntSet(file,"Weapon 6",pInfo[playerid][Wep6]);
    dini_IntSet(file,"Ammo 6",pInfo[playerid][Ammo6]);
    dini_IntSet(file,"Weapon 7",pInfo[playerid][Wep7]);
    dini_IntSet(file,"Ammo 7",pInfo[playerid][Ammo7]);
    dini_IntSet(file,"Weapon 8",pInfo[playerid][Wep8]);
    dini_IntSet(file,"Ammo 8",pInfo[playerid][Ammo8]);
    }
    return 1;
}