Help me with my Saving system and kills & deaths++
#1

Hello Everyone,

Im Using Dini for my TDM. This is my PlayerInfo Function

Код:
enum pInfo
{
	pKey[256],
	pIP[21],
	pAdmin,
	pBanned,
	pDonateRank,
	pWarns,
	pJail,
	pJailTime,
	pReg,
	pCash,
	pKills,
	pDeaths,
	pGun0,
	pGun1,
	pGun2,
	pGun3,
	pGun4,
	pGun5,
	pGun6,
	pGun7,
	pGun8,
	pGun9,
	pGun10,
	pGun11,
	pGun12,
	pModel,
	pMuted,
	pSpree,
	pLotto,
	pHide,
	pMustLogin,
	pHealth,
	pArmour,
	pIPM,
	pUM,
	pRPM,
	pPPM,
	pUPM
};
new PlayerInfo[MAX_PLAYERS][pInfo];
Can you please tell me how to save all these functions when a person disconnect's the server?? Can anyone make
a public function for these Player variables to be saved in the .ini file of the player created in the server.
Reply
#2

So isnt there anyone who is a Nice Person to help me with this?
Reply
#3

Okay I've made all of them, you put these on OnPlayerDisconnect

pawn Код:
dini_IntSet(file, "Password", PlayerInfo[playerid][pKey]);
        dini_IntSet(file, "pIP", GetPlayerIp(playerid, name[], len));
        dini_IntSet(file, "Admin", PlayerInfo[playerid][pAdmin]);
        dini_IntSet(file, "Banned", PlayerInfo[playerid][pBanned]);
        dini_IntSet(file, "Donate", PlayerInfo[playerid][pDonateRank]);
        dini_IntSet(file, "Warnings", PlayerInfo[playerid][pWarns]);
        dini_IntSet(file, "Jail", PlayerInfo[playerid][pJail]);
        dini_IntSet(file, "JailTime", PlayerInfo[playerid][pJailTime]);
        dini_IntSet(file, "Registered", PlayerInfo[playerid][pReg]);
        dini_IntSet(file, "Money", PlayerInfo[playerid][pCash]);
        dini_IntSet(file, "Kills", PlayerInfo[playerid][pKills]);
        dini_IntSet(file, "DeathTimes", PlayerInfo[playerid][pDeaths]);
        dini_IntSet(file, "Gun1", PlayerInfo[playerid][pGun1]);
        dini_IntSet(file, "Gun2", PlayerInfo[playerid][pGun2]);
        dini_IntSet(file, "Gun3", PlayerInfo[playerid][pGun3]);
        dini_IntSet(file, "Gun4", PlayerInfo[playerid][pGun4]);
        dini_IntSet(file, "Gun5", PlayerInfo[playerid][pGun5]);
        dini_IntSet(file, "Gun6", PlayerInfo[playerid][pGun6]);
        dini_IntSet(file, "Gun7", PlayerInfo[playerid][pGun7]);
        dini_IntSet(file, "Gun8", PlayerInfo[playerid][pGun8]);
        dini_IntSet(file, "Gun9", PlayerInfo[playerid][pGun9]);
        dini_IntSet(file, "Gun10", PlayerInfo[playerid][pGun10]);
        dini_IntSet(file, "Gun11", PlayerInfo[playerid][pGun11]);
        dini_IntSet(file, "Gun12", PlayerInfo[playerid][pGun12]);
        dini_IntSet(file, "Model", PlayerInfo[playerid][pModel]);
        dini_IntSet(file, "Mute", PlayerInfo[playerid][pMuted]);
        dini_IntSet(file, "Spree", PlayerInfo[playerid][pSpree]);
        dini_IntSet(file, "Lotto", PlayerInfo[playerid][pLotto]);
        dini_IntSet(file, "Hide", PlayerInfo[playerid][pHide]);
        dini_IntSet(file, "MustLogin", PlayerInfo[playerid][pMustLogin]);
        dini_IntSet(file, "Health", PlayerInfo[playerid][pHealth]);
        dini_IntSet(file, "Armour", PlayerInfo[playerid][pArmour]);
        dini_IntSet(file, "IPM", PlayerInfo[playerid][pIPM]);
        dini_IntSet(file, "UM", PlayerInfo[playerid][pUM]);
        dini_IntSet(file, "RPM", PlayerInfo[playerid][pRPM]);
        dini_IntSet(file, "PPM", PlayerInfo[playerid][pPPM]);
        dini_IntSet(file, "UPM", PlayerInfo[playerid][pUPM]);
And OnPlayerDeath put this:

pawn Код:
PlayerInfo[killerid][pKills]++;
    PlayerInfo[playerid][pDeaths]++;
I hope that this helped And I suggest you to use ******'s INI writer (Y_INI) .
Reply
#4

Allright i will do so!! Thanks alot brother.
******'s INI writer?? Got a link and a tutorial for the Usage?? Please let me know.
Reply
#5

https://sampforum.blast.hk/showthread.php?tid=273088 Searching a bit at tutorials page wouldn't be that hard.
Reply
#6

Yeah right. Thanks for replying!
Reply
#7

You're welcome bro And Dark_Kostas was faster than me in replying ! If you need anything don't hesitate to make threads or pm me!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)