keriksex
Новичок
помогите с багом... когда завожу продукты в биз через команду /sellprods продукты не добавляються в биз незнаю в чем проблема может вы подскажите
Не удаляйте тему пожалуйсто
Не удаляйте тему пожалуйсто
PHP:
if(strcmp(cmd, "/buyprods", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new tmpcar = GetPlayerVehicleID(playerid);
new compcost = 50;
if(PlayerToPoint(60.0, playerid, 2787.8,-2436.3,13.7))
{
if(ProdTruck(tmpcar))
{
if(PlayerHaul[tmpcar-prodtruck[0]][pLoad] < PlayerHaul[tmpcar-prodtruck[0]][pCapasity])
{
new amount;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "/buyprods [çíà÷åíèå]");
return 1;
}
amount = strval(tmp);
if(amount < 1 || amount > 500) { SendClientMessage(playerid, COLOR_GREY, "Íåëüçÿ êóïèòü ìåíåå îäíîãî êîìïîíåíòà è íå áîëåå 500."); return 1; }
new check= PlayerHaul[tmpcar-prodtruck[0]][pLoad] + amount;
if(check > PlayerHaul[tmpcar-prodtruck[0]][pCapasity])
{
format(string, sizeof(string), "Ìàêñèìàëüíîå êîë-âî ïðîäóêòîâ: %d, Âû ïåðåãðóæåíû: %d.",PlayerHaul[tmpcar-prodtruck[0]][pCapasity],PlayerHaul[tmpcar-prodtruck[0]][pLoad]);
SendClientMessage(playerid, COLOR_GREY, string);
return 1;
}
new cost = amount*compcost * 2;
if(PlayerInfo[playerid][pMoney] >= cost)
{
PlayerHaul[tmpcar-prodtruck[0]][pLoad] += amount;
format(string, sizeof(string), "Ïðîäóêöèÿ: %d/%d.", PlayerHaul[tmpcar-prodtruck[0]][pLoad],PlayerHaul[tmpcar-prodtruck[0]][pCapasity]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "Âû êóïèëè %d ïðîäóêöèè çà $%d.", amount,cost);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
PlayerInfo[playerid][pMoney] -= cost;
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
return 1;
}
else
{
format(string, sizeof(string), "Âû ïðåäîñòàâëÿåòå %d ïðîäóêöèþ çà $%d.", amount,cost);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
}
else
{
format(string, sizeof(string), "Ïðîäóêöèÿ: %d/%d.", PlayerHaul[tmpcar-prodtruck[0]][pLoad],PlayerHaul[tmpcar-prodtruck[0]][pCapasity]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
}
else
{
SendClientMessage(playerid, TEAM_GROVE_COLOR, "Ýòà ìàøèíà íå ìîæåò ïåðåâîçèòü ïðîäóêöèþ.");
return 1;
}
}
}
return 1;
}
if(strcmp(cmd, "/sellprods", true) == 0)
{
new cashmade;
new tmpcar;
if(IsPlayerConnected(playerid))
{
tmpcar = GetPlayerVehicleID(playerid);
if(!ProdTruck(tmpcar))
{
GameTextForPlayer(playerid, "~r~Ó ‹AC ìE ‚PÓˆO‹…KA ƒOCA‹K…", 5000, 1);
return 1;
}
if(PlayerHaul[tmpcar-prodtruck[0]][pLoad] == 0)
{
GameTextForPlayer(playerid, "~r~‚PÓˆO‹…K ŒÓC, ‹EP셏EC’ ìA CK‡Aƒ", 5000, 1);
format(string, sizeof(string), "Ïðîäóêöèÿ: %d/%d.", PlayerHaul[tmpcar-prodtruck[0]][pLoad],PlayerHaul[tmpcar-prodtruck[0]][pCapasity]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
for(new i = 0; i < sizeof(BizzInfo); i++)
{
if (PlayerToPoint(10, playerid,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]))
{
//printf("Found House :%d",i);
for(new l = PlayerHaul[tmpcar-prodtruck[0]][pLoad]; l > 0; l--)
{
if(BizzInfo[i][bProducts] == BizzInfo[i][bMaxProducts])
{
GameTextForPlayer(playerid, "~r~ìAŽ… CK‡Aƒ‘ ŒO‡ì‘", 5000, 1);
format(string, sizeof(string), "Ïðèáûëü $%d.", cashmade);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "Ïðîäóêöèÿ: %d/%d.", PlayerHaul[tmpcar-prodtruck[0]][pLoad],PlayerHaul[tmpcar-prodtruck[0]][pCapasity]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
return 1;
}
if(BizzInfo[i][bPriceProd] > BizzInfo[i][bTill])
{
GameTextForPlayer(playerid, "~r~–‘ ìE –O„E– ˆAK‡”…’ CƒE‡KÓ", 5000, 1);
format(string, sizeof(string), "Ïðèáûëü $%d.", cashmade);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "Ïðîäóêöèÿ: %d/%d.", PlayerHaul[tmpcar-prodtruck[0]][pLoad],PlayerHaul[tmpcar-prodtruck[0]][pCapasity]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
return 1;
}
PlayerHaul[tmpcar-prodtruck[0]][pLoad]--;
BizzInfo[i][bProducts]++;
cashmade = cashmade+BizzInfo[i][bPriceProd];
PlayerInfo[playerid][pMoney] += BizzInfo[i][bPriceProd];//(playerid,BizzInfo[i][bPriceProd]);
BizzInfo[i][bTill] -= BizzInfo[i][bPriceProd];
if(PlayerHaul[tmpcar-prodtruck[0]][pLoad] == 0)
{
GameTextForPlayer(playerid, "~r~‚PÓˆO‹…K ŒÓC, ‹EP셏EC’ ìA CK‡Aƒ", 5000, 1);
format(string, sizeof(string), "Cash Earned $%d.", cashmade);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "Ïðîäóêöèÿ: %d/%d.", PlayerHaul[tmpcar-prodtruck[0]][pLoad],PlayerHaul[tmpcar-prodtruck[0]][pCapasity]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
return 1;
}
}
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-prodtruck[0]][pLoad]; l > 0; l--)
{
if(SBizzInfo[i][sbProducts] == SBizzInfo[i][sbMaxProducts])
{
GameTextForPlayer(playerid, "~r~ìAŽ… CK‡Aƒ‘ ŒO‡ì‘", 5000, 1);
format(string, sizeof(string), "Ïðèáûëü $%d.", cashmade);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "Ïðîäóêöèÿ: %d/%d.", PlayerHaul[tmpcar-prodtruck[0]][pLoad],PlayerHaul[tmpcar-prodtruck[0]][pCapasity]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
if(SBizzInfo[i][sbPriceProd] > SBizzInfo[i][sbTill])
{
GameTextForPlayer(playerid, "~r~–‘ ìE –O„E– ˆAK‡”…’ CƒE‡KÓ", 5000, 1);
format(string, sizeof(string), "Ïðèáûëü $%d.", cashmade);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "Ïðîäóêöèÿ: %d/%d.", PlayerHaul[tmpcar-prodtruck[0]][pLoad],PlayerHaul[tmpcar-prodtruck[0]][pCapasity]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
PlayerHaul[tmpcar-prodtruck[0]][pLoad]--;
SBizzInfo[i][sbProducts]++;
cashmade = cashmade+SBizzInfo[i][sbPriceProd];
PlayerInfo[playerid][pMoney] += SBizzInfo[i][sbPriceProd];//(playerid,SBizzInfo[i][sbPriceProd]);
SBizzInfo[i][sbTill] -= SBizzInfo[i][sbPriceProd];
if(PlayerHaul[tmpcar-prodtruck[0]][pLoad] == 0)
{
GameTextForPlayer(playerid, "~r~‚PÓˆO‹…K ŒÓC, ‹EP셏EC’ ìA CK‡Aƒ", 5000, 1);
format(string, sizeof(string), "Ïðèáûëü $%d.", cashmade);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "Ïðîäóêöèÿ: %d/%d.", PlayerHaul[tmpcar-prodtruck[0]][pLoad],PlayerHaul[tmpcar-prodtruck[0]][pCapasity]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
}
return 1;
}
}
GameTextForPlayer(playerid, "~r~ƒA‡EKO O €…ˆìECA", 5000, 1);
return 1;
}
