01.09.2018, 17:08
Код:
#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; }
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; }