[Pedido] Salvamento em callbacks..
#5

Ta ai nigga:
pawn Code:
forward SalvarArmas(playerid);
public SalvarArmas(playerid)
{
    new Arquivo[34], Name[24];
    GetPlayerName(playerid, Name,sizeof(Name));
    format(Arquivo, sizeof(Arquivo), "Armas\%s.ini", Name);
    new Weapons[13][2];
    for(new i = 0; i < 13; i++)
    {
        new Data[10];
        GetPlayerWeaponData(playerid, i, Weapons[i][0], Weapons[i][1]);
        format(Data, sizeof(Data), "Arma %i", i);
        DOF2_SetInt(Arquivo, Data, Weapons[i][0]);
        format(Data, sizeof(Data), "Ammo %i", i);
        DOF2_SetInt(Arquivo, Data, Weapons[i][1]);
    }
}

forward CarregarArmas(playerid);
public CarregarArmas(playerid)
{
    new Arquivo[34], Name[24];
    GetPlayerName(playerid, Name,sizeof(Name));
    format(Arquivo, sizeof(Arquivo), "Armas\%s.ini", Name);
    for(new i = 0; i < 13; i++)
    {
        new Data[10], Weapon, Ammo;
        format(Data, sizeof(Data), "Arma %i", i);
        Weapon = DOF2_GetInt(Arquivo, Data);
        format(Data, sizeof(Data), "Ammo %i", i);
        Ammo = DOF2_GetInt(Arquivo, Data);
       
        GivePlayerWeapon(playerid, Weapon, Ammo);
    }
}
Peguei do meu GameMode antigгo, nгo sei se funciona perfeitamente, mas da pro gasto.
Reply


Messages In This Thread
Salvamento em callbacks.. - by Bieeel_Cwb - 13.07.2012, 22:13
Re: Salvamento em callbacks.. - by Bieeel_Cwb - 13.07.2012, 22:37
Re: Salvamento em callbacks.. - by BreakDriFT - 13.07.2012, 22:38
Re: Salvamento em callbacks.. - by Bieeel_Cwb - 13.07.2012, 22:43
Re: Salvamento em callbacks.. - by CidadeNovaRP - 13.07.2012, 23:32
Re: Salvamento em callbacks.. - by Carlґ - 13.07.2012, 23:53
Re: Salvamento em callbacks.. - by Bieeel_Cwb - 14.07.2012, 00:04
Re: Salvamento em callbacks.. - by F_Cinco - 14.07.2012, 00:28
Re: Salvamento em callbacks.. - by Bieeel_Cwb - 14.07.2012, 00:36
Re: Salvamento em callbacks.. - by Jason` - 14.07.2012, 03:23

Forum Jump:


Users browsing this thread: 1 Guest(s)