Код:
function LoadBizz() {
new result[100],index = 0;
mysql_query(SQL,"SELECT * FROM `bizz` ORDER BY `bizz`.`ID` ASC");
mysql_store_result();
while(mysql_retrieve_row()) {
bussines++;
index++;
new i = index;
mysql_get_field("ID", result); BizzInfo[i][bID] = strval(result);
mysql_get_field("Owned", result); BizzInfo[i][bOwned] = strval(result);
mysql_get_field("Owner", result); strmid(BizzInfo[i][bOwner], result, 0, 32, 32);
mysql_get_field("Message", result); strmid(BizzInfo[i][bMessage], result, 0, 100, 100);
mysql_get_field("EntranceX", result); BizzInfo[i][bEntranceX] = floatstr(result);
mysql_get_field("EntranceY", result); BizzInfo[i][bEntranceY] = floatstr(result);
mysql_get_field("EntranceZ", result); BizzInfo[i][bEntranceZ] = floatstr(result);
mysql_get_field("ExitX", result); BizzInfo[i][bExitX] = floatstr(result);
mysql_get_field("ExitY", result); BizzInfo[i][bExitY] = floatstr(result);
mysql_get_field("ExitZ", result); BizzInfo[i][bExitZ] = floatstr(result);
mysql_get_field("LevelNeeded", result); BizzInfo[i][bLevel] = strval(result);
mysql_get_field("BuyPrice", result); BizzInfo[i][bBuyPrice] = strval(result);
mysql_get_field("EntranceCost", result); BizzInfo[i][bFee] = strval(result);
mysql_get_field("Till", result); BizzInfo[i][bBalance] = strval(result);
mysql_get_field("Locked", result); BizzInfo[i][bLocked] = strval(result);
mysql_get_field("Interior", result); BizzInfo[i][bInterior] = strval(result);
mysql_get_field("Virtual", result); BizzInfo[i][bVirtual] = strval(result);
mysql_get_field("Radio", result); BizzInfo[i][bRadio] = strval(result);
mysql_get_field("Static", result); BizzInfo[i][bStatic] = strval(result);
mysql_get_field("Gas", result); BizzInfo[i][bGas] = strval(result);
mysql_get_field("Type", result); BizzInfo[i][bType] = strval(result);
BizzInfo[i][bPickup] = CreateDynamicPickup(1239, 23, BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]);
UpdateLabel(2,BizzInfo[i][bID]);
switch(BizzInfo[i][bType]) {
case 1: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],52,0,0,0,-1,500.0); // banca
case 2: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],6,0,0,0,-1,500.0); // gun shop
case 3: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],49,0,0,0,-1,500.0); // club
case 4: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],50,0,0,0,-1,500.0); // restaurant
case 5: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],38,0,0,0,-1,500.0); // sexshop
case 6: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],17,0,0,0,-1,500.0); // 24/7
case 7: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],45,0,0,0,-1,500.0); // binco
case 8: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],10,0,0,0,-1,500.0); // burger
case 9: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],25,0,0,0,-1,500.0); // casino
case 10: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],16,0,0,0,-1,500.0); // cnn
//case 11: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],16,0,0,0,-1,500.0); // moto
case 12: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],55,0,0,0,-1,500.0); // car
case 13: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],23,0,0,0,-1,500.0); // cs
//case 14: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],23,0,0,0,-1,500.0); // furniture
case 15: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],63,0,0,0,-1,500.0); // car color
case 16: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],23,0,0,0,-1,500.0); // paint
case 17: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],51,0,0,0,-1,500.0); // gas station
case 18: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],53,0,0,0,-1,500.0); // race
case 19: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],63,0,0,0,-1,500.0); // pns
case 20: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],9,0,0,0,-1,500.0); // pescarie
case 21: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],29,0,0,0,-1,500.0); // pizza
case 27: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],29,0,0,0,-1,500.0); // tuning
}
}
mysql_free_result();
printf("Bussines: %d", index);
return 1;
}function LoadBizz() {
new result[100],index = 0;
mysql_query(SQL,"SELECT * FROM `bizz` ORDER BY `bizz`.`ID` ASC");
mysql_store_result();
while(mysql_retrieve_row()) {
bussines++;
index++;
new i = index;
mysql_get_field("ID", result); BizzInfo[i][bID] = strval(result);
mysql_get_field("Owned", result); BizzInfo[i][bOwned] = strval(result);
mysql_get_field("Owner", result); strmid(BizzInfo[i][bOwner], result, 0, 32, 32);
mysql_get_field("Message", result); strmid(BizzInfo[i][bMessage], result, 0, 100, 100);
mysql_get_field("EntranceX", result); BizzInfo[i][bEntranceX] = floatstr(result);
mysql_get_field("EntranceY", result); BizzInfo[i][bEntranceY] = floatstr(result);
mysql_get_field("EntranceZ", result); BizzInfo[i][bEntranceZ] = floatstr(result);
mysql_get_field("ExitX", result); BizzInfo[i][bExitX] = floatstr(result);
mysql_get_field("ExitY", result); BizzInfo[i][bExitY] = floatstr(result);
mysql_get_field("ExitZ", result); BizzInfo[i][bExitZ] = floatstr(result);
mysql_get_field("LevelNeeded", result); BizzInfo[i][bLevel] = strval(result);
mysql_get_field("BuyPrice", result); BizzInfo[i][bBuyPrice] = strval(result);
mysql_get_field("EntranceCost", result); BizzInfo[i][bFee] = strval(result);
mysql_get_field("Till", result); BizzInfo[i][bBalance] = strval(result);
mysql_get_field("Locked", result); BizzInfo[i][bLocked] = strval(result);
mysql_get_field("Interior", result); BizzInfo[i][bInterior] = strval(result);
mysql_get_field("Virtual", result); BizzInfo[i][bVirtual] = strval(result);
mysql_get_field("Radio", result); BizzInfo[i][bRadio] = strval(result);
mysql_get_field("Static", result); BizzInfo[i][bStatic] = strval(result);
mysql_get_field("Gas", result); BizzInfo[i][bGas] = strval(result);
mysql_get_field("Type", result); BizzInfo[i][bType] = strval(result);
BizzInfo[i][bPickup] = CreateDynamicPickup(1239, 23, BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]);
UpdateLabel(2,BizzInfo[i][bID]);
switch(BizzInfo[i][bType]) {
case 1: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],52,0,0,0,-1,500.0); // banca
case 2: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],6,0,0,0,-1,500.0); // gun shop
case 3: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],49,0,0,0,-1,500.0); // club
case 4: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],50,0,0,0,-1,500.0); // restaurant
case 5: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],38,0,0,0,-1,500.0); // sexshop
case 6: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],17,0,0,0,-1,500.0); // 24/7
case 7: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],45,0,0,0,-1,500.0); // binco
case 8: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],10,0,0,0,-1,500.0); // burger
case 9: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],25,0,0,0,-1,500.0); // casino
case 10: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],16,0,0,0,-1,500.0); // cnn
//case 11: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],16,0,0,0,-1,500.0); // moto
case 12: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],55,0,0,0,-1,500.0); // car
case 13: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],23,0,0,0,-1,500.0); // cs
//case 14: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],23,0,0,0,-1,500.0); // furniture
case 15: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],63,0,0,0,-1,500.0); // car color
case 16: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],23,0,0,0,-1,500.0); // paint
case 17: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],51,0,0,0,-1,500.0); // gas station
case 18: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],53,0,0,0,-1,500.0); // race
case 19: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],63,0,0,0,-1,500.0); // pns
case 20: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],9,0,0,0,-1,500.0); // pescarie
case 21: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],29,0,0,0,-1,500.0); // pizza
case 27: CreateDynamicMapIcon(BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ],29,0,0,0,-1,500.0); // tuning
}
}
mysql_free_result();
printf("Bussines: %d", index);
return 1;
}