gun save?
#1

how to make guns save?if someone reconnects the gun will save?thanks
Reply
#2

BUMP!!
Reply
#3

You can use Dini. http://dracoblue.net/download/dini-16/35/

Note: This is an example. You can't just copy and paste!

pawn Код:
public OnPlayerConnect(playerid)
{
    new pName[24], filename[36];
    GetPlayerName(playerid, pName, 24);
    format(filename, sizeof(filename), "%s.ini", pName);
    new weaponid = dini_Int(filename, "Weapon");
    new ammo = dini_Int(filename, "Ammo");
    GivePlayerWeapon(playerid, weaponid, ammo);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new pName[24], filename[36];
    GetPlayerName(playerid, pName, 24);
    format(filename, sizeof(filename), "%s.ini", pName);
    dini_IntSet(filename, "Weapon", GetPlayerWeapon(playerid));
    dini_IntSet(filename, "Ammo", GetPlayerAmmo(playerid));
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)