Das Orgs tгo aew
pawn Код:
stock MinhaOrg(playerid)
{
new org[128],org2[128],string[1024],Org[32],tmp[32],giveid;
format(org,128,"/RPG/orgs/%s.ini",OrgsNamesSmall[Player[playerid][pMember]]);
string = " ";
Org = OrgsNames[GetPlayerOrg(playerid)];
for(new i=0;i<sizeof(OrgsCargos);i++)
{
format(tmp,32,"%s",dini_Get(org,OrgsCargos[i]));
giveid = ReturnUser(tmp);
if(IsPlayerConnected(giveid))
format(org2,128,"{C2A2DA}%s - %s - {00D900}Online\n",OrgsCargos[i],dini_Get(org,OrgsCargos[i]));
else if(strcmp(dini_Get(org,OrgsCargos[i]),"Nenhum",true)==0)
format(org2,128,"{C2A2DA}%s - Nenhum\n",OrgsCargos[i]);
else
format(org2,128,"{C2A2DA}%s - %s - {AA3333}Offline\n",OrgsCargos[i],dini_Get(org,OrgsCargos[i]));
if(strlen(string) < 1000)
format(string,2048,"%s %s",string, org2);
}
ShowPlayerDialog(playerid, 24, DIALOG_STYLE_MSGBOX, Org, string, "Fechar", "");
}
stock AddMembro(giveid)
{
new org[128];
format(org,128,"/RPG/orgs/%s.ini",OrgsNamesSmall[Player[giveid][pMember]]);
if(!dini_Exists(org))
{
dini_Create(org);
for(new i=0;i<sizeof(OrgsCargos);i++)
{
if(i==0 && Player[giveid][pLeader] != 0)
dini_Set(org,"Lнder",Player[giveid][pName]);
else
dini_Set(org,OrgsCargos[i],"Nenhum");
}
}
else
{
new l;
if(Player[giveid][pRank] == 6)
l=0;
else if(Player[giveid][pRank] < 4)
l=3;
for(new i=l;i<sizeof(OrgsCargos);i++)
if(strcmp(dini_Get(org,OrgsCargos[i]),"Nenhum",true)==0)
return dini_Set(org,OrgsCargos[i],Player[giveid][pName]);
return SendClientMessage(giveid,COLOR_RED,"[ERRO] Esta organizaзгo jб atingiu o limite de membros.");
}
return 1;
}
stock DelMembro(giveid)
{
new org[128];
format(org,128,"/RPG/orgs/%s.ini",OrgsNamesSmall[Player[giveid][pMember]]);
for(new i=0;i<sizeof(OrgsCargos);i++)
if(strcmp(dini_Get(org,OrgsCargos[i]),Player[giveid][pName],true)==0)
return dini_Set(org,OrgsCargos[i],"Nenhum");
return 1;
}
Agr das casas
pawn Код:
public LoadProperty()
{
new file[32];
for(new h=0; h < MAX_HOUSES;h++)
{
format(file, sizeof(file), "/RPG/Casas/%d.ini", h);
HouseInfo[h][hLevel] = dini_Int(file, "Level");
format(hOwner[h],32,"%s", dini_Get(file, "Dono"));
HouseInfo[h][hDate] = dini_Int(file, "Data");
HouseInfo[h][hEntrancex] = dini_Float(file, "EntradaX");
HouseInfo[h][hEntrancey] = dini_Float(file, "EntradaY");
HouseInfo[h][hEntrancez] = dini_Float(file, "EntradaZ");
HouseInfo[h][hExitx] = dini_Float(file, "SaidaX");
HouseInfo[h][hExity] = dini_Float(file, "SaidaY");
HouseInfo[h][hExitz] = dini_Float(file, "SaidaZ");
format(hDiscription[h],32,"%s", dini_Get(file, "Descricao"));
HouseInfo[h][hValue] = dini_Int(file, "Valor");
HouseInfo[h][hHel] = dini_Int(file, "AttLife");
HouseInfo[h][hArm] = dini_Int(file, "AttColete");
HouseInfo[h][hInt] = dini_Int(file, "Interior");
HouseInfo[h][hLock] = dini_Int(file, "Trancada");
HouseInfo[h][hOwned] = dini_Int(file, "Comprada");
HouseInfo[h][hRent] = dini_Int(file, "Aluguel");
HouseInfo[h][hRentabil] = dini_Int(file, "Alugavel");
HouseInfo[h][hTakings] = dini_Int(file, "Cofre");
HouseInfo[h][hVec] = dini_Int(file, "Carro");
HouseInfo[h][hVcol1] = dini_Int(file, "Cor1");
HouseInfo[h][hVcol2] = dini_Int(file, "Cor2");
HouseInfo[h][hWorld] = dini_Int(file, "VW");
}
}
public SaveProperty(h)
{
new file[32];
format(file, sizeof(file), "/RPG/Casas/%d.ini", h);
if(!dini_Exists(file))
dini_Create(file);
dini_IntSet(file, "Level", HouseInfo[h][hLevel]);
dini_Set(file, "Dono",hOwner[h]);
dini_IntSet(file, "Data", HouseInfo[h][hDate]);
dini_FloatSet(file, "EntradaX", HouseInfo[h][hEntrancex]);
dini_FloatSet(file, "EntradaY", HouseInfo[h][hEntrancey]);
dini_FloatSet(file, "EntradaZ", HouseInfo[h][hEntrancez]);
dini_FloatSet(file, "SaidaX", HouseInfo[h][hExitx]);
dini_FloatSet(file, "SaidaY", HouseInfo[h][hExity]);
dini_FloatSet(file, "SaidaZ", HouseInfo[h][hExitz]);
dini_Set(file, "Descricao",hDiscription[h]);
dini_IntSet(file, "Valor", HouseInfo[h][hValue]);
dini_IntSet(file, "AttLife", HouseInfo[h][hHel]);
dini_IntSet(file, "AttColete", HouseInfo[h][hArm]);
dini_IntSet(file, "Interior", HouseInfo[h][hInt]);
dini_IntSet(file, "Trancada", HouseInfo[h][hLock]);
dini_IntSet(file, "Comprada", HouseInfo[h][hOwned]);
dini_IntSet(file, "Aluguel", HouseInfo[h][hRent]);
dini_IntSet(file, "Alugavel", HouseInfo[h][hRentabil]);
dini_IntSet(file, "Cofre", HouseInfo[h][hTakings]);
dini_IntSet(file, "Carro", HouseInfo[h][hVec]);
dini_IntSet(file, "Cor1", HouseInfo[h][hVcol1]);
dini_IntSet(file, "Cor2", HouseInfo[h][hVcol2]);
dini_IntSet(file, "VW", HouseInfo[h][hWorld]);
}
Agr das Empresas
pawn Код:
dcmd_venderempresa(playerid, params[])
{
#pragma unused params
if(Player[playerid][pPbiskey] == 255)
return SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo comprou uma empresa ainda.");
if(Player[playerid][pMarried] > 0)
return SendClientMessage(playerid, COLOR_RED,"[ERRO] Vocк estб casado, nгo pode vender uma empresa.");
if(Player[playerid][pPbiskey] >= 100 && strcmp(Player[playerid][pName], sbOwner[Player[playerid][pPbiskey]-100], false) == 0)
{
new bouse = Player[playerid][pPbiskey]-100;
new preco = SBizzInfo[bouse][sbBuyPrice];
format(thestring, sizeof(thestring), "%s vendeu a sbiz %d por R$%d",Player[playerid][pName], bouse,preco);
WriteLog("houses", thestring);
GivePlayerGP(playerid,SBizzInfo[bouse][sbTill]);
GivePlayerGP(playerid,preco/2);
SBizzInfo[bouse][sbLocked] = 1;
SBizzInfo[bouse][sbOwned] = 0;
strmid(sbOwner[bouse], "Governo", 0, strlen("Governo"), 255);
strmid(sbExtortion[bouse], "---", 0, strlen("---"), 255);
ConsumingMoney[playerid] = 1;
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(thestring, sizeof(thestring), "~w~Parabens~n~ Empresa vendida por ~n~~g~R$ %d", SBizzInfo[bouse][sbTill]+(preco/2));
GameTextForPlayer(playerid, thestring, 10000, 6);
SBizzInfo[bouse][sbTill] = 0;
SaveSBizz(bouse);
Player[playerid][pPbiskey] = 255;
OnPropUpdate();
OnPlayerSave(playerid);
return 1;
}
else if(strcmp(Player[playerid][pName], bOwner[Player[playerid][pPbiskey]], false) == 0)
{
new bouse = Player[playerid][pPbiskey];
new preco = BizzInfo[bouse][bBuyPrice];
format(thestring, sizeof(thestring), "%s vendeu a biz %d por R$%d",Player[playerid][pName], bouse,preco);
WriteLog("houses", thestring);
BizzInfo[bouse][bLocked] = 1;
BizzInfo[bouse][bOwned] = 0;
strmid(bOwner[bouse], "Governo", 0, strlen("Governo"), 255);
strmid(bExtortion[bouse], "---", 0, strlen("---"), 255);
ConsumingMoney[playerid] = 1;
GivePlayerGP(playerid,BizzInfo[bouse][bTill]);
GivePlayerGP(playerid,preco/2);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(thestring, sizeof(thestring), "~w~Parabens~n~ empresa vendida por ~n~~g~R$ %d", BizzInfo[bouse][bTill]+(preco*0.5));
GameTextForPlayer(playerid, thestring, 10000, 3);
BizzInfo[bouse][bTill] = 0;
SaveBizz(bouse);
Player[playerid][pPbiskey] = 255;
OnPropUpdate();
OnPlayerSave(playerid);
return 1;
}
else
SendClientMessage(playerid, COLOR_RED, "[ERRO] Vocк nгo comprou um Empresa.");
return 1;
}
Das empresas puis sу o comando de venda pois creio eu que o problema seja ai