[Ajuda] Salvamento Dini
#6

pawn Код:
#define WEAPON_FILE  "armas.cfg"

stock SaveWeapons(playerid)
{
    new
    pharrel[128],
    string_[29],
    weapon,
    ammo;
    for(new i=0; i<13; i++)
    {
        GetPlayerWeaponData(playerid, i, weapon, ammo);
        format(string_, 5,"%d%d",weapon,ammo);
        strcat(pharrel, string_);
    }
    GetPlayerName(playerid, string_, 24);
    INI_Open(WEAPONS_FILE);
    INI_WriteString(string_, pharrel);
    INI_Close();
    ResetPlayerWeapons(playerid);
    return 1;
}

stock LoadWeapons(playerid)
{
    new
    string_[29],
    pharrel[128],
    weapon[13],
    ammo[13];
    GetPlayerName(playerid, string_, 24);
    INI_Open(WEAPONS_FILE);
    INI_ReadString(pharrel,string_,128);
    INI_RemoveEntry(string_);
    INI_Close();
    unformat(pharrel, "dddddddddddddddddddddddd",weapon[0],ammo[0],weapon[1],ammo[1],weapon[2],ammo[2],weapon[3],ammo[3],weapon[4],ammo[4],weapon[5],ammo[5],weapon[6],ammo[6],weapon[7],ammo[7],weapon[8],ammo[8],weapon[9],ammo[9],weapon[10],ammo[10],weapon[11],ammo[11],weapon[12],ammo[12]);
    for(new i=0; i<13; i++)
    {
        if(ammo[i] > 0)
        GivePlayerWeapon(playerid, weapon[i], ammo[i]);
    }
    return 1;
}
espero ter lhe ajudado
Reply


Messages In This Thread
[Ajuda] Salvamento Dini - by [NVC]Eduardo - 08.04.2012, 01:17
Re: [Ajuda] Salvamento Dini - by mau.tito - 08.04.2012, 02:21
Re: [Ajuda] Salvamento Dini - by Ricop522 - 08.04.2012, 02:47
Re: [Ajuda] Salvamento Dini - by mau.tito - 08.04.2012, 02:51
Re: [Ajuda] Salvamento Dini - by paulor - 08.04.2012, 11:26
Re: [Ajuda] Salvamento Dini - by [NV]Dr._.THE - 08.04.2012, 12:04
Re: [Ajuda] Salvamento Dini - by paulor - 08.04.2012, 12:44
Re: [Ajuda] Salvamento Dini - by [NV]Dr._.THE - 08.04.2012, 12:50
Re: [Ajuda] Salvamento Dini - by paulor - 08.04.2012, 13:00
Re : Re: [Ajuda] Salvamento Dini - by Djair_Black - 08.04.2012, 15:02

Forum Jump:


Users browsing this thread: 1 Guest(s)