if(strcmp(cmd,"/infoorg",true)==0)
{
if(PlayerInfo[playerid][pMember] == 0)
return SendClientMessage(playerid, COLOR_RED, "Vocк nгo й membro de uma ORG.");
MinhaOrg(playerid);
return true;
}
MinhaOrg(playerid)
{
new org[128],org2[128],string[2048],Org[32],tmp[32],giveid;
format(org,128,"orgs/%s.ini",OrgsNamesSmall[PlayerInfo[playerid][pMember]]);
Org = OrgsNames[PlayerInfo[playerid][pMember]];
for(new i=0;i<sizeof(OrgsCargos);i++)
{
format(tmp,32,"%s",DOF2_GetString(org,OrgsCargos[i]));
giveid = ReturnUser(tmp);
if(IsPlayerConnected(giveid))
format(org2,128,"{C2A2DA} %d >> %s - %s - {00D900}Online\n", i+1, OrgsCargos[i],DOF2_GetString(org,OrgsCargos[i]));
else if(strcmp(DOF2_GetString(org,OrgsCargos[i]),"Nenhum",true)==0)
format(org2,128,"{C2A2DA} %d >> %s - Nenhum\n", i+1, OrgsCargos[i]);
else
format(org2,128,"{C2A2DA} %d >> %s - %s - {AA3333}Offline\n", i+1, OrgsCargos[i],DOF2_GetString(org,OrgsCargos[i]));
strcat(string, org2);
}
ShowPlayerDialog(playerid, 24, DIALOG_STYLE_MSGBOX, Org, string, "Fechar", "");
return 1;
}
AddMembro(giveid)
{
new org[128];
format(org,128,"orgs/%s.ini",OrgsNamesSmall[PlayerInfo[giveid][pMember]]);
if(!DOF2_FileExists(org))
{
DOF2_CreateFile(org);
for(new i=0;i<sizeof(OrgsCargos);i++)
{
if(i==0 && PlayerInfo[giveid][pLeader] != 0)
DOF2_SetString(org,"Lider",ReturnPlayer(giveid));
else
DOF2_SetString(org,OrgsCargos[i],"Nenhum");
}
DOF2_SaveFile();
}
else
{
new l;
if(PlayerInfo[giveid][pRank] == 6)
l=0;
else if(PlayerInfo[giveid][pRank] < 4)
l=3;
for(new i=l;i<sizeof(OrgsCargos);i++)
if(strcmp(DOF2_GetString(org,OrgsCargos[i]),"Nenhum",true)==0)
{
DOF2_SetString(org,OrgsCargos[i],ReturnPlayer(giveid));
return DOF2_SaveFile();
}
PlayerInfo[giveid][pMember] = 0;
PlayerInfo[giveid][pRank] = 0;
PlayerInfo[giveid][pLeader] = 0;
PlayerInfo[giveid][pModel] = 0;
PlayerInfo[giveid][pJob] = 0;
SetPlayerSkin(giveid, 23);
return SendClientMessage(giveid,COLOR_RED,"[ERRO] Esta organizaзгo jб atingiu o limite de membros.");
}
return 1;
}
DelMembro(giveid)
{
new org[128];
format(org,128,"orgs/%s.ini",OrgsNamesSmall[PlayerInfo[giveid][pMember]]);
for(new i=0;i<sizeof(OrgsCargos);i++)
{
if(strcmp(DOF2_GetString(org,OrgsCargos[i]),ReturnPlayer(giveid),true)==0)
{
DOF2_SetString(org,OrgsCargos[i],"Nenhum");
return DOF2_SaveFile();
}
}
return 1;
}
ReturnPlayer(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
return name;
}
forward Carregamentospawn(playerid);
public Carregamentospawn (playerid)
{
return 1;
}
//isso ajuda?