[AJUDA] Armas proibidas!
#7

Quote:
Originally Posted by .FuneraL.
Посмотреть сообщение
pawn Код:
ResetPlayerWeapons(playerid);
Kick(playerid);
Novamente irei testar '-'

@EDIT

Nгo funcionou, quando pego a arma, a arma some, da o aviso e sou kickado. Mas quando volto eu permaneзo com a arma... Eu queria que ela sai-se do arquivo que fica armazenado a arma do player...

Que no caso й:

pawn Код:
#define WEAPON_FILE  "armas.cfg"
Como salva a arma nesse arquivo?
A resposta \/
pawn Код:
stock SalvarArmas(playerid)
{
    new Arquivo[MAX_PLAYER_NAME+10], nomeplayer[MAX_PLAYER_NAME], IDArma, Municao, stringarmas[128];
    GetPlayerName(playerid, nomeplayer, MAX_PLAYER_NAME);
    format(Arquivo, sizeof(Arquivo), "Armass/%s.txt", nomeplayer);
    if(!DOF2_FileExists(Arquivo)) return DOF2_CreateFile(Arquivo);
    for(new armas = 0; armas < 13; armas++)
    {
        GetPlayerWeaponData(playerid, armas, IDArma, Municao);
        format(stringarmas, sizeof(stringarmas), "Arma %d", armas);
        DOF2_SetInt(Arquivo, stringarmas, IDArma);
        DOF2_SaveFile();
    }
    return 1;
}
Como elas sгo carregadas?
\/
pawn Код:
stock CarregarArma(playerid)
{
    new Arquivo[MAX_PLAYER_NAME+10], nomeplayer[MAX_PLAYER_NAME];
    GetPlayerName(playerid, nomeplayer, MAX_PLAYER_NAME);
    format(Arquivo, sizeof(Arquivo), "Armass/%s.txt", nomeplayer);
    if(!DOF2_FileExists(Arquivo)) return 1;
    for(new armas = 0; armas < 13; armas++)
    {
        new stringarmas[10];
        format(stringarmas, sizeof(stringarmas), "Arma %d", armas);
        new ArmaPlayer = DOF2_GetInt(Arquivo, stringarmas);
        GivePlayerWeapon(playerid, ArmaPlayer, 99999);
    }
    return 1;
}
E fica assim no arquivo:
pawn Код:
Mercurio 0 0 0 0 0 0 0 38 0 0 0 0 0 0 0 0 0 0 0 11 0 0 0 0
Ajuda?
Reply


Messages In This Thread
[AJUDA] Armas proibidas! - by Mercurio - 01.07.2012, 20:24
Re: [AJUDA] Armas proibidas! - by .FuneraL. - 01.07.2012, 20:26
Re: [AJUDA] Armas proibidas! - by Mercurio - 01.07.2012, 20:27
Re: [AJUDA] Armas proibidas! - by .FuneraL. - 01.07.2012, 20:29
Re: [AJUDA] Armas proibidas! - by Mercurio - 01.07.2012, 20:39
Re: [AJUDA] Armas proibidas! - by .FuneraL. - 01.07.2012, 20:40
Re: [AJUDA] Armas proibidas! - by Mercurio - 01.07.2012, 20:41
Re: [AJUDA] Armas proibidas! - by .FuneraL. - 01.07.2012, 20:52
Re: [AJUDA] Armas proibidas! - by Mercurio - 01.07.2012, 20:53
Re: [AJUDA] Armas proibidas! - by Mercurio - 01.07.2012, 21:22

Forum Jump:


Users browsing this thread: 1 Guest(s)