Advertisement
xt3z0ne

Createbiz

Aug 14th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 10.62 KB | None | 0 0
  1. CMD:createbiz(playerid, params[]) {
  2.     if(PlayerInfo[playerid][pAdmin] < 6) return 1;
  3.     new type, value, level, idd = bussines+1, Float: Pos[3], query[256];
  4.     if(sscanf(params, "iii", type, value, level)) {
  5.         SCM(playerid, COLOR_GREY, "Syntax: {FFFFFF}/createbiz <type> <value> <level>");
  6.         SCM(playerid, COLOR_GREY, "(1) Banca, (2) Gun Shop, (3) Club, (4) Sex Shop, (5) Casino, (6) 24/7, (7) Burger Shot, (8) Gym");
  7.         SCM(playerid, COLOR_GREY, "(9) Pizza, (11) Binco, (12) Gas Station, (13) PNS*, (14) Cluckin Bell, (15) CNN, (16) Tuning*");
  8.         return 1;
  9.     }
  10.     if(type == 10 || type < 1) return SCM(playerid, COLOR_GREY, "Invalid type!");
  11.     GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  12.     switch(type) {
  13.         case 1: {
  14.             format(query, sizeof(query), "INSERT INTO `bizz` (`EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `LevelNeeded`, `BuyPrice`, `Type`, `Interior`) VALUES ('%f', '%f', '%f', '2306', '-16', '27', '%d', '%d', '%d', '%d')", Pos[0], Pos[1], Pos[2], level, value, type, BizInteriorID(type));
  15.             BizzInfo[idd][bExitX] = 2306; BizzInfo[idd][bExitY] = -16; BizzInfo[idd][bExitZ] = 27;
  16.         }
  17.         case 2: {
  18.             format(query, sizeof(query), "INSERT INTO `bizz` (`EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `LevelNeeded`, `BuyPrice`, `Type`, `Interior`) VALUES ('%f', '%f', '%f', '316', '-142', '1000', '%d', '%d', '%d', '%d')", Pos[0], Pos[1], Pos[2], level, value, type, BizInteriorID(type));
  19.             BizzInfo[idd][bExitX] = 316; BizzInfo[idd][bExitY] = -142; BizzInfo[idd][bExitZ] = 1000;
  20.         }
  21.         case 3: {
  22.             format(query, sizeof(query), "INSERT INTO `bizz` (`EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `LevelNeeded`, `BuyPrice`, `Type`, `Interior`) VALUES ('%f', '%f', '%f', '-794.942', '490.782', '1376.2', '%d', '%d', '%d', '%d')", Pos[0], Pos[1], Pos[2], level, value, type, BizInteriorID(type));
  23.             BizzInfo[idd][bExitX] = -794.942; BizzInfo[idd][bExitY] = 490.782; BizzInfo[idd][bExitZ] = 1376.2;
  24.         }
  25.         case 4: {
  26.             format(query, sizeof(query), "INSERT INTO `bizz` (`EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `LevelNeeded`, `BuyPrice`, `Type`, `Interior`) VALUES ('%f', '%f', '%f', '-100.403', '-24.3921', '1000.72', '%d', '%d', '%d', '%d')", Pos[0], Pos[1], Pos[2], level, value, type, BizInteriorID(type));
  27.             BizzInfo[idd][bExitX] = -100.403; BizzInfo[idd][bExitY] = -24.3921; BizzInfo[idd][bExitZ] = 1000.72;
  28.         }
  29.         case 5: {
  30.             format(query, sizeof(query), "INSERT INTO `bizz` (`EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `LevelNeeded`, `BuyPrice`, `Type`, `Interior`) VALUES ('%f', '%f', '%f', '2015.45', '1017.09', '996.875', '%d', '%d', '%d', '%d')", Pos[0], Pos[1], Pos[2], level, value, type, BizInteriorID(type));
  31.             BizzInfo[idd][bExitX] = 2015.45; BizzInfo[idd][bExitY] = 1017.09; BizzInfo[idd][bExitZ] = 996.875;
  32.         }
  33.         case 6: {
  34.             format(query, sizeof(query), "INSERT INTO `bizz` (`EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `LevelNeeded`, `BuyPrice`, `Type`, `Interior`) VALUES ('%f', '%f', '%f', '-31.0246', '-91.3283', '1003.55', '%d', '%d', '%d', '%d')", Pos[0], Pos[1], Pos[2], level, value, type, BizInteriorID(type));
  35.             BizzInfo[idd][bExitX] = -31.0246; BizzInfo[idd][bExitY] = -91.3283; BizzInfo[idd][bExitZ] = 1003.55;
  36.         }
  37.         case 7: {
  38.             format(query, sizeof(query), "INSERT INTO `bizz` (`EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `LevelNeeded`, `BuyPrice`, `Type`, `Interior`) VALUES ('%f', '%f', '%f', '363.134', '-74.8469', '1001.51', '%d', '%d', '%d', '%d')", Pos[0], Pos[1], Pos[2], level, value, type, BizInteriorID(type));
  39.             BizzInfo[idd][bExitX] = 363.134; BizzInfo[idd][bExitY] = -74.8469; BizzInfo[idd][bExitZ] = 1001.51;
  40.         }
  41.         case 8: {
  42.             format(query, sizeof(query), "INSERT INTO `bizz` (`EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `LevelNeeded`, `BuyPrice`, `Type`, `Interior`) VALUES ('%f', '%f', '%f', '772.112', '-3.89865', '1000.73', '%d', '%d', '%d', '%d')", Pos[0], Pos[1], Pos[2], level, value, type, BizInteriorID(type));
  43.             BizzInfo[idd][bExitX] = 772.112; BizzInfo[idd][bExitY] = -3.89865; BizzInfo[idd][bExitZ] = 1000.73;
  44.         }
  45.         case 9: {
  46.             format(query, sizeof(query), "INSERT INTO `bizz` (`EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `LevelNeeded`, `BuyPrice`, `Type`, `Interior`) VALUES ('%f', '%f', '%f', '372.54', '-133.009', '1001.49', '%d', '%d', '%d', '%d')", Pos[0], Pos[1], Pos[2], level, value, type, BizInteriorID(type));
  47.             BizzInfo[idd][bExitX] = 372.54; BizzInfo[idd][bExitY] = -133.009; BizzInfo[idd][bExitZ] = 1001.49;
  48.         }
  49.         case 11: {
  50.             format(query, sizeof(query), "INSERT INTO `bizz` (`EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `LevelNeeded`, `BuyPrice`, `Type`, `Interior`) VALUES ('%f', '%f', '%f', '207.738', '-109.02', '1005.13', '%d', '%d', '%d', '%d')", Pos[0], Pos[1], Pos[2], level, value, type, BizInteriorID(type));
  51.             BizzInfo[idd][bExitX] = 207.738; BizzInfo[idd][bExitY] = -109.02; BizzInfo[idd][bExitZ] = 1005.13;
  52.         }
  53.         case 12: format(query, sizeof(query), "INSERT INTO `bizz` (`EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `LevelNeeded`, `BuyPrice`, `Type`, `Sbiz`) VALUES ('%f', '%f', '%f', '0', '0', '0', '%d', '%d', '%d', '1', '%d')", Pos[0], Pos[1], Pos[2], level, value, type, BizInteriorID(type));
  54.         //case 13: format(query, sizeof(query), "INSERT INTO `bizz` (`EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `LevelNeeded`, `BuyPrice`, `Type`, `Sbiz`) VALUES ('%f', '%f', '%f', '0', '0', '0', '%d', '%d', '%d', '1', '%d')", Pos[0], Pos[1], Pos[2], level, value, type, BizInteriorID(type));
  55.         case 14: {
  56.             format(query, sizeof(query), "INSERT INTO `bizz` (`EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `LevelNeeded`, `BuyPrice`, `Type`, `Interior`) VALUES ('%f', '%f', '%f', '364.942', '-11.0787', '1001.85', '%d', '%d', '%d', '%d')", Pos[0], Pos[1], Pos[2], level, value, type, BizInteriorID(type));
  57.             BizzInfo[idd][bExitX] = 364.942; BizzInfo[idd][bExitY] = -11.0787; BizzInfo[idd][bExitZ] = 1001.85;
  58.         }
  59.         case 15: format(query, sizeof(query), "INSERT INTO `bizz` (`EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `LevelNeeded`, `BuyPrice`, `Type`, `Sbiz`) VALUES ('%f', '%f', '%f', '0', '0', '0', '%d', '%d', '%d', '1', '%d')", Pos[0], Pos[1], Pos[2], level, value, type, BizInteriorID(type));
  60.         case 16: format(query, sizeof(query), "INSERT INTO `bizz` (`EntranceX`, `EntranceY`, `EntranceZ`, `ExitX`, `ExitY`, `ExitZ`, `LevelNeeded`, `BuyPrice`, `Type`, `Sbiz`) VALUES ('%f', '%f', '%f', '0', '0', '0', '%d', '%d', '%d', '1', '%d')", Pos[0], Pos[1], Pos[2], level, value, type, BizInteriorID(type));
  61.     }
  62.     mysql_tquery(SQL, query, "", "");
  63.     format(query, sizeof(query), "UPDATE `bizz` SET `Virtual`='%d' WHERE `ID`='%d'", idd, idd);
  64.     mysql_tquery(SQL, query, "", "");
  65.  
  66.     BizzInfo[idd][bEntranceX] = Pos[0];
  67.     BizzInfo[idd][bEntranceY] = Pos[1];
  68.     BizzInfo[idd][bEntranceZ] = Pos[2];
  69.     BizzInfo[idd][bBuyPrice] = value;
  70.     BizzInfo[idd][bLevelNeeded] = level;
  71.     BizzInfo[idd][bVirtual] = idd;
  72.     BizzInfo[idd][bType] = type;
  73.     BizzInfo[idd][bInterior] = BizInteriorID(type);
  74.     if(type >= 12 && type != 14) BizzInfo[idd][bSbiz] = 1;
  75.  
  76.     new PropertyString[256];
  77.     DestroyDynamic3DTextLabel(BizzLabel[idd]);
  78.     format(PropertyString, sizeof(PropertyString),"{0068CF}%s \n{EEEEEE}Business {0068CF}#%d \n{0068CF}This Business is for sale(/buybusiness) ! \n {EEEEEE}Price: {0068CF}%s \n{EEEEEE}Level: {0068CF}%d %s",BizzInfo[idd][bMessage],idd,FormatNumber(BizzInfo[idd][bBuyPrice]),BizzInfo[idd][bLevelNeeded]);
  79.     BizzLabel[idd] = CreateDynamic3DTextLabel(PropertyString ,0x0066FFCC,BizzInfo[idd][bEntranceX], BizzInfo[idd][bEntranceY], BizzInfo[idd][bEntranceZ],25, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 100.0);
  80.     CreateDynamicPickup(1239, 1, BizzInfo[idd][bEntranceX], BizzInfo[idd][bEntranceY], BizzInfo[idd][bEntranceZ]);
  81.     pickups++;
  82.     bussines++;
  83.  
  84.     if(BizzInfo[idd][bType] == 1) CreateDynamicMapIcon(BizzInfo[idd][bEntranceX],BizzInfo[idd][bEntranceY],BizzInfo[idd][bEntranceZ],52,0,-1,-1,-1,750.0); //Bank
  85.     if(BizzInfo[idd][bType] == 2) CreateDynamicMapIcon(BizzInfo[idd][bEntranceX],BizzInfo[idd][bEntranceY],BizzInfo[idd][bEntranceZ],18,0,-1,-1,-1,750.0); //GunShop
  86.     if(BizzInfo[idd][bType] == 3) CreateDynamicMapIcon(BizzInfo[idd][bEntranceX],BizzInfo[idd][bEntranceY],BizzInfo[idd][bEntranceZ],49,0,-1,-1,-1,750.0); //Bars
  87.     if(BizzInfo[idd][bType] == 4) CreateDynamicMapIcon(BizzInfo[idd][bEntranceX],BizzInfo[idd][bEntranceY],BizzInfo[idd][bEntranceZ],38,0,-1,-1,-1,750.0); //Sex Shop
  88.     if(BizzInfo[idd][bType] == 5) CreateDynamicMapIcon(BizzInfo[idd][bEntranceX],BizzInfo[idd][bEntranceY],BizzInfo[idd][bEntranceZ],25,0,-1,-1,-1,750.0); //Casino
  89.     if(BizzInfo[idd][bType] == 6) CreateDynamicMapIcon(BizzInfo[idd][bEntranceX],BizzInfo[idd][bEntranceY],BizzInfo[idd][bEntranceZ],17,0,-1,-1,-1,750.0); //24/7
  90.     if(BizzInfo[idd][bType] == 7) CreateDynamicMapIcon(BizzInfo[idd][bEntranceX],BizzInfo[idd][bEntranceY],BizzInfo[idd][bEntranceZ],10,0,-1,-1,-1,750.0); //Burger Shot
  91.     if(BizzInfo[idd][bType] == 8) CreateDynamicMapIcon(BizzInfo[idd][bEntranceX],BizzInfo[idd][bEntranceY],BizzInfo[idd][bEntranceZ],54,0,-1,-1,-1,750.0); //Gym
  92.     if(BizzInfo[idd][bType] == 9) CreateDynamicMapIcon(BizzInfo[idd][bEntranceX],BizzInfo[idd][bEntranceY],BizzInfo[idd][bEntranceZ],29,0,-1,-1,-1,750.0); //Pizza
  93.     if(BizzInfo[idd][bType] == 10) CreateDynamicMapIcon(BizzInfo[idd][bEntranceX],BizzInfo[idd][bEntranceY],BizzInfo[idd][bEntranceZ],51,0,-1,-1,-1,750.0); //Rent Car
  94.     if(BizzInfo[idd][bType] == 11) CreateDynamicMapIcon(BizzInfo[idd][bEntranceX],BizzInfo[idd][bEntranceY],BizzInfo[idd][bEntranceZ],45,0,-1,-1,-1,750.0); //Clothes
  95.     if(BizzInfo[idd][bType] == 12) CreateDynamicMapIcon(BizzInfo[idd][bEntranceX],BizzInfo[idd][bEntranceY],BizzInfo[idd][bEntranceZ],27,0,-1,-1,-1,750.0); //Gas Station
  96.     if(BizzInfo[idd][bType] == 13) CreateDynamicMapIcon(BizzInfo[idd][bEntranceX],BizzInfo[idd][bEntranceY],BizzInfo[idd][bEntranceZ],63,0,-1,-1,-1,750.0); //PNS
  97.     if(BizzInfo[idd][bType] == 14) CreateDynamicMapIcon(BizzInfo[idd][bEntranceX],BizzInfo[idd][bEntranceY],BizzInfo[idd][bEntranceZ],14,0,-1,-1,-1,750.0); //Cluckin Bell
  98.  
  99.     new string[128];
  100.     format(string, sizeof(string), "[@@ %d @@]%f, %f, %f, [$%s, %d lvl, %d int, %d type]", idd, Pos[0], Pos[1], Pos[2], FormatNumber(value), level, BizInteriorID(type), type);
  101.     SCM(playerid, COLOR_YELLOW, string);
  102.     return 1;
  103. }
  104.  
  105. function BizInteriorID(type) {
  106.     new x;
  107.     switch(type) {
  108.         case 1: x = 0;
  109.         case 2: x = 7;
  110.         case 3: x = 1;
  111.         case 4: x = 3;
  112.         case 5: x = 10;
  113.         case 6: x = 18;
  114.         case 7: x = 10;
  115.         case 8: x = 5;
  116.         case 9: x = 5;
  117.         case 11: x = 15;
  118.         case 12..13: x = 0;
  119.         case 15..16: x = 0;
  120.         case 14: x = 9;
  121.     }
  122.     return x;
  123. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement