08.09.2012, 06:34
To tendo problemas com o comando a seguir, ja o refiz duas vezes e nгo sanei o erro, antes ele nгo mostrava o valor ganho(venda) na venda dos produtos para as empresas ai usei de por new vendas = bPrinceProd*bProducts;
sу que ai dava o valor ganho mais me dava um valor fora do padrгo sem nexo, eu nгo entendo bem sobre essas empresa do GF, outra coisa eu to usando o VProd[6]; ai no codigo para definir os carros que podem ser usados para vender os produtos mais mesmo assim nгo ta dando certo posso comprar os produtos e vender sem esta nos veiculos!!
sу que ai dava o valor ganho mais me dava um valor fora do padrгo sem nexo, eu nгo entendo bem sobre essas empresa do GF, outra coisa eu to usando o VProd[6]; ai no codigo para definir os carros que podem ser usados para vender os produtos mais mesmo assim nгo ta dando certo posso comprar os produtos e vender sem esta nos veiculos!!
Код:
if(strcmp(cmd, "/venderprod", true) == 0 || strcmp(cmd, "/venderproduto", true) == 0 || strcmp(cmd, "/venderprods", true) == 0)
{
new venda;
new tmpcar;
new CProds = VProd[6];
if(IsPlayerConnected(playerid))
{
tmpcar = GetPlayerVehicleID(playerid);
if(!IsAProdCar(tmpcar))
{
GameTextForPlayer(playerid, "~r~Voce nao esta em um caminhao de entregas", 5000, 1);
return 1;
}
if(PlayerHaul[tmpcar][pLoad] == 0)
{
GameTextForPlayer(playerid, "~r~Caminhao vazio, retorne a empresa e pegue mais.", 5000, 1);
format(string, sizeof(string), "Produtos: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[CProds][pCapasity]);
SendClientMessage(playerid, COR_Grooves, string);
return 1;
}
for(new i = 0; i < sizeof(BizzInfo); i++)
{
if (PlayerToPoint(10, playerid,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]))
{
for(new l = PlayerHaul[tmpcar][pLoad]; l > 0; l--)
{
if(BizzInfo[i][bProducts] == BizzInfo[i][bMaxProducts])
{
GameTextForPlayer(playerid, "~r~Nossos estoques estao cheios", 5000, 1);
format(string, sizeof(string), "Dinheiro ganho $%d.", venda);
SendClientMessage(playerid, COR_Grooves, string);
format(string, sizeof(string), "Produtos: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[CProds][pCapasity]);
SendClientMessage(playerid, COR_Grooves, string);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
return 1;
}
if(BizzInfo[i][bPriceProd] > BizzInfo[i][bTill])
{
GameTextForPlayer(playerid, "~r~Sem fundos", 5000, 1);
format(string, sizeof(string), "Dinheiro ganho $%d.", venda);
SendClientMessage(playerid, COR_Grooves, string);
format(string, sizeof(string), "Produtos: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[CProds][pCapasity]);
SendClientMessage(playerid, COR_Grooves, string);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
return 1;
}
PlayerHaul[tmpcar][pLoad]--;
BizzInfo[i][bProducts]++;
venda = venda+BizzInfo[i][bPriceProd];
ConsumingMoney[playerid] = 1;
GivePlayerMoneyEx(playerid,BizzInfo[i][bPriceProd]);
BizzInfo[i][bTill] -= BizzInfo[i][bPriceProd];
if(PlayerHaul[tmpcar][pLoad] == 0)
{
GameTextForPlayer(playerid, "~r~Caminhao vazio, retorne a empresa e pegue mais.", 5000, 1);
format(string, sizeof(string), "Dinheiro ganho $%d.", venda);
SendClientMessage(playerid, COR_Grooves, string);
format(string, sizeof(string), "Produtos: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[CProds][pCapasity]);
SendClientMessage(playerid, COR_Grooves, string);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
return 1;
}
}
OnPropUpdate();
return 1;
}
}
}
for(new i = 0; i < sizeof(SBizzInfo); i++)
{
if (PlayerToPoint(10, playerid,SBizzInfo[i][sbEntranceX], SBizzInfo[i][sbEntranceY], SBizzInfo[i][sbEntranceZ]))
{
//printf("Found House :%d",i);
for(new l = PlayerHaul[tmpcar][pLoad]; l > 0; l--)
{
if(SBizzInfo[i][sbProducts] == SBizzInfo[i][sbMaxProducts])
{
GameTextForPlayer(playerid, "~r~Nossos estoques estao cheios", 5000, 1);
format(string, sizeof(string), "Dinheiro ganho $%d.", venda);
SendClientMessage(playerid, COR_Grooves, string);
format(string, sizeof(string), "Produtos: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[CProds][pCapasity]);
SendClientMessage(playerid, COR_Grooves, string);
return 1;
}
if(SBizzInfo[i][sbPriceProd] > SBizzInfo[i][sbTill])
{
GameTextForPlayer(playerid, "~r~Sem fundos", 5000, 1);
format(string, sizeof(string), "Dinheiro ganho $%d.", venda);
SendClientMessage(playerid, COR_Grooves, string);
format(string, sizeof(string), "Produtos: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[CProds][pCapasity]);
SendClientMessage(playerid, COR_Grooves, string);
return 1;
}
PlayerHaul[tmpcar][pLoad]--;
SBizzInfo[i][sbProducts]++;
venda = venda+SBizzInfo[i][sbPriceProd];
ConsumingMoney[playerid] = 1;
GivePlayerMoneyEx(playerid,SBizzInfo[i][sbPriceProd]);
SBizzInfo[i][sbTill] -= SBizzInfo[i][sbPriceProd];
if(PlayerHaul[tmpcar][pLoad] == 0)
{
GameTextForPlayer(playerid, "~r~Caminhao vazio, retorne a empresa e pegue mais.", 5000, 1);
format(string, sizeof(string), "Dinheiro ganho $%d.", venda);
SendClientMessage(playerid, COR_Grooves, string);
format(string, sizeof(string), "Produtos: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[CProds][pCapasity]);
SendClientMessage(playerid, COR_Grooves, string);
return 1;
}
}
OnPropUpdate();
return 1;
}
}
GameTextForPlayer(playerid, "~r~Voce esta longe da empresa", 5000, 1);
return 1;
}


