[Ajuda] Salvamento de armas
#1

to com esse sistema de quando um player esta com armas e sai do server, ele salva as armas, e quando o player volta ele esta com essas armas que salvaram, mais quando morre nгo perde essas armas, ja tentei por ResetPlayerWeapons mais ele nгo reseta..

pawn Код:
stock LoadWeapons(playerid)
{
    new pname[MAX_PLAYER_NAME];
    if(!GetPlayerName(playerid, pname, MAX_PLAYER_NAME)) return false;
    if(!udb_Exists(pname)) udb_Create(pname, "weapons");
    for(new wep[8], amm[6], i; i < 13; i++)
    {
        format(amm, sizeof amm, "Ammo%d", i);
        format(wep, sizeof wep, "Weapon%d", i);
        GiveGunEx(playerid, dUserINT(pname).(wep), dUserINT(pname).(amm));
    }
    return true;
}

stock SaveWeapons(playerid)
{
    new pname[MAX_PLAYER_NAME];
    if(!GetPlayerName(playerid, pname, MAX_PLAYER_NAME)) return false;
    if(!udb_Exists(pname)) udb_Create(pname, "weapons");
    for(new wep[8], amm[6], i, cwep, camm; i < 13; i++)
    {
        format(amm, sizeof amm, "Ammo%d", i);
        format(wep, sizeof wep, "Weapon%d", i);
        GetPlayerWeaponData(playerid, i, cwep, camm);
        dUserSetINT(pname).(amm, camm);
        dUserSetINT(pname).(wep, cwep);
    }
    return true;
}
Reply


Messages In This Thread
Salvamento de armas - by StarPeens - 01.04.2015, 20:12
Re: Salvamento de armas - by Dolby - 01.04.2015, 20:20
Re: Salvamento de armas - by StarPeens - 01.04.2015, 20:23
Re: Salvamento de armas - by Dolby - 01.04.2015, 20:26
Re: Salvamento de armas - by StarPeens - 01.04.2015, 20:29
Re: Salvamento de armas - by arakuta - 01.04.2015, 20:30
Re: Salvamento de armas - by StarPeens - 01.04.2015, 20:33
Re: Salvamento de armas - by Dolby - 01.04.2015, 20:34
Re: Salvamento de armas - by Dolby - 01.04.2015, 20:59
Re: Salvamento de armas - by StarPeens - 01.04.2015, 21:07

Forum Jump:


Users browsing this thread: 2 Guest(s)