Dima_Tushin
Компетентный
Привет всему форуму у меня проблема возникла при загрузки может вы что то подскажите может я Косяк сделал ну к делу вот Код:
Кто Поможет ЗА+УЮ
Вот база данных
HTML:
stock LoadBizz() mysql_function_query(MYSQL, "SELECT * FROM `bizz`", true, "CallBackLoadBizz", "");
publics: CallBackLoadBizz()
{
new time = GetTickCount();
new r, f, idx;
cache_get_data(r, f, MYSQL);
new vresult[32];
for(idx = 0; idx < r; idx++)
{
cache_get_field_content(idx-1, "bID", vresult); BizzInfo[idx][bID] = strval(vresult);
cache_get_field_content(idx-1, "bOwned", vresult); BizzInfo[idx][bOwned] = strval(vresult);
cache_get_field_content(idx-1, "bOwner", BizzInfo[idx][bOwner],MYSQL);
cache_get_field_content(idx-1, "bMessage", BizzInfo[idx][bMessage],MYSQL);
cache_get_field_content(idx-1, "bEntranceX", vresult); BizzInfo[idx][bEntranceX] = floatstr(vresult);
cache_get_field_content(idx-1, "bEntranceY", vresult); BizzInfo[idx][bEntranceY] = floatstr(vresult);
cache_get_field_content(idx-1, "bEntranceZ", vresult); BizzInfo[idx][bEntranceZ] = floatstr(vresult);
cache_get_field_content(idx-1, "bExitX", vresult); BizzInfo[idx][bExitX] = floatstr(vresult);
cache_get_field_content(idx-1, "bExitY", vresult); BizzInfo[idx][bExitY] = floatstr(vresult);
cache_get_field_content(idx-1, "bExitZ", vresult); BizzInfo[idx][bExitZ] = floatstr(vresult);
cache_get_field_content(idx-1, "bBuyPrice", vresult); BizzInfo[idx][bBuyPrice] = strval(vresult);
cache_get_field_content(idx-1, "bEntranceCost", vresult); BizzInfo[idx][bEntranceCost] = strval(vresult);
cache_get_field_content(idx-1, "bTill", vresult); BizzInfo[idx][bTill] = strval(vresult);
cache_get_field_content(idx-1, "bLocked", vresult); BizzInfo[idx][bLocked] = strval(vresult);
cache_get_field_content(idx-1, "bInterior", vresult); BizzInfo[idx][bInterior] = strval(vresult);
cache_get_field_content(idx-1, "bProducts", vresult); BizzInfo[idx][bProducts] = strval(vresult);
cache_get_field_content(idx-1, "b2Till", vresult); BizzInfo[idx][b2Till] = strval(vresult);
cache_get_field_content(idx-1, "bPrice", vresult); BizzInfo[idx][bPrice] = strval(vresult);
cache_get_field_content(idx-1, "bBarX", vresult); BizzInfo[idx][bBarX] = floatstr(vresult);
cache_get_field_content(idx-1, "bBarY", vresult); BizzInfo[idx][bBarY] = floatstr(vresult);
cache_get_field_content(idx-1, "bBarZ", vresult); BizzInfo[idx][bBarZ] = floatstr(vresult);
cache_get_field_content(idx-1, "bMafia", vresult); BizzInfo[idx][bMafia] = strval(vresult);
if(BizzInfo[idx][bOwned] == 0)
{
AddStaticPickup(19132, 23, BizzInfo[idx][bEntranceX], BizzInfo[idx][bEntranceY], BizzInfo[idx][bEntranceZ]);
format(string,sizeof(string),"%s\nПродаётся\nЦена: %d", BizzInfo[idx][bMessage], BizzInfo[idx][bBuyPrice]);
BizzInfo[idx][bLocked] = 1;
BizzInfo[idx][bLabel] = Create3DTextLabel(string, 0xEAC700AA,BizzInfo[idx][bEntranceX], BizzInfo[idx][bEntranceY], BizzInfo[idx][bEntranceZ],20.0,0,1);
}
if(BizzInfo[idx][bOwned] == 1)
{
AddStaticPickup(19132, 23, BizzInfo[idx][bEntranceX], BizzInfo[idx][bEntranceY], BizzInfo[idx][bEntranceZ]);
format(string,sizeof(string), "%s\nВладелец:\n %s", BizzInfo[idx][bMessage], BizzInfo[idx][bOwner]);
BizzInfo[idx][bLabel] = Create3DTextLabel(string,0x00D900AA,BizzInfo[idx][bEntranceX], BizzInfo[idx][bEntranceY], BizzInfo[idx][bEntranceZ],20.0,0,1);
}
idx++;
}
printf("[Загрузка Бизнесов]: Было загружено - %d потрачено %d (ms)", idx, GetTickCount() - time);
return 1;
}
publics: SaveBizz(bizzid)
{
new query[768];
format(string,sizeof(string),"UPDATE `bizz` SET "),strcat(query,string);
format(string,sizeof(string),"`bOwned` = '%i', ",BizzInfo[bizzid][bOwned]), strcat(query, string);
format(string,sizeof(string),"`bOwner` = '%s', ",BizzInfo[bizzid][bOwner]), strcat(query, string);
format(string,sizeof(string),"`bMessage` = '%s', ",BizzInfo[bizzid][bMessage]), strcat(query, string);
format(string,sizeof(string),"`bEntranceX` = '%f', ",BizzInfo[bizzid][bEntranceX]), strcat(query,string);
format(string,sizeof(string),"`bEntranceY` = '%f', ",BizzInfo[bizzid][bEntranceY]), strcat(query,string);
format(string,sizeof(string),"`bEntranceZ` = '%f', ",BizzInfo[bizzid][bEntranceZ]), strcat(query,string);
format(string,sizeof(string),"`bExitX` = '%f', ",BizzInfo[bizzid][bExitX]), strcat(query,string);
format(string,sizeof(string),"`bExitY` = '%f', ",BizzInfo[bizzid][bExitY]), strcat(query,string);
format(string,sizeof(string),"`bExitZ` = '%f', ",BizzInfo[bizzid][bExitZ]), strcat(query,string);
format(string,sizeof(string),"`bBuyPrice` = '%i', ",BizzInfo[bizzid][bBuyPrice]), strcat(query,string);
format(string,sizeof(string),"`bEntranceCost` = '%i', ",BizzInfo[bizzid][bEntranceCost]), strcat(query,string);
format(string,sizeof(string),"`bTill` = '%i', ",BizzInfo[bizzid][bTill]), strcat(query,string);
format(string,sizeof(string),"`bLocked` = '%i', ",BizzInfo[bizzid][bLocked]), strcat(query,string);
format(string,sizeof(string),"`bInterior` = '%i', ",BizzInfo[bizzid][bInterior]), strcat(query,string);
format(string,sizeof(string),"`bProducts` = '%i', ",BizzInfo[bizzid][bProducts]), strcat(query,string);
format(string,sizeof(string),"`b2Till` = '%i', ",BizzInfo[bizzid][b2Till]), strcat(query,string);
format(string,sizeof(string),"`bPrice` = '%i', ",BizzInfo[bizzid][bPrice]), strcat(query,string);
format(string,sizeof(string),"`bBarX` = '%f', ",BizzInfo[bizzid][bBarX]), strcat(query,string);
format(string,sizeof(string),"`bBarY` = '%f', ",BizzInfo[bizzid][bBarY]), strcat(query,string);
format(string,sizeof(string),"`bBarZ` = '%f', ",BizzInfo[bizzid][bBarZ]), strcat(query,string);
format(string,sizeof(string),"`bMafia` = '%i', ",BizzInfo[bizzid][bMafia]), strcat(query,string);
format(string,sizeof(string),"WHERE `bID` = '%i'", BizzInfo[bizzid][bID]), strcat(query,string);
mysql_function_query(MYSQL ,query, false, "","");
return 1;
}
Вот база данных
PHP:
-- Структура таблицы `bizz`
--
CREATE TABLE IF NOT EXISTS `bizz` (
`bID` int(11) NOT NULL,
`bOwned` int(11) NOT NULL,
`bOwner` varchar(128) NOT NULL,
`bMessage` varchar(128) NOT NULL,
`bEntranceX` float NOT NULL,
`bEntranceY` float NOT NULL,
`bEntranceZ` float NOT NULL,
`bExitX` float NOT NULL,
`bExitY` float NOT NULL,
`bExitZ` float NOT NULL,
`bBuyPrice` int(11) NOT NULL,
`bEntranceCost` int(11) NOT NULL,
`bTill` int(11) NOT NULL,
`bLocked` int(11) NOT NULL,
`bInterior` int(11) NOT NULL,
`bProducts` int(11) NOT NULL,
`b2Till` int(11) NOT NULL,
`bPrice` int(11) NOT NULL,
`bBarX` float NOT NULL,
`bBarY` float NOT NULL,
`bBarZ` float NOT NULL,
`bMafia` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Дамп данных таблицы `bizz`
--
INSERT INTO `bizz` (`bID`, `bOwned`, `bOwner`, `bMessage`, `bEntranceX`, `bEntranceY`, `bEntranceZ`, `bExitX`, `bExitY`, `bExitZ`, `bBuyPrice`, `bEntranceCost`, `bTill`, `bLocked`, `bInterior`, `bProducts`, `b2Till`, `bPrice`, `bBarX`, `bBarY`, `bBarZ`, `bMafia`) VALUES
(1, 0, 'The State', 'Alhambra', 1836.51, -1682.58, 13.3451, 493.594, -22.2593, 1000.68, 100000, 0, 0, 1, 17, 100000, 0, 0, 499.962, -20.8209, 1000.68, 0);
Последнее редактирование:
