[P]remi[O]
Умник
Суть проблемы в том что когда приезжаю к бизнесу и ввожу /sellprods, то продукты в грузовике тратятся но деньги не прибавляются.
Код:
Код:
PHP:
else if(strcmp(cmd, "/sellprods", true) == 0)
{
new cashmade;
new tmpcar;
if(IsPlayerConnected(playerid))
{
tmpcar = GetPlayerVehicleID(playerid);
if(!IsATruck(tmpcar)) return send(playerid, 0x00D900C8, "* Âû íå â ãðóçîâèêå äëÿ ïåðåâîçà ïðîäóêòîâ.");
if(PlayerHaul[tmpcar][pLoad] == 0)
{
GameTextForPlayer(playerid, "~r~Truck is empty, return to the stock house", 5000, 1);
format(string, sizeof(string), "Ïðîäóêòû: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
send(playerid, 0x00D900C8, 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~Our stores are full", 5000, 1);
format(string, sizeof(string), "Cash Earned $%d.", cashmade);
send(playerid, 0x00D900C8, string);
format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
send(playerid, 0x00D900C8, string);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
return 1;
}
if(BizzInfo[i][bPriceProd] > BizzInfo[i][bTill])
{
GameTextForPlayer(playerid, "~r~We Cant Afford The Deal", 5000, 1);
format(string, sizeof(string), "Cash Earned $%d.", cashmade);
send(playerid, 0x00D900C8, string);
format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
send(playerid, 0x00D900C8, string);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
return 1;
}
PlayerHaul[tmpcar][pLoad]--;
BizzInfo[i][bProducts]++;
cashmade = cashmade+BizzInfo[i][bPriceProd];
ConsumingMoney[playerid] = 1;
GivePlayerMoney(playerid,BizzInfo[i][bPriceProd]);
BizzInfo[i][bTill] -= BizzInfo[i][bPriceProd];
if(PlayerHaul[tmpcar][pLoad] == 0)
{
GameTextForPlayer(playerid, "~r~Truck is empty, return to the stock house", 5000, 1);
format(string, sizeof(string), "Cash Earned $%d.", cashmade);
send(playerid, 0x00D900C8, string);
format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
send(playerid, 0x00D900C8, 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~Our stores are full", 5000, 1);
format(string, sizeof(string), "Cash Earned $%d.", cashmade);
send(playerid, 0x00D900C8, string);
format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
send(playerid, 0x00D900C8, string);
return 1;
}
if(SBizzInfo[i][sbPriceProd] > SBizzInfo[i][sbTill])
{
GameTextForPlayer(playerid, "~r~We Cant Afford The Deal", 5000, 1);
format(string, sizeof(string), "Cash Earned $%d.", cashmade);
send(playerid, 0x00D900C8, string);
format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
send(playerid, 0x00D900C8, string);
return 1;
}
PlayerHaul[tmpcar][pLoad]--;
SBizzInfo[i][sbProducts]++;
cashmade = cashmade+SBizzInfo[i][sbPriceProd];
ConsumingMoney[playerid] = 1;
GivePlayerMoney(playerid,SBizzInfo[i][sbPriceProd]);
SBizzInfo[i][sbTill] -= SBizzInfo[i][sbPriceProd];
if(PlayerHaul[tmpcar][pLoad] == 0)
{
GameTextForPlayer(playerid, "~r~Truck is empty, return to the stock house", 5000, 1);
format(string, sizeof(string), "Cash Earned $%d.", cashmade);
send(playerid, 0x00D900C8, string);
format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
send(playerid, 0x00D900C8, string);
return 1;
}
}
OnPropUpdate();
return 1;
}
}
GameTextForPlayer(playerid, "~r~To Far From A Business", 5000, 1);
return 1;
}
