SA-MP Forums Archive
[Help] Saving Player Weapons (Dini) - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] Saving Player Weapons (Dini) (/showthread.php?tid=164817)



[Help] Saving Player Weapons (Dini) - Maxips2 - 02.08.2010

As the title says, I need some help with saving player weapons into a file (I'm using Dini).
I can only save player's weapon if he equips it, and its just one weapon.


Re: [Help] Saving Player Weapons (Dini) - Retardedwolf - 02.08.2010

https://sampwiki.blast.hk/wiki/GetPlayerWeapon


Re: [Help] Saving Player Weapons (Dini) - Maxips2 - 02.08.2010

Thats not what I need, as I said, I Can save one weapon at least (if the player equips it)
I already know what you just gave me.


Re: [Help] Saving Player Weapons (Dini) - Retardedwolf - 02.08.2010

https://sampwiki.blast.hk/wiki/GetPlayerWeaponData


This then?

Or do you need help in DINI?


Re: [Help] Saving Player Weapons (Dini) - Maxips2 - 02.08.2010

I need help with SAVING them, not getting them


Re: [Help] Saving Player Weapons (Dini) - DiddyBop - 02.08.2010

You have to GET them to SAVE them.

How else will the server know what to save? ...

here is tut man

https://sampforum.blast.hk/showthread.php?tid=1647


Re: [Help] Saving Player Weapons (Dini) - Calgon - 02.08.2010

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new
        playerFile[39],
        weapons[13][2],
        playerName[MAX_PLAYER_NAME];

    GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
    format(playerFile, sizeof(playerFile), "Accounts/%s.ini", playerName);
   
    for (new i = 0; i < 13; i++)
    {
        GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
    }
   
    dini_IntSet(playerFile, "weaponSlot0", weapons[0][0]);
    dini_IntSet(playerFile, "weaponSlot1", weapons[1][0]);
    dini_IntSet(playerFile, "weaponSlot2", weapons[2][0]);
    dini_IntSet(playerFile, "weaponSlot3", weapons[3][0]);
    dini_IntSet(playerFile, "weaponSlot4", weapons[4][0]);
    dini_IntSet(playerFile, "weaponSlot5", weapons[5][0]);
    dini_IntSet(playerFile, "weaponSlot6", weapons[6][0]);
    dini_IntSet(playerFile, "weaponSlot7", weapons[7][0]);
    dini_IntSet(playerFile, "weaponSlot8", weapons[8][0]);
    dini_IntSet(playerFile, "weaponSlot9", weapons[9][0]);
    dini_IntSet(playerFile, "weaponSlot10", weapons[10][0]);
    dini_IntSet(playerFile, "weaponSlot11", weapons[11][0]);
    dini_IntSet(playerFile, "weaponSlot12", weapons[12][0]);
    return 1;
}
Untested.


Re: [Help] Saving Player Weapons (Dini) - Maxips2 - 02.08.2010

Not working :/


Re: [Help] Saving Player Weapons (Dini) - Conroy - 02.08.2010

It would work, just change format(playerFile, sizeof(playerFile), "Accounts/%s.ini", playerName); to your account path.


Re: [Help] Saving Player Weapons (Dini) - Maxips2 - 02.08.2010

I did, but it saves "0" in all values, even if I have some weapon.