01.09.2018, 21:11
Code:
#include <a_samp> enum FACCAO { PCC, CV, FDN, // Famнlia do Norte GRO, BALL, PM, PF, // Groove, Ballas, PM, e Policia Federal EB, MIL, EST, // Exйrcito, Milнcia Estado e Islвmico FUNDOS, DROGAS, LIDER, NOME_ORG[120] }; new OrgIf[MAX_PLAYERS][FACCAO], ORGS[256]; GetNome(playerid) { new pNome[MAX_PLAYER_NAME]; GetPlayerName(playerid, pNome, 24); return pNome; } GetOrg(playerid) { if (OrgIf[playerid][PM] == 1) { OrgIf[playerid][NOME_ORG] = "Policia Militar"; } if (OrgIf[playerid][PF] == 1) { OrgIf[playerid][NOME_ORG] = "Policia Federal"; } if (OrgIf[playerid][EB] == 1) { OrgIf[playerid][NOME_ORG] = "Exйrcito"; } if (OrgIf[playerid][PCC] == 1) { OrgIf[playerid][NOME_ORG] = "PCC"; } if (OrgIf[playerid][CV] == 1) { OrgIf[playerid][NOME_ORG] = "Comando Vermelho"; } if (OrgIf[playerid][FND] == 1) { OrgIf[playerid][NOME_ORG] = "Famнlia do Norte"; } if (OrgIf[playerid][MIL] == 1) { OrgIf[playerid][NOME_ORG] = "Mбfia Milнcia"; } if (OrgIf[playerid][EST] == 1) { OrgIf[playerid][NOME_ORG] = "Estado Islвmico"; } if (OrgIf[playerid][GROO] == 1) { OrgIf[playerid][NOME_ORG] = "Famнlia Groove"; } if (OrgIf[playerid][BALL] == 1) { OrgIf[playerid][NOME_ORG] = "Famнlia Ballas"; } /* else if(OrgIf[playerid][PF] = 1) = {"Polнcia Federal" }; else if(OrgIf[playerid][EB] = 1) = { "Exйrcito"}; else if(OrgIf[playerid][PCC] = 1) = {"PCC"}; else if(OrgIf[playerid][CV] = 1) = {"Comando Vermelho"}; else if(OrgIf[playerid][FDN] = 1) = {"Famнlia do Norte"}; else if(OrgIf[playerid][MIL] = 1) = {"Milнcia"}; else if(OrgIf[playerid][EST] = 1) = {"Estado Islвmico"}; // Verificar se й lider */ new a = GetOrg(playerid); else if(OrgIf[playerid][a] = 6) { return "Lider %s", GetNome(playerid); OrgIf[playerid][LIDER] = 1; } return 1; } CRIAR_ORG(GetOrg(playerid)) { format(ORGS, sizeof(ORGS), "ORGS/%s.ini", GetOrg(playerid)); if(OrgIf[playerid][LIDER] = 1) { new str[80]; format(str, sizeof(str),"%s" GetNome(playerid)); } DOF2_SetInt(ORGS, "LIDER", str ); DOF2_SetInt(ORGS, "MEMBROS", 1); DOF2_SetInt(ORGS, "FUNDOS", 98); DOF2_SetInt(ORGS, "DROGAS", 500); DOF2_SaveFile(); } // ----------------------------------------------------------------------------- CARREGAR_ORG(GetOrg(playerid)) { format(ORGS, sizeof(ORGS), "ORGS/%s.ini", GetOrg(playerid)); // OrgIf[playerid][pAdmin] = DOF2_GetInt(ORGS, "LIDER"); // OrgIf[playerid][pCivil] = DOF2_GetInt(ORGS, "MEMBROS"); OrgIf[playerid][FUNDOS] = DOF2_GetInt(ORGS, "FUNDOS"); OrgIf[playerid][GRANA] = DOF2_GetInt(ORGS, "DROGAS"); } // ----------------------------------------------------------------------------- SALVAR_ORG(GetOrg(playerid)) { format(Conta, sizeof(Conta), "Contas/%s.ini", GetNome(playerid)); // DOF2_SetInt(ORGS, "LIDER", OrgIf[playerid][pAdmin]); // DOF2_SetInt(ORGS, "MEMBROS", OrgIf[playerid][pSkin]); DOF2_SetInt(ORGS, "FUNDOS", OrgIf[playerid][FUNDOS]); DOF2_SetInt(ORGS, "DROGAS", OrgIf[playerid][DROGAS]); DOF2_SaveFile(); }