[Pedido] Criaзгo e salvamento de dados
#2

Код:
#include <a_samp>
#include <dof2>

enum ORGINFO
{
      pOrg[3],     pLider[3] // numero de orgs
     pMembro,   OrgGrana, OrgDroga
}

new pOrgInfo[MAX_PLAYERS][ORGINFO], Orgs[256];


CriarOrg(playerid)
{
    format(Orgs, sizeof(Orgs), "ORGS/%s.ini", pInfo[playerid][pOrg]);

    DOF2_SetInt(ORGS, "Lider = ninguйm", 0);
    DOF2_SetInt(ORGS, "Membro = ninguйm", 1);
    DOF2_SetInt(ORGS, "Safe droga= nenhum", 98);
    DOF2_SetInt(ORGS, "Safe grana= nenhum", 98);
    DOF2_SetInt(ORGS, "Organizacao", 98);

    DOF2_SaveFile();
}
// -----------------------------------------------------------------------------
LerOrg(playerid)
{
    format(Orgs, sizeof(Orgs), "ORGS/%s.ini", pOrgInfo[playerid][pOrg]);

    pOrgInfo[playerid][pLider] = DOF2_GetInt(ORGS, "Lider");
    pOrgInfo[playerid][pOrg] = DOF2_GetInt(ORGS, "Organizacao");
    pOrgInfo[playerid][pSkin] = DOF2_GetInt(ORGS, "Membro");
    pOrgInfo[playerid][pGrana] = DOF2_GetInt(ORGS, "Safe grana");
    pOrgInfo[playerid][pNivel] = DOF2_GetInt(ORGS, "Safe droga");

*/
}
// -----------------------------------------------------------------------------
SalvarOrg(playerid)
{
    format(Orgs, sizeof(Orgs), "ORGS/%s.ini", pInfo[playerid][pOrg]);


    DOF2_SetInt(Orgs, "Lider", pOrgInfo[playerid][pLider]);
    DOF2_SetInt(Orgs, "Organizacao", pOrgInfo[playerid][pOrg]);
    DOF2_SetInt(Orgs, "Membro", pOrgInfo[playerid][pMembro]);
    DOF2_SetInt(Orgs, "Safe grana", pOrgInfo[playerid][OrgGrana]);
    DOF2_SetInt(Orgs, "Safe droga", pOrgInfo[playerid][OrgDroga]);


    DOF2_SaveFile();
}
// -----------------------------------------------------------------------------
GetNome(playerid)
{
    new pNome[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pNome, 24);
    return pNome;
}
Seria mais ou menos assim pessoal ? Para criar/salvar organizaзхes com ID's ?


Ou teria que fazer desta forma, usando MAX_ORGS?

Код:
#include <a_samp>
#include <dof2>

#define MAX_ORGS 3

enum ORGINFO
{
      pOrg[3],     pLider[3] // numero de orgs
     pMembro,   OrgGrana, OrgDroga
}

new pOrgInfo[MAX_ORGS][ORGINFO], Orgs[256];


CriarOrg(MAX_ORGS)
{
    format(Orgs, sizeof(Orgs), "ORGS/%s.ini", pInfo[playerid][pOrg]);

    DOF2_SetInt(ORGS, "Lider = ninguйm", 0);
    DOF2_SetInt(ORGS, "Membro = ninguйm", 1);
    DOF2_SetInt(ORGS, "Safe droga= nenhum", 98);
    DOF2_SetInt(ORGS, "Safe grana= nenhum", 98);
    DOF2_SetInt(ORGS, "Organizacao", 98);

    DOF2_SaveFile();
}
// -----------------------------------------------------------------------------
LerOrg(MAX_ORGS)
{
    format(Orgs, sizeof(Orgs), "ORGS/%s.ini", pOrgInfo[playerid][pOrg]);

    pOrgInfo[playerid][pLider] = DOF2_GetInt(ORGS, "Lider");
    pOrgInfo[playerid][pOrg] = DOF2_GetInt(ORGS, "Organizacao");
    pOrgInfo[playerid][pSkin] = DOF2_GetInt(ORGS, "Membro");
    pOrgInfo[playerid][pGrana] = DOF2_GetInt(ORGS, "Safe grana");
    pOrgInfo[playerid][pNivel] = DOF2_GetInt(ORGS, "Safe droga");

*/
}
// -----------------------------------------------------------------------------
SalvarOrg(MAX_ORGS)
{
    format(Orgs, sizeof(Orgs), "ORGS/%s.ini", pInfo[playerid][pOrg]);


    DOF2_SetInt(Orgs, "Lider", pOrgInfo[playerid][pLider]);
    DOF2_SetInt(Orgs, "Organizacao", pOrgInfo[playerid][pOrg]);
    DOF2_SetInt(Orgs, "Membro", pOrgInfo[playerid][pMembro]);
    DOF2_SetInt(Orgs, "Safe grana", pOrgInfo[playerid][OrgGrana]);
    DOF2_SetInt(Orgs, "Safe droga", pOrgInfo[playerid][OrgDroga]);


    DOF2_SaveFile();
}
// -----------------------------------------------------------------------------
GetNome(playerid)
{
    new pNome[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pNome, 24);
    return pNome;
}
Reply


Messages In This Thread
Criaзгo e salvamento de dados - by Duun - 01.09.2018, 16:49
Re: Criaзгo e salvamento de dados - by Duun - 01.09.2018, 17:08
Re: Criaзгo e salvamento de dados - by SIZET - 01.09.2018, 17:47
Re: Criaзгo e salvamento de dados - by Duun - 01.09.2018, 17:50
Re: Criaзгo e salvamento de dados - by SIZET - 01.09.2018, 18:25

Forum Jump:


Users browsing this thread: 1 Guest(s)