Guest User

Biz System v1.1

a guest
Jul 23rd, 2016
1,148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 75.13 KB | None | 0 0
  1. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  2. // ===========================================================================================================================================================================================
  3. //                                                                                              Dynamic Biz System - Dayrion - v1
  4. // ===========================================================================================================================================================================================
  5. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  6.  
  7. #define FILTERSCRIPT
  8.  
  9. #include <a_samp>
  10. #include <izcmd>
  11. #include <sscanf2>
  12. #include <foreach>
  13. #include <YSI\y_ini>
  14. #include <easyDialog>
  15.  
  16. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  17.  
  18. #if defined FILTERSCRIPT
  19.  
  20. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  21.  
  22. #define                     RED                                     0xFF0000FF
  23. #define                     WHITE                                   0xFFFFFFFF
  24. #define                     BLUE                                    0x99CCFFFF
  25. #define                     LBLUE                                   0x99D6FFFF
  26. #define                     GREEN                                   0x008000FF
  27. #define                     BROWN                                   0x9E3E3EFF
  28.  
  29. #define                     RED_U                                   "{FF0000}"
  30. #define                     WHITE_U                                 "{FFFFFF}"
  31. #define                     BLUE_U                                  "{66A3FF}"
  32. #define                     LBLUE_U                                 "{99D6FF}"
  33. #define                     GREEN_U                                 "{39AC39}"
  34. #define                     BROWN_U                                 "{9E3E3E}"
  35. #define                     ORANGE_U                                "{ffc34d}"
  36.  
  37. #define                     X11_CORNSILK_2                          0xEEE8CDFF
  38. #define                     X11_PEACH_PUFF_2                        0xEECBADFF
  39. #define                     X11_NAVAJO_WHITE_1                      0xFFDEADFF
  40. #define                     X11_NAVAJO_WHITE_2                      0xEECFA1FF
  41.  
  42. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  43.  
  44. #define                     MAX_BIZ                                 100                         // Number of biz
  45. #define                     MAX_BALANCE                             1000000                     // Max amount of money in a biz
  46. #define                     MAX_BIZ_NAME                            24                          // The max lengh of a biz's name
  47. #define                     INVALID_BIZ_ID                          (MAX_BIZ+10)*2              // Don't change this
  48.  
  49. /*Recommanded pickup ID :
  50. » 19523 - 19524 - 1275 - 1247 - 1318 */
  51.  
  52. #define                     ICON_BIZ_LOCKED                         19522
  53. #define                     ICON_BIZ_OPEN                           1273
  54. #define                     ICON_BIZ_PENDING                        1272
  55. #define                     ICON_BIZ_INTERIOR                       1239
  56.  
  57.  
  58. #define                     DIALOG(%0)                              Dialog:%0(playerid, response, listitem, inputtext[])
  59.  
  60. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  61.  
  62. //Please, don't remove/change this.
  63. #if MAX_BIZ_NAME < 12
  64.     #error "MAX_BIZ_NAME is too short. [Min 12]"
  65. #endif
  66.  
  67. #if MAX_BALANCE < 1
  68.     #error "MAX_BALANCE need to be higher than 1$"
  69. #endif
  70.  
  71. #if MAX_BIZ < 1
  72.     #error "MAX_BIZ need to be higher than 0"
  73. #endif
  74.  
  75. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  76. // ===========================================================================================================================================================================================
  77. //                                                                                                  Variables
  78. // ===========================================================================================================================================================================================
  79. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  80.  
  81. enum bizInfos
  82. {
  83.     bID,
  84.     bPickupID,
  85.     bPickupEnter,
  86.     bType,
  87.     bInterior,
  88.     bLevel,
  89.     bPrice,
  90.     Float:bX,
  91.     Float:bY,
  92.     Float:bZ,
  93.     Float:beX,
  94.     Float:beY,
  95.     Float:beZ,
  96.     bool:bBuy,
  97.     bOwner[24],
  98.     bool:bCreated,
  99.     bSafe,
  100.     bool:bOpen,
  101.     bEnterPrice,
  102.     bName[MAX_BIZ_NAME],
  103.     bVW,
  104.     bool:bInvestor
  105. };
  106.  
  107. enum investor
  108. {
  109.     iID,
  110.     iName[24],
  111.     bool:iInves,
  112.     bool:iSafe,
  113.     bool:iLock,
  114.     bool:iEnterPrice,
  115.     bool:iRename,
  116.     bool:iDeposit,
  117.     bool:iWithdraw
  118. };
  119.  
  120. enum BizType
  121. {
  122.     Float:X,
  123.     Float:Y,
  124.     Float:Z,
  125.     Interior,
  126.     Name[50]
  127. };
  128.  
  129. new Gym[][BizType] =
  130. {
  131.     {772.111999,-3.898649,1000.728820, 5, "LS Gym"},
  132.     {774.213989,-48.924297,1000.585937, 6, "SF Gym"},
  133.     {773.579956,-77.096694,1000.655029, 7, "LV Gym"}
  134. };
  135.  
  136. new Int247[][BizType] =
  137. {
  138.     {-25.884498,-185.868988,1003.546875, 17, "24/7 1 - (Need mapping)"},
  139.     {6.091179,-29.271898,1003.549438,    10, "24/7 2 - (Need mapping)"},
  140.     {-30.946699,-89.609596,1003.546875,  18, "24/7 3 - (Need mapping)"},
  141.     {-25.132598,-139.066986,1003.546875, 16, "24/7 4"},
  142.     {-27.312299,-29.277599,1003.557250,  4, "24/7 5 - (Need a bit of mapping)"},
  143.     {-26.691598,-55.714897,1003.546875,  6, "24/7 6"}
  144. };
  145.  
  146. new Ammunation[][BizType] =
  147. {
  148.     {286.148986,-40.644397,1001.515625, 1, "Ammunation 1"},
  149.     {286.800994,-82.547599,1001.515625, 4, "Ammunation 2"},
  150.     {296.6996,-110.8405,1001.5156, 6, "Ammunation 3"},
  151.     {316.524993,-167.706985,999.593750, 6, "Ammunation 4"}
  152. };
  153.  
  154. new Shop[][BizType] =
  155. {
  156.     {-100.4078,-24.5987,1000.7188, 3,   "Sex Shop"},
  157.     {963.418762,2108.292480,1011.030273, 1, "Meat Factory"},
  158.     {-2240.468505,137.060440,1035.414062, 6, "Zero's RC Shop"}
  159. };
  160.  
  161. new Clothes[][BizType] =
  162. {
  163.     {207.737991,-109.019996,1005.132812, 15, "Binco"},
  164.     {204.332992,-166.694992,1000.523437, 14, "Didier Sachs"},
  165.     {207.054992,-138.804992,1003.507812, 3, "Prolaps"},
  166.     {203.777999,-48.492397,1001.804687, 1, "Suburban"},
  167.     {226.293991,-7.431529,1002.210937, 5, "Victim"},
  168.     {161.391006,-93.159156,1001.804687, 18, "Zip"}
  169. };
  170.  
  171. new Food[][BizType] =
  172. {
  173.     {501.980987,-69.150199,998.757812, 11, "Bar"},
  174.     {-227.027999,1401.229980,27.765625, 18, "Lil' probe inn"},
  175.     {457.304748,-88.428497,999.554687, 4, "Jay's diner"},
  176.     {363.4929,-74.7067,1001.5078, 10, "Burger Shot"},
  177.     {364.9168,-11.0500,1001.8516, 9, "Clukin' Bell"},
  178.     {372.3154,-132.9696,1001.4922, 5, "Well Stacked pizza"},
  179.     {377.3160,-192.9741,1000.6401, 17, "Rusty Browns donuts"}
  180. };
  181.  
  182. new InteriorName[][] =
  183. {
  184.     "Unknown",
  185.     "24/7",
  186.     "Ammunation",
  187.     "Store",
  188.     "Clothes Shop",
  189.     "Food Chain",
  190.     "Sport"
  191. };
  192.  
  193.  
  194. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  195.  
  196. new BizCreating[MAX_PLAYERS] = -1,
  197.     BizInfo[MAX_BIZ][bizInfos],
  198.     BizInv[MAX_BIZ][investor],
  199.     CurrentMaxbizid = -1,
  200.     Text3D:BizLabelID[MAX_BIZ],
  201.     Text3D:BizLabelEnterID[MAX_BIZ],
  202.     LastBizVisited[MAX_PLAYERS] = INVALID_BIZ_ID,
  203.     BizVW = 214799999;
  204.  
  205.  
  206. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  207. // ===========================================================================================================================================================================================
  208. //                                                                                                  Callback
  209. // ===========================================================================================================================================================================================
  210. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  211.  
  212.  
  213. forward LoadBiz_data(bizid,name[],value[]);
  214. public LoadBiz_data(bizid,name[],value[])
  215. {
  216.     INI_Int("ID",BizInfo[bizid][bID]);
  217.     INI_Int("PickupID",BizInfo[bizid][bPickupID]);
  218.     INI_Int("PickupEnter",BizInfo[bizid][bPickupEnter]);
  219.     INI_Int("Type",BizInfo[bizid][bType]);
  220.     INI_Int("Interior",BizInfo[bizid][bInterior]);
  221.     INI_Int("Level",BizInfo[bizid][bLevel]);
  222.     INI_Int("Price",BizInfo[bizid][bPrice]);
  223.     INI_Float("X",BizInfo[bizid][bX]);
  224.     INI_Float("Y",BizInfo[bizid][bY]);
  225.     INI_Float("Z",BizInfo[bizid][bZ]);
  226.     INI_Float("eX",BizInfo[bizid][beX]);
  227.     INI_Float("eY",BizInfo[bizid][beY]);
  228.     INI_Float("eZ",BizInfo[bizid][beZ]);
  229.     INI_Bool("Bought",BizInfo[bizid][bBuy]);
  230.     INI_String("Owner",BizInfo[bizid][bOwner], MAX_PLAYER_NAME);
  231.     INI_Bool("Existing",BizInfo[bizid][bCreated]);
  232.     INI_Int("Safe",BizInfo[bizid][bSafe]);
  233.     INI_Bool("Open",BizInfo[bizid][bOpen]);
  234.     INI_Int("EnterPrice",BizInfo[bizid][bEnterPrice]);
  235.     INI_String("Name",BizInfo[bizid][bName], MAX_BIZ_NAME);
  236.     INI_Int("VirtualWorld",BizInfo[bizid][bVW]);
  237.     INI_Bool("Investor",BizInfo[bizid][bInvestor]);
  238.     return 1;
  239. }
  240.  
  241.  
  242. BizPath(bizid)
  243. {
  244.     static str[90];
  245.     format(str,sizeof(str), "/BizData/Biz/%i.ini", bizid);
  246.     return str;
  247. }
  248.  
  249. InvestorPath(bizid)
  250. {
  251.     static str[90];
  252.     format(str, sizeof(str), "/BizData/Investor/%i.ini", bizid);
  253.     return str;
  254. }
  255.  
  256. forward LoadBizInv_data(bizid, name[], value[]);
  257. public LoadBizInv_data(bizid, name[], value[])
  258. {
  259.     INI_Int("ID",BizInv[bizid][iID]);
  260.     INI_String("Name",BizInv[bizid][iName], MAX_PLAYER_NAME);
  261.     INI_Bool("Inves",BizInv[bizid][iInves]);
  262.     INI_Bool("Safe",BizInv[bizid][iSafe]);
  263.     INI_Bool("Lock",BizInv[bizid][iLock]);
  264.     INI_Bool("EnterPrice",BizInv[bizid][iEnterPrice]);
  265.     INI_Bool("Rename",BizInv[bizid][iRename]);
  266.     INI_Bool("Deposit",BizInv[bizid][iDeposit]);
  267.     INI_Bool("Withdraw",BizInv[bizid][iWithdraw]);
  268.     return 1;
  269. }
  270.  
  271.  
  272. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  273.  
  274. public OnFilterScriptInit()
  275. {
  276.     print("\n---------------------------");
  277.     print("»»» Biz FS [Version 1.1] «««");
  278.     print("---------------------------\n");
  279.  
  280.     for (new i; i < MAX_BIZ; i++)
  281.     {
  282.         if(!fexist(InvestorPath(i)))
  283.         {
  284.             new INI:File = INI_Open(InvestorPath(i));
  285.             INI_SetTag(File, "Stats");
  286.             INI_WriteInt(File,"ID",i);
  287.             INI_WriteString(File,"Name", "Nobody");
  288.             INI_WriteBool(File,"Inves",BizInv[i][iInves]);
  289.             INI_WriteBool(File,"Safe",BizInv[i][iLock]);
  290.             INI_WriteBool(File,"Safe",BizInv[i][iSafe]);
  291.             INI_WriteBool(File,"EnterPrice",BizInv[i][iEnterPrice]);
  292.             INI_WriteBool(File,"Rename",BizInv[i][iRename]);
  293.             INI_WriteBool(File,"Deposit",BizInv[i][iDeposit]);
  294.             INI_WriteBool(File,"Withdraw",BizInv[i][iWithdraw]);
  295.             INI_Close(File);
  296.             INI_ParseFile(InvestorPath(i), "LoadBizInv_data", .bExtra = true, .extra = i);
  297.             printf("Loading... | Investor Biz ID %i | Created", i);
  298.         }
  299.         else
  300.         {
  301.             INI_ParseFile(InvestorPath(i), "LoadBizInv_data", .bExtra = true, .extra = i);
  302.             //printf("Loading... | Investor Biz ID %i | Loaded", i);
  303.         }
  304.     }
  305.  
  306.  
  307.     for (new i; i<MAX_BIZ; i++)
  308.     {
  309.         if(!fexist(BizPath(i)))
  310.         {
  311.             BizInfo[i][bInterior]       = -1;
  312.             BizInfo[i][bPickupID]       = -1;
  313.             BizInfo[i][bPickupEnter]    = -1;
  314.             new INI:File = INI_Open(BizPath(i));
  315.             INI_SetTag(File, "Stats");
  316.             INI_WriteInt(File,"ID",i);
  317.             INI_WriteInt(File,"PickupID",BizInfo[i][bPickupID]);
  318.             INI_WriteInt(File,"PickupEnter",BizInfo[i][bPickupEnter]);
  319.             INI_WriteInt(File,"Type",BizInfo[i][bType]);
  320.             INI_WriteInt(File,"Interior",BizInfo[i][bInterior]);
  321.             INI_WriteInt(File,"Level",BizInfo[i][bLevel]);
  322.             INI_WriteInt(File,"Price",BizInfo[i][bPrice]);
  323.             INI_WriteFloat(File,"X",BizInfo[i][bX]);
  324.             INI_WriteFloat(File,"Y",BizInfo[i][bY]);
  325.             INI_WriteFloat(File,"Z",BizInfo[i][bZ]);
  326.             INI_WriteFloat(File,"eX",BizInfo[i][beX]);
  327.             INI_WriteFloat(File,"eY",BizInfo[i][beY]);
  328.             INI_WriteFloat(File,"eZ",BizInfo[i][beZ]);
  329.             INI_WriteBool(File,"Bought",false);
  330.             INI_WriteString(File,"Owner","None");
  331.             INI_WriteBool(File,"Existing",false);
  332.             INI_WriteInt(File,"Safe",BizInfo[i][bSafe]);
  333.             INI_WriteBool(File,"Open",true);
  334.             INI_WriteInt(File,"EnterPrice",BizInfo[i][bEnterPrice]);
  335.             INI_WriteString(File,"Name","None");
  336.             INI_WriteInt(File,"VirtualWorld",BizInfo[i][bVW]);
  337.             INI_WriteBool(File,"Investor",false);
  338.             INI_Close(File);
  339.             INI_ParseFile(BizPath(i), "LoadBiz_data", .bExtra = true, .extra = i);
  340.             printf("Loading... | Biz %i | Created", i);
  341.         }
  342.         else
  343.         {
  344.             INI_ParseFile(BizPath(i), "LoadBiz_data", .bExtra = true, .extra = i);
  345.             if(!BizInfo[i][bCreated]) continue;
  346.             SetBizInfos(i);
  347.             printf("Loading... | Biz %i | Loaded", i);
  348.             if(BizInfo[i][bEnterPrice] != 0 && !BizInfo[i][bBuy]) BizInfo[i][bEnterPrice] = 0, printf("Loading... | Biz %i | Price enter resetted");
  349.         }
  350.     }
  351.  
  352.     print("Filterscript sucessfuly loaded");
  353.     return 1;
  354. }
  355.  
  356.  
  357. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  358.  
  359. public OnFilterScriptExit()
  360. {
  361.     for (new i; i<MAX_BIZ; i++)
  362.     {
  363.         if(BizInfo[i][bCreated]) printf("Unloading | Biz ID: '%i'", i);
  364.         DestroyPickup(BizInfo[i][bPickupID]);
  365.         DestroyPickup(BizInfo[i][bPickupEnter]);
  366.         Delete3DTextLabel(BizLabelID[i]);
  367.         Delete3DTextLabel(BizLabelEnterID[i]);
  368.         BizInfo[i][bPickupID] = -1;
  369.         BizInfo[i][bPickupEnter] = -1;
  370.         SaveBizData(i);
  371.         SaveInvestorData(i);
  372.     }
  373.     foreach(new i : Player)
  374.     {
  375.         if(LastBizVisited[i] != INVALID_BIZ_ID)
  376.         {
  377.             SetPlayerPos(i, BizInfo[LastBizVisited[i]][bX], BizInfo[LastBizVisited[i]][bY], BizInfo[LastBizVisited[i]][bZ]);
  378.             SetPlayerInterior(i, 0);
  379.             SetPlayerVirtualWorld(i, 0);
  380.             SCM(i, RED, "Error: An administrator has unloaded the filterscript, you have been teleported out of the biz.");
  381.             printf("Unloading ... | Player ID: %i | Teleported out of a biz (ID:%i)", i, LastBizVisited[i]);
  382.         }
  383.     }
  384.     print("Filterscript sucessfuly unloaded");
  385.     return 1;
  386. }
  387.  
  388. #endif
  389.  
  390. public OnObjectMoved(objectid)
  391. {
  392.     return 1;
  393. }
  394.  
  395. public OnPlayerObjectMoved(playerid, objectid)
  396. {
  397.     return 1;
  398. }
  399.  
  400. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  401. {
  402.  
  403.     return 0;
  404. }
  405.  
  406.  
  407. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  408.  
  409. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  410. {
  411.     if(LastBizVisited[playerid] != INVALID_BIZ_ID && newinteriorid == 0)
  412.     {
  413.         SetTimerEx("TeleChecking", 1000, false, "i", playerid);
  414.     }
  415.     return 1;
  416. }
  417.  
  418. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  419.  
  420. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  421. {
  422.     new bizid = GetNearestBiz(playerid);
  423.     if((newkeys == KEY_SECONDARY_ATTACK) && (oldkeys == 0) && IsNearABiz(playerid))
  424.     {
  425.         if(!BizInfo[bizid][bOpen] && strcmp(GetName(playerid), BizInfo[bizid][bOwner]) && BizInfo[bizid][bBuy]) return SCM(playerid, RED, "This biz is closed.");
  426.         if(BizInfo[bizid][bEnterPrice] > GetPlayerMoney(playerid)) return SCM(playerid, RED, "You don't have enough money to enter in this biz.");
  427.        
  428.         EnterInABiz(playerid, bizid);
  429.        
  430.         if(!BizInfo[bizid][bBuy] || GetPlayerBiz(playerid) == bizid || BizInfo[bizid][bEnterPrice] == 0) return 1;
  431.        
  432.         SetMoneyGameText(playerid, true, BizInfo[bizid][bEnterPrice]);
  433.  
  434.         GivePlayerMoney(playerid, -BizInfo[bizid][bEnterPrice]);
  435.         BizInfo[bizid][bSafe] += BizInfo[bizid][bEnterPrice];
  436.     }
  437.        
  438.     if((newkeys == KEY_SECONDARY_ATTACK) && (oldkeys == 0) && LastBizVisited[playerid] != INVALID_BIZ_ID && GetPlayerInterior(playerid) >= 1)
  439.     {
  440.         if(!IsPlayerInRangeOfPoint(playerid, 3, BizInfo[LastBizVisited[playerid]][beX], BizInfo[LastBizVisited[playerid]][beY], BizInfo[LastBizVisited[playerid]][beZ])) return 1;
  441.         ExitABiz(playerid, LastBizVisited[playerid]);
  442.     }
  443.  
  444.     return 1;
  445. }
  446.  
  447.  
  448. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  449. // ===========================================================================================================================================================================================
  450. //                                                                                                  Commands
  451. // ===========================================================================================================================================================================================
  452. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  453.  
  454.  
  455. CMD:createbiz(playerid, params[])
  456. {
  457.     if(!IsPlayerAdmin(playerid)) return 0;
  458.  
  459.     new price,
  460.         level,
  461.         interior,
  462.         Float:x,
  463.         Float:y,
  464.         Float:z,
  465.         str[120],
  466.         pickid;
  467.  
  468.     if(sscanf(params,"iii", interior, level, price))
  469.     {
  470.         new str1[500];
  471.         SCM(playerid, LBLUE, "[USE] /createbiz [type] [level] [price]");
  472.  
  473.         format(str1, sizeof(str1), RED_U"[USE] "LBLUE_U"/createbiz [type] [level] [price]\n\
  474.         "RED_U"type: "LBLUE_U"Which type of buisness it will be\n\
  475.         "RED_U"level: "LBLUE_U"Level (score) required to buy this biz\n\
  476.         "RED_U"price: "LBLUE_U"Money required to buy this biz.\n\n"WHITE_U"Sort of type (biz):");
  477.  
  478.         for(new i=1; i<sizeof(InteriorName); i++)
  479.         {
  480.             format(str, sizeof(str), RED_U"\nType %i : "WHITE_U"%s", i, InteriorName[i][0]);
  481.             strcat(str1, str);
  482.         }
  483.  
  484.  
  485.         Dialog_Show(playerid, createbizhelp, DIALOG_STYLE_MSGBOX, "Help for /createbiz", str1, "Ok", "");
  486.  
  487.         return 1;
  488.     }
  489.  
  490.     if(GetNearestBiz(playerid) != INVALID_BIZ_ID) return SCMF(playerid, RED, "Error: The biz is too close to another. (Nearest Biz -> ID:%i)", GetNearestBiz(playerid));
  491.     if(6 < interior || interior < 1) return SCMF(playerid, RED, "Error: Wrong interior ID (%i). [only 1-6]", interior);
  492.     if(price < 10) return SCMF(playerid, RED, "Error: The price need to be at least 10$.");
  493.     if(level < 1) return SCMF(playerid, RED, "Error: The level need to be at least 1.");
  494.  
  495.     GetPlayerPos(playerid, x, y, z);
  496.     CurrentMaxbizid = GetFreeBizID();
  497.  
  498.     pickid = CreatePickup(ICON_BIZ_PENDING, 1, x, y, z, 0);
  499.     BizVW++;
  500.  
  501.     BizInfo[CurrentMaxbizid][bX]        = x;
  502.     BizInfo[CurrentMaxbizid][bY]        = y;
  503.     BizInfo[CurrentMaxbizid][bZ]        = z;
  504.     BizInfo[CurrentMaxbizid][bCreated]  = true;
  505.     BizInfo[CurrentMaxbizid][bPrice]    = price;
  506.     BizInfo[CurrentMaxbizid][bID]       = CurrentMaxbizid;
  507.     BizInfo[CurrentMaxbizid][bPickupID] = pickid;
  508.     BizInfo[CurrentMaxbizid][bType]     = interior;
  509.     BizInfo[CurrentMaxbizid][bLevel]    = level;
  510.     BizInfo[CurrentMaxbizid][bVW]       = BizVW;
  511.     format(BizInfo[CurrentMaxbizid][bName], MAX_BIZ_NAME, "%s", InteriorName[bType]);
  512.  
  513.     BizCreating[playerid] = CurrentMaxbizid;
  514.  
  515.     SaveBizData(CurrentMaxbizid);
  516.  
  517.     SCMF(playerid, -1, "You have creeated a biz ! Biz ID: "RED_U"%i "WHITE_U"- Price : "RED_U"%i$ "WHITE_U"- Level required"RED_U" %i", CurrentMaxbizid, price, level);
  518.     switch(interior)
  519.     {
  520.         case 1:
  521.         {
  522.             new str1[400];
  523.  
  524.             for(new i; i<sizeof(Int247); i++)
  525.             {
  526.                 format(str, sizeof(str), "\n%i - %s", i+1, Int247[i][Name]);
  527.                 strcat(str1, str);
  528.             }
  529.             format(str, sizeof(str), "Choose an interior for %s", InteriorName[interior]);
  530.             Dialog_Show(playerid, DIALOG_CREATEBIZ, DIALOG_STYLE_LIST, str, str1, "Choose", "Cancel");
  531.         }
  532.  
  533.         case 2:
  534.         {
  535.             new str1[400];
  536.  
  537.             for(new i; i<sizeof(Ammunation); i++)
  538.             {
  539.                 format(str, sizeof(str), "\n%i - %s", i+1, Ammunation[i][Name]);
  540.                 strcat(str1, str);
  541.             }
  542.             format(str, sizeof(str), "Choose an interior for %s", InteriorName[interior]);
  543.             Dialog_Show(playerid, DIALOG_CREATEBIZ, DIALOG_STYLE_LIST, str, str1, "Choose", "Cancel");
  544.         }
  545.        
  546.         case 3:
  547.         {
  548.             new str1[400];
  549.  
  550.             for(new i; i<sizeof(Shop); i++)
  551.             {
  552.                 format(str, sizeof(str), "\n%i - %s", i+1, Shop[i][Name]);
  553.                 strcat(str1, str);
  554.             }
  555.             format(str, sizeof(str), "Choose an interior for %s", InteriorName[interior]);
  556.             Dialog_Show(playerid, DIALOG_CREATEBIZ, DIALOG_STYLE_LIST, str, str1, "Choose", "Cancel");
  557.         }
  558.  
  559.        
  560.         case 4:
  561.         {
  562.             new str1[400];
  563.  
  564.             for(new i; i<sizeof(Clothes); i++)
  565.             {
  566.                 format(str, sizeof(str), "\n%i - %s", i+1, Clothes[i][Name]);
  567.                 strcat(str1, str);
  568.             }
  569.             format(str, sizeof(str), "Choose an interior for %s", InteriorName[interior]);
  570.             Dialog_Show(playerid, DIALOG_CREATEBIZ, DIALOG_STYLE_LIST, str, str1, "Choose", "Cancel");
  571.         }
  572.  
  573.         case 5:
  574.         {
  575.             new str1[400];
  576.  
  577.             for(new i; i<sizeof(Food); i++)
  578.             {
  579.                 format(str, sizeof(str), "\n%i - %s", i+1, Food[i][Name]);
  580.                 strcat(str1, str);
  581.             }
  582.             format(str, sizeof(str), "Choose an interior for %s", InteriorName[interior]);
  583.             Dialog_Show(playerid, DIALOG_CREATEBIZ, DIALOG_STYLE_LIST, str, str1, "Choose", "Cancel");
  584.         }
  585.        
  586.         case 6:
  587.         {
  588.             new str1[400];
  589.  
  590.             for(new i; i<sizeof(Gym); i++)
  591.             {
  592.                 format(str, sizeof(str), "\n%i - %s", i+1, Gym[i][Name]);
  593.                 strcat(str1, str);
  594.             }
  595.             format(str, sizeof(str), "Choose an interior for %s", InteriorName[interior]);
  596.             Dialog_Show(playerid, DIALOG_CREATEBIZ, DIALOG_STYLE_LIST, str, str1, "Choose", "Cancel");
  597.         }
  598.         default:
  599.         {
  600.             Dialog_Show(playerid, ERROR, DIALOG_STYLE_MSGBOX, "Unknown", WHITE_U"An error occured. Take a screenshoot [F8] and inform Dayrion.\nError ID: 01", "Ok", "");
  601.             DestroyPickup(BizInfo[BizCreating[playerid]][bPickupID]);
  602.             DestroyPickup(BizInfo[BizCreating[playerid]][bPickupEnter]);
  603.             Delete3DTextLabel(BizLabelID[BizCreating[playerid]]);
  604.             Delete3DTextLabel(BizLabelEnterID[BizCreating[playerid]]);
  605.             ResetBizData(BizCreating[playerid]);
  606.         }
  607.     }
  608.     return 1;
  609. }
  610.  
  611. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  612.  
  613. CMD:destroybiz(playerid, params[])
  614. {
  615.     if(!IsPlayerAdmin(playerid)) return 0;
  616.  
  617.     new bizid;
  618.     if(sscanf(params, "i", bizid)) return SCM(playerid, LBLUE, "[USE] /destroybiz [bizid] [-1: ALL]");
  619.  
  620.     if(bizid > MAX_BIZ || bizid < -1) return SCM(playerid, RED, "Error: Wrong biz ID.");
  621.  
  622.     if(bizid != -1)
  623.     {
  624.         if(!BizInfo[bizid][bCreated]) return SCM(playerid, RED, "Error: This biz is not created.");
  625.         DestroyPickup(BizInfo[bizid][bPickupID]);
  626.         DestroyPickup(BizInfo[bizid][bPickupEnter]);
  627.         Delete3DTextLabel(BizLabelID[bizid]);
  628.         Delete3DTextLabel(BizLabelEnterID[bizid]);
  629.         foreach(new i : Player)
  630.         {
  631.             if(LastBizVisited[i] == bizid)
  632.             {
  633.                 SetPlayerPos(i, BizInfo[LastBizVisited[i]][bX], BizInfo[LastBizVisited[i]][bY], BizInfo[LastBizVisited[i]][bZ]);
  634.                 SetPlayerInterior(i, 0);
  635.                 SetPlayerVirtualWorld(i, 0);
  636.                 SCM(i, RED, "Error: An administrator has destroyed the biz, you have been teleported out of the biz.");
  637.                 printf("[FS] Admin | Player: %s | Teleported out of a biz (ID:%i)", GetNameEx(i), LastBizVisited[i]);
  638.             }
  639.         }
  640.         ResetBizData(bizid);
  641.         SCMF(playerid, RED, "[Admin] "WHITE_U"You have destroyed the biz ID "RED_U"%i", bizid);
  642.     }
  643.     else
  644.     {
  645.         for(new i; i<MAX_BIZ; i++)
  646.         {
  647.             if(!BizInfo[i][bCreated]) continue;
  648.             DestroyPickup(BizInfo[i][bPickupID]);
  649.             DestroyPickup(BizInfo[i][bPickupEnter]);
  650.             Delete3DTextLabel(BizLabelID[i]);
  651.             Delete3DTextLabel(BizLabelEnterID[i]);
  652.             foreach(new j : Player)
  653.             {
  654.                 if(LastBizVisited[j] == i)
  655.                 {
  656.                     SetPlayerPos(j, BizInfo[LastBizVisited[j]][bX], BizInfo[LastBizVisited[j]][bY], BizInfo[LastBizVisited[j]][bZ]);
  657.                     SetPlayerInterior(j, 0);
  658.                     SetPlayerVirtualWorld(j, 0);
  659.                     SCM(j, RED, "Error: An administrator has destroyed the biz, you have been teleported out of the biz.");
  660.                     printf("[FS] Admin | Player: %s | Teleported out of a biz (ID:%i)", GetNameEx(j), LastBizVisited[j]);
  661.                 }
  662.             }
  663.             ResetBizData(i);
  664.             SCMF(playerid, RED, "[Admin] "WHITE_U"You have destroyed the biz ID "RED_U"%i", i);
  665.         }
  666.     }
  667.     return 1;
  668. }
  669.  
  670. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  671.  
  672. CMD:buybiz(playerid, params[])
  673. {
  674.     if(PlayerHasABiz(playerid)) return SCM(playerid, RED, "You have already a biz.");
  675.  
  676.     new bizid = GetNearestBiz(playerid);
  677.     if(bizid == INVALID_BIZ_ID) return SCM(playerid, RED, "You need to be near the biz to buy it.");
  678.     if(BizInfo[bizid][bBuy]) return SCM(playerid, RED, "This biz have a owner.");
  679.  
  680.     if(GetPlayerMoney(playerid) < BizInfo[bizid][bPrice]) return SCMF(playerid, RED, "Error: "WHITE_U"You need "RED_U"%i"WHITE_U"$ for buy this biz (Missing money: %i$)", BizInfo[bizid][bPrice], BizInfo[bizid][bPrice]-GetPlayerMoney(playerid));
  681.     if(GetPlayerScore(playerid) < BizInfo[bizid][bLevel]) return SCMF(playerid, RED, "Error: "WHITE_U"You need to be at least level "RED_U"%i", BizInfo[bizid][bLevel]);
  682.  
  683.     format(BizInfo[bizid][bOwner], 24, "%s", GetName(playerid));
  684.     format(BizInfo[bizid][bName], MAX_BIZ_NAME, "%s", InteriorName[bType]);
  685.     BizInfo[bizid][bBuy] = true;
  686.  
  687.     DestroyPickup(BizInfo[bizid][bPickupID]);
  688.     DestroyPickup(BizInfo[bizid][bPickupEnter]);
  689.     Delete3DTextLabel(BizLabelID[bizid]);
  690.     Delete3DTextLabel(BizLabelEnterID[bizid]);
  691.     SetBizInfos(bizid);
  692.  
  693.     GivePlayerMoney(playerid, -BizInfo[bizid][bPrice]);
  694.     SCMF(playerid, WHITE, "You have bought this biz! Price : "RED_U"%i$ - "WHITE_U"Type : "RED_U"%s", BizInfo[bizid][bPrice], InteriorName[BizInfo[bizid][bType]]);
  695.     return 1;
  696. }
  697.  
  698. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  699.  
  700. CMD:biz(playerid, params[])
  701. {
  702.     if(!PlayerHasABiz(playerid)) return SCM(playerid, RED, "Error: You have not a biz.");
  703.  
  704.     new bizid = GetPlayerBiz(playerid);
  705.  
  706.     Dialog_Show(playerid, DIALOG_INFO_BIZ, DIALOG_STYLE_TABLIST, "Info", "View informations of your biz\nChange the enter price \t\t%i$\nOpen/Lock your biz\t\t%s\nDeposit money\nWithdraw money\nRename your biz", "Choose", "Cancel", BizInfo[bizid][bEnterPrice], OpenFormatBiz(bizid));
  707.     return 1;
  708. }
  709.  
  710. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  711.  
  712. CMD:closestbiz(playerid)
  713. {
  714.     if(!IsPlayerAdmin(playerid)) return 0;
  715.  
  716.     new a = GetNearestBiz(playerid);
  717.     return a == INVALID_BIZ_ID ? SCM(playerid, RED, "Error: You are not near a biz!") : SCMF(playerid, RED, "[Admin] "WHITE_U"The closest biz is ID %i - Name : '%s'", a, BizInfo[a][bName]);
  718. }
  719.  
  720. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  721.  
  722. CMD:sellbiz(playerid)
  723. {
  724.     if(!PlayerHasABiz(playerid)) return SCM(playerid, RED, "Error: You have not a biz.");
  725.     if(GetNearestBiz(playerid) != GetPlayerBiz(playerid)) return SCM(playerid, RED, "You need to be near your biz to do that.");
  726.  
  727.     new i = GetNearestBiz(playerid);
  728.    
  729.     BizInfo[i][bBuy]    = false;
  730.     format(BizInfo[i][bOwner], 24, "None");
  731.     format(BizInfo[i][bName], MAX_BIZ_NAME, "%s", InteriorName[BizInfo[i][bType]]);
  732.     BizInfo[i][bSafe]   = 0;
  733.     BizInfo[i][bOpen]   = false;
  734.     BizInfo[i][bEnterPrice] = 0;
  735.     GivePlayerMoney(playerid, BizInfo[i][bPrice]/2);
  736.  
  737.     DestroyPickup(BizInfo[i][bPickupID]);
  738.     Delete3DTextLabel(BizLabelID[i]);
  739.     Delete3DTextLabel(BizLabelEnterID[i]);
  740.     SaveBizData(i);
  741.     SetBizInfos(i);
  742.  
  743.     return 1;
  744. }
  745.  
  746. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  747.  
  748. CMD:modifybiz(playerid, params[])
  749. {
  750.     if(!IsPlayerAdmin(playerid)) return 0;
  751.  
  752.     new bizid;
  753.  
  754.     if(sscanf(params, "i", bizid)) return SCM(playerid, LBLUE, "/modifybiz [bizid]");
  755.     if(!BizInfo[bizid][bCreated]) return SCM(playerid, RED, "Error: This biz is not created.");
  756.     BizCreating[playerid] = bizid;
  757.  
  758.     Dialog_Show(playerid, DIALOG_INFO_BIZ_ADMIN, DIALOG_STYLE_TABLIST, "Info biz", "View informations of the biz\nChange the enter price \t%i\nOpen/Lock the biz\t%s\nChange the balance\nRename the biz\nSell the biz", "Choose", "Cancel", bizid, BizInfo[bizid][bEnterPrice], OpenFormatBiz(bizid));
  759.     return 1;
  760. }
  761.  
  762.  
  763.  
  764. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  765.  
  766. CMD:makeinvestor(playerid, params[])
  767. {
  768.     if(!PlayerHasABiz(playerid)) return SCM(playerid, RED, "Error: You don't have a biz!");
  769.  
  770.     new target, bizid = GetPlayerBiz(playerid);
  771.  
  772.     if(sscanf(params, "u", target)) return SCM(playerid, LBLUE, "/makeinvestor [playerid/name] [-1 : Cancel investor]");
  773.     if(!IsPlayerConnected(target) && target != INVALID_PLAYER_ID) return SCM(playerid, RED, "Error: This player isn't connected or be more accurate in the name.");
  774.  
  775.     if(target == playerid) return SCM(playerid, RED, "Error: You can't make yourself as an investor.");
  776.  
  777.     if(target == INVALID_PLAYER_ID)
  778.     {
  779.         if(IsPlayerConnectedByName(GetName(BizInv[bizid][iName])))
  780.             SCMF(GetIDByName(BizInv[bizid][iName]), WHITE, "You are no longer an investor of the "RED_U"%s's"WHITE_U" biz ("RED_U"%s"WHITE_U")", GetName(playerid), BizInfo[bizid][bName]);
  781.  
  782.         SCMF(playerid, RED, "%s "WHITE_U"has been removed of your investor.", GetName(target), BizInfo[bizid][bName]);
  783.  
  784.         ResetInvestorData(bizid);
  785.  
  786.         DestroyPickup(BizInfo[bizid][bPickupID]);
  787.         DestroyPickup(BizInfo[bizid][bPickupEnter]);
  788.         Delete3DTextLabel(BizLabelID[bizid]);
  789.         Delete3DTextLabel(BizLabelEnterID[bizid]);
  790.        
  791.         SetBizInfos(bizid);
  792.         return 1;
  793.     }
  794.  
  795.     if(BizInv[bizid][iInves]) return SCMF(playerid, RED, "Error: You have already an investor : %s", BizInv[bizid][iName]);
  796.  
  797.     format(BizInv[bizid][iName], 24, "%s", GetName(target));
  798.     BizInv[bizid][iInves]   = true;
  799.     BizInv[bizid][iSafe]    = true;
  800.  
  801.     SCMF(playerid, RED, "%s "WHITE_U"is now the new investor in your biz ("RED_U"%s"WHITE_U")", GetName(target), BizInfo[bizid][bName]);
  802.     SCMF(target, RED, "%s "WHITE_U"made you the new investor in his/her biz ("RED_U"%s"WHITE_U")", GetName(target), BizInfo[bizid][bName]);
  803.  
  804.     DestroyPickup(BizInfo[bizid][bPickupID]);
  805.     DestroyPickup(BizInfo[bizid][bPickupEnter]);
  806.     Delete3DTextLabel(BizLabelID[bizid]);
  807.     Delete3DTextLabel(BizLabelEnterID[bizid]);
  808.    
  809.     SetBizInfos(bizid);
  810.     return 1;
  811. }
  812.  
  813. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  814.  
  815. CMD:modifinvestor(playerid)
  816. {
  817.     if(!PlayerHasABiz(playerid)) return SCM(playerid, RED, "Error: You don't have a biz!");
  818.  
  819.     if(!BizInv[GetPlayerBiz(playerid)][iInves]) return SCM(playerid, RED, "Error: You don't have investor.");
  820.  
  821.     ShowDialogInvPerm(playerid, GetPlayerBiz(playerid));
  822.  
  823.     return 1;
  824.  
  825. }
  826.  
  827. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  828.  
  829. CMD:amodifinvestor(playerid, params[])
  830. {
  831.     if(!IsPlayerAdmin(playerid)) return 0;
  832.  
  833.     new bizid;
  834.     if(sscanf(params, "i", bizid)) return SCM(playerid, LBLUE, "[USE] /amodifinvestor [bizid]");
  835.  
  836.     if(!BizInv[bizid][iInves]) return SCM(playerid, RED, "Error: This biz doesn't have an investor.");
  837.  
  838.     ShowDialogInvPerm(playerid, bizid);
  839.  
  840.     return 1;
  841.  
  842. }
  843.  
  844. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  845.  
  846. CMD:ibiz(playerid)
  847. {
  848.     new bizid = GetInvestorBizID(playerid);
  849.     if(bizid == INVALID_BIZ_ID) return SCM(playerid, RED, "Error: You are not an investor of a biz.");
  850.  
  851.     ShowDialogInvestor(playerid, bizid);
  852.  
  853.     return 1;
  854. }
  855.  
  856. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  857. // ===========================================================================================================================================================================================
  858. //                                                                                                  Dialogs
  859. // ===========================================================================================================================================================================================
  860. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  861.  
  862. DIALOG(DIALOG_INVESTOR)
  863. {
  864.     if(!response) return 1;
  865.  
  866.     new bizid = GetInvestorBizID(playerid);
  867.     if(bizid == INVALID_BIZ_ID) return Dialog_Show(playerid, ERROR, DIALOG_STYLE_MSGBOX, "Unknown", WHITE_U"An error occured. Take a screenshoot [F8] and inform Dayrion.\nError ID: 09", "Ok", "");
  868.  
  869.     switch(listitem)
  870.     {
  871.         case 0:
  872.         {
  873.             if(!BizInv[bizid][iSafe]) return ShowDialogInvestor(playerid, bizid), SCM(playerid, RED, "Error: You are not allowed to do that.");
  874.  
  875.             new str[250];
  876.             format(str, sizeof(str),
  877.             RED_U"- Biz ID: "WHITE_U"%i\n\
  878.             "RED_U"- Owner : "WHITE_U"%s\n\
  879.             "RED_U"- Door : "WHITE_U"%s\n\
  880.             "RED_U"- Resale price : "WHITE_U"%i$\n\
  881.             "RED_U"- Safe : "WHITE_U"%i$\n\
  882.             "RED_U"- Investor : "WHITE_U"%s", BizInfo[bizid][bID], BizInfo[bizid][bOwner], OpenFormatBiz(bizid), floatround(BizInfo[bizid][bPrice]/2, floatround_round), BizInfo[bizid][bSafe], BizInv[bizid][iName]);
  883.             BizCreating[playerid] = bizid;
  884.             Dialog_Show(playerid, DIALOG_INFO, DIALOG_STYLE_MSGBOX, "Info biz", str, "Ok", "Back");
  885.         }
  886.  
  887.         case 2:
  888.         {
  889.             if(!BizInv[bizid][iEnterPrice]) return ShowDialogInvestor(playerid, bizid), SCM(playerid, RED, "Error: You are not allowed to do that.");
  890.  
  891.             BizCreating[playerid] = bizid;
  892.             Dialog_Show(playerid, DIALOG_PRICECHANGER, DIALOG_STYLE_INPUT, "Change the price enter", "Change the enter price", "Confirm", "Cancel");
  893.         }
  894.  
  895.         case 1:
  896.         {
  897.             if(!BizInv[bizid][iLock]) return ShowDialogInvestor(playerid, bizid), SCM(playerid, RED, "Error: You are not allowed to do that.");
  898.  
  899.             if(GetNearestBiz(playerid) != bizid && LastBizVisited[playerid] != bizid) return SCM(playerid, RED, "Error: You are too far away from the biz.");
  900.             if(BizInfo[bizid][bOpen])
  901.             {
  902.                 BizInfo[bizid][bOpen] = false;
  903.                 DestroyPickup(BizInfo[bizid][bPickupID]);
  904.                 SCM(playerid, RED, "You have locked the biz.");
  905.                 BizInfo[bizid][bPickupID] = CreatePickup(ICON_BIZ_LOCKED, 1, BizInfo[bizid][bX], BizInfo[bizid][bY], BizInfo[bizid][bZ], 0);
  906.             }
  907.             else
  908.             {
  909.                 BizInfo[bizid][bOpen] = true;
  910.                 DestroyPickup(BizInfo[bizid][bPickupID]);
  911.                 SCM(playerid, GREEN, "You have opened the biz.");
  912.                 BizInfo[bizid][bPickupID] = CreatePickup(ICON_BIZ_OPEN, 1, BizInfo[bizid][bX], BizInfo[bizid][bY], BizInfo[bizid][bZ], 0);
  913.             }      
  914.         }
  915.  
  916.         case 4:
  917.         {
  918.             if(!BizInv[bizid][iDeposit]) return ShowDialogInvestor(playerid, bizid), SCM(playerid, RED, "Error: You are not allowed to do that.");
  919.  
  920.             if(LastBizVisited[playerid] != bizid) return SCM(playerid, RED, "Error: You need to be inside in the biz to do that.");
  921.             BizCreating[playerid] = bizid;
  922.             Dialog_Show(playerid, DIALOG_DEPOSIT, DIALOG_STYLE_INPUT, "Deposit money", "Set the amount of money to deposit it.", "Confirm", "Cancel");
  923.         }
  924.  
  925.         case 5:
  926.         {
  927.             if(!BizInv[bizid][iWithdraw]) return ShowDialogInvestor(playerid, bizid), SCM(playerid, RED, "Error: You are not allowed to do that.");
  928.  
  929.             if(LastBizVisited[playerid] != bizid) return SCM(playerid, RED, "Error: You need to be inside in the biz to do that.");
  930.             BizCreating[playerid] = bizid;
  931.             Dialog_Show(playerid, DIALOG_WITHDRAW, DIALOG_STYLE_INPUT, "Withdraw money", "Set the amount of money to withdraw it.", "Confirm", "Cancel");
  932.         }
  933.  
  934.         case 3:
  935.         {
  936.             if(!BizInv[bizid][iRename]) return ShowDialogInvestor(playerid, bizid), SCM(playerid, RED, "Error: You are not allowed to do that.");
  937.  
  938.             if(LastBizVisited[playerid] != bizid && GetNearestBiz(playerid) != bizid) return SCM(playerid, RED, "Error: You have to far away from the biz.");
  939.             BizCreating[playerid] = bizid;
  940.             Dialog_Show(playerid, DIALOG_NAME, DIALOG_STYLE_INPUT, "Name your biz", "Enter a name for your biz.", "Confirm", "Cancel");
  941.         }
  942.         default : Dialog_Show(playerid, ERROR, DIALOG_STYLE_MSGBOX, "Unknown", WHITE_U"An error occured. Take a screenshoot [F8] and inform Dayrion.\nError ID: 10", "Ok", "");
  943.     }
  944.  
  945.     return 1;
  946.  
  947. }
  948.  
  949. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  950.  
  951. DIALOG(DIALOG_MODIFY_INVESTOR)
  952. {
  953.     if(!response) return 1;
  954.  
  955.     new bizid = BizCreating[playerid];
  956.  
  957.     if(BizCreating[playerid] == -1) return Dialog_Show(playerid, ERROR, DIALOG_STYLE_MSGBOX, "Unknown", WHITE_U"An error occured. Take a screenshoot [F8] and inform Dayrion.\nError ID: 08", "Ok", "");
  958.  
  959.     switch(listitem)
  960.     {
  961.         case 0:
  962.         {
  963.             if(!BizInv[bizid][iSafe])
  964.             {
  965.                 BizInv[bizid][iSafe] = true;
  966.                 SCMF(playerid, GREEN, "%s can now access to the biz's informations.", BizInv[bizid][iName]);
  967.                 ShowDialogInvPerm(playerid, bizid);
  968.             }
  969.             else
  970.             {
  971.                 BizInv[bizid][iSafe] = false;
  972.                 SCMF(playerid, RED, "%s can not anymore access to the biz's informations.", BizInv[bizid][iName]);
  973.                 ShowDialogInvPerm(playerid, bizid);
  974.  
  975.             }
  976.         }
  977.  
  978.         case 1:
  979.         {
  980.             if(!BizInv[bizid][iLock])
  981.             {
  982.                 BizInv[bizid][iLock] = true;
  983.                 SCMF(playerid, GREEN, "%s can lock your biz.", BizInv[bizid][iName]);
  984.                 ShowDialogInvPerm(playerid, bizid);
  985.             }
  986.             else
  987.             {
  988.                 BizInv[bizid][iLock] = false;
  989.                 SCMF(playerid, RED, "%s can not lock your biz.", BizInv[bizid][iName]);
  990.                 ShowDialogInvPerm(playerid, bizid);
  991.  
  992.             }
  993.         }
  994.        
  995.         case 2:
  996.         {
  997.             if(!BizInv[bizid][iEnterPrice])
  998.             {
  999.                 BizInv[bizid][iEnterPrice] = true;
  1000.                 SCMF(playerid, GREEN, "%s can modify the enter price of your biz.", BizInv[bizid][iName]);
  1001.                 ShowDialogInvPerm(playerid, bizid);
  1002.             }
  1003.             else
  1004.             {
  1005.                 BizInv[bizid][iEnterPrice] = false;
  1006.                 SCMF(playerid, RED, "%s can not anymore modify the enter price of your biz.", BizInv[bizid][iName]);
  1007.                 ShowDialogInvPerm(playerid, bizid);
  1008.  
  1009.             }
  1010.         }
  1011.        
  1012.         case 3:
  1013.         {
  1014.             if(!BizInv[bizid][iRename])
  1015.             {
  1016.                 BizInv[bizid][iRename] = true;
  1017.                 SCMF(playerid, GREEN, "%s can now rename your biz.", BizInv[bizid][iName]);
  1018.                 ShowDialogInvPerm(playerid, bizid);
  1019.             }
  1020.             else
  1021.             {
  1022.                 BizInv[bizid][iRename] = false;
  1023.                 SCMF(playerid, RED, "%s can not anymore rename your biz.", BizInv[bizid][iName]);
  1024.                 ShowDialogInvPerm(playerid, bizid);
  1025.  
  1026.             }
  1027.         }
  1028.  
  1029.         case 4:
  1030.         {
  1031.             if(!BizInv[bizid][iDeposit])
  1032.             {
  1033.                 BizInv[bizid][iDeposit] = true;
  1034.                 SCMF(playerid, GREEN, "%s can deposit in your biz.", BizInv[bizid][iName]);
  1035.                 ShowDialogInvPerm(playerid, bizid);
  1036.             }
  1037.             else
  1038.             {
  1039.                 BizInv[bizid][iDeposit] = false;
  1040.                 SCMF(playerid, RED, "%s can not anymore deposit in your biz.", BizInv[bizid][iName]);
  1041.                 ShowDialogInvPerm(playerid, bizid);
  1042.  
  1043.             }
  1044.         }
  1045.  
  1046.         case 5:
  1047.         {
  1048.             if(!BizInv[bizid][iWithdraw])
  1049.             {
  1050.                 BizInv[bizid][iWithdraw] = true;
  1051.                 SCMF(playerid, GREEN, "%s can withdraw in your biz.", BizInv[bizid][iName]);
  1052.                 ShowDialogInvPerm(playerid, bizid);
  1053.             }
  1054.             else
  1055.             {
  1056.                 BizInv[bizid][iWithdraw] = false;
  1057.                 SCMF(playerid, RED, "%s can not anymore withdraw in your biz.", BizInv[bizid][iName]);
  1058.                 ShowDialogInvPerm(playerid, bizid);
  1059.  
  1060.             }
  1061.         }
  1062.         default : return Dialog_Show(playerid, ERROR, DIALOG_STYLE_MSGBOX, "Unknown", WHITE_U"An error occured. Take a screenshoot [F8] and inform Dayrion.\nError ID: 07", "Ok", "");
  1063.     }
  1064.     return 1;
  1065.  
  1066. }
  1067.  
  1068. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1069.  
  1070. DIALOG(DIALOG_CREATEBIZ)
  1071. {
  1072.     if(response)
  1073.     {
  1074.         BizInfo[BizCreating[playerid]][bInterior] = listitem;
  1075.  
  1076.         new IntA = BizInfo[BizCreating[playerid]][bInterior];
  1077.  
  1078.         switch(BizInfo[BizCreating[playerid]][bType])
  1079.         {
  1080.             case 1:
  1081.             {
  1082.                 BizInfo[BizCreating[playerid]][beX] = Int247[IntA][X];
  1083.                 BizInfo[BizCreating[playerid]][beY] = Int247[IntA][Y];
  1084.                 BizInfo[BizCreating[playerid]][beZ] = Int247[IntA][Z];
  1085.             }
  1086.             case 2:
  1087.             {
  1088.                 BizInfo[BizCreating[playerid]][beX] = Ammunation[IntA][X];
  1089.                 BizInfo[BizCreating[playerid]][beY] = Ammunation[IntA][Y];
  1090.                 BizInfo[BizCreating[playerid]][beZ] = Ammunation[IntA][Z];
  1091.             }
  1092.             case 3:
  1093.             {
  1094.                 BizInfo[BizCreating[playerid]][beX] = Shop[IntA][X];
  1095.                 BizInfo[BizCreating[playerid]][beY] = Shop[IntA][Y];
  1096.                 BizInfo[BizCreating[playerid]][beZ] = Shop[IntA][Z];
  1097.             }
  1098.             case 4:
  1099.             {
  1100.                 BizInfo[BizCreating[playerid]][beX] = Clothes[IntA][X];
  1101.                 BizInfo[BizCreating[playerid]][beY] = Clothes[IntA][Y];
  1102.                 BizInfo[BizCreating[playerid]][beZ] = Clothes[IntA][Z];
  1103.             }
  1104.             case 5:
  1105.             {
  1106.                 BizInfo[BizCreating[playerid]][beX] = Food[IntA][X];
  1107.                 BizInfo[BizCreating[playerid]][beY] = Food[IntA][Y];
  1108.                 BizInfo[BizCreating[playerid]][beZ] = Food[IntA][Z];
  1109.             }
  1110.             case 6:
  1111.             {
  1112.                 BizInfo[BizCreating[playerid]][beX] = Gym[IntA][X];
  1113.                 BizInfo[BizCreating[playerid]][beY] = Gym[IntA][Y];
  1114.                 BizInfo[BizCreating[playerid]][beZ] = Gym[IntA][Z];
  1115.             }
  1116.             default : printf("ERROR | Biz ID %i - (BizInfo[bizid][bType]) : %i | Cannot create enter pickup.", BizCreating[playerid], BizInfo[IntA][bType]);
  1117.         }
  1118.         DestroyPickup(BizInfo[BizCreating[playerid]][bPickupID]);
  1119.         SetBizInfos(BizCreating[playerid]);
  1120.         SaveBizData(BizCreating[playerid]);
  1121.         EnterInABiz(playerid, BizCreating[playerid]);
  1122.  
  1123.         BizCreating[playerid] = -1;
  1124.     }
  1125.     else
  1126.     {
  1127.         DestroyPickup(BizInfo[BizCreating[playerid]][bPickupID]);
  1128.         Delete3DTextLabel(BizLabelID[BizCreating[playerid]]);
  1129.         Delete3DTextLabel(BizLabelEnterID[BizCreating[playerid]]);
  1130.         ResetBizData(BizCreating[playerid]);
  1131.  
  1132.         BizCreating[playerid] = -1;
  1133.     }
  1134.     return 1;
  1135. }
  1136.  
  1137. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1138.  
  1139. DIALOG(DIALOG_INFO_BIZ)
  1140. {
  1141.     if(response)
  1142.     {
  1143.         new bizid = GetPlayerBiz(playerid);
  1144.         if(bizid == INVALID_BIZ_ID) return Dialog_Show(playerid, ERROR, DIALOG_STYLE_MSGBOX, "Unknown", WHITE_U"An error occured. Take a screenshoot [F8] and inform Dayrion.\nError ID: 03", "Ok", "");
  1145.         switch(listitem)
  1146.         {
  1147.             case 0:
  1148.             {
  1149.                 new str[200];
  1150.                 format(str, sizeof(str),
  1151.                 RED_U"- Biz ID: "WHITE_U"%i\n\
  1152.                 "RED_U"- Owner : "WHITE_U"%s\n\
  1153.                 "RED_U"- Door : "WHITE_U"%s\n\
  1154.                 "RED_U"- Resale price : "WHITE_U"%i$\n\
  1155.                 "RED_U"- Safe : "WHITE_U"%i$", BizInfo[bizid][bID], BizInfo[bizid][bOwner], OpenFormatBiz(bizid), floatround(BizInfo[bizid][bPrice]/2, floatround_round), BizInfo[bizid][bSafe]);
  1156.                 BizCreating[playerid] = bizid;
  1157.                 Dialog_Show(playerid, DIALOG_INFO, DIALOG_STYLE_MSGBOX, "Info biz", str, "Ok", "Back");
  1158.             }
  1159.  
  1160.             case 1:
  1161.             {
  1162.                 BizCreating[playerid] = bizid;
  1163.                 Dialog_Show(playerid, DIALOG_PRICECHANGER, DIALOG_STYLE_INPUT, "Change the price enter", "Change the enter price", "Confirm", "Cancel");
  1164.             }
  1165.  
  1166.             case 2:
  1167.             {
  1168.                 if(GetNearestBiz(playerid) != GetPlayerBiz(playerid) && LastBizVisited[playerid] != GetPlayerBiz(playerid)) return SCM(playerid, RED, "Error: You are too far away from your biz.");
  1169.                 if(BizInfo[bizid][bOpen])
  1170.                 {
  1171.                     BizInfo[bizid][bOpen] = false;
  1172.                     DestroyPickup(BizInfo[bizid][bPickupID]);
  1173.                     SCM(playerid, RED, "You have locked your biz.");
  1174.                     BizInfo[bizid][bPickupID] = CreatePickup(ICON_BIZ_LOCKED, 1, BizInfo[bizid][bX], BizInfo[bizid][bY], BizInfo[bizid][bZ], 0);
  1175.                 }
  1176.                 else
  1177.                 {
  1178.                     BizInfo[bizid][bOpen] = true;
  1179.                     DestroyPickup(BizInfo[bizid][bPickupID]);
  1180.                     SCM(playerid, GREEN, "You have opened your biz.");
  1181.                     BizInfo[bizid][bPickupID] = CreatePickup(ICON_BIZ_OPEN, 1, BizInfo[bizid][bX], BizInfo[bizid][bY], BizInfo[bizid][bZ], 0);
  1182.                 }      
  1183.             }
  1184.  
  1185.             case 3:
  1186.             {
  1187.                 if(LastBizVisited[playerid] != GetPlayerBiz(playerid)) return SCM(playerid, RED, "Error: You need to be inside your biz to do that.");
  1188.                 BizCreating[playerid] = bizid;
  1189.                 Dialog_Show(playerid, DIALOG_DEPOSIT, DIALOG_STYLE_INPUT, "Deposit money", "Set the amount of money to deposit it.", "Confirm", "Cancel");
  1190.             }
  1191.  
  1192.             case 4:
  1193.             {
  1194.                 if(LastBizVisited[playerid] != GetPlayerBiz(playerid)) return SCM(playerid, RED, "Error: You need to be inside your biz to do that.");
  1195.                 BizCreating[playerid] = bizid;
  1196.                 Dialog_Show(playerid, DIALOG_WITHDRAW, DIALOG_STYLE_INPUT, "Withdraw money", "Set the amount of money to withdraw it.", "Confirm", "Cancel");
  1197.             }
  1198.  
  1199.             case 5:
  1200.             {
  1201.                 if(LastBizVisited[playerid] != GetPlayerBiz(playerid) && GetNearestBiz(playerid) != GetPlayerBiz(playerid)) return SCM(playerid, RED, "Error: You have to far away from your biz.");
  1202.                 BizCreating[playerid] = bizid;
  1203.                 Dialog_Show(playerid, DIALOG_NAME, DIALOG_STYLE_INPUT, "Name your biz", "Enter a name for your biz.", "Confirm", "Cancel");
  1204.             }
  1205.             default : Dialog_Show(playerid, ERROR, DIALOG_STYLE_MSGBOX, "Unknown", WHITE_U"An error occured. Take a screenshoot [F8] and inform Dayrion.\nError ID: 04", "Ok", "");
  1206.         }
  1207.     }
  1208.     return 1;
  1209. }
  1210.  
  1211. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1212.  
  1213. DIALOG(DIALOG_INFO)
  1214. {
  1215.     if(response)
  1216.     {
  1217.         BizCreating[playerid] = -1;
  1218.     }
  1219.     else
  1220.     {
  1221.         if(!strcmp(BizInv[BizCreating[playerid]][iName], GetName(playerid)) && BizCreating[playerid] != -1) cmd_ibiz(playerid);
  1222.         else cmd_biz(playerid,"");
  1223.     }
  1224.     return 1;
  1225. }
  1226.  
  1227. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1228.  
  1229. DIALOG(DIALOG_PRICECHANGER)
  1230. {
  1231.     if(response)
  1232.     {
  1233.         if(strval(inputtext) == 0) return Dialog_Show(playerid, DIALOG_PRICECHANGER, DIALOG_STYLE_INPUT, "Change the price enter", "Change the enter price\n"RED_U"Please use only numeric values.", "Confirm", "Cancel");
  1234.         if(!BizInfo[BizCreating[playerid]][bBuy]) return SCM(playerid, RED, "Error: Nobody have buy this biz, you can't change this price changer.");
  1235.         if(strval(inputtext) > 50000000 || strval(inputtext) < 0) return Dialog_Show(playerid, DIALOG_PRICECHANGER, DIALOG_STYLE_INPUT, "Change the price enter", "Change the enter price\n"RED_U"The value should be between 0 & 50000000", "Confirm", "Cancel");
  1236.  
  1237.         SCMF(playerid, X11_NAVAJO_WHITE_2, "You have changed the enter price : %i$ -> %i$", BizInfo[BizCreating[playerid]][bEnterPrice], strval(inputtext));
  1238.         BizInfo[BizCreating[playerid]][bEnterPrice] = strval(inputtext);
  1239.  
  1240.         Delete3DTextLabel(BizLabelID[BizCreating[playerid]]);
  1241.         DestroyPickup(BizInfo[BizCreating[playerid]][bPickupID]);
  1242.         DestroyPickup(BizInfo[BizCreating[playerid]][bPickupEnter]);
  1243.         Delete3DTextLabel(BizLabelEnterID[BizCreating[playerid]]);
  1244.         SetBizInfos(BizCreating[playerid]);
  1245.         BizCreating[playerid] = -1;
  1246.     }
  1247.     return 1;
  1248. }
  1249.  
  1250. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1251.  
  1252. DIALOG(DIALOG_DEPOSIT)
  1253. {
  1254.     if(response)
  1255.     {
  1256.         if(strval(inputtext) == 0) return Dialog_Show(playerid, DIALOG_DEPOSIT, DIALOG_STYLE_INPUT, "Deposit money", "Set the amount of money to deposit it.\n"RED_U"Please use only numeric values.", "Confirm", "Cancel");
  1257.         if(strval(inputtext) > GetPlayerMoney(playerid)) return Dialog_Show(playerid, DIALOG_DEPOSIT, DIALOG_STYLE_INPUT, "Deposit money", "Set the amount of money to deposit it.\n"RED_U"You don't have this amount of money.", "Confirm", "Cancel");
  1258.         if(strval(inputtext) < 0) return Dialog_Show(playerid, DIALOG_DEPOSIT, DIALOG_STYLE_INPUT, "Deposit money", "Set the amount of money to deposit it.\n"RED_U"Please use only positive values.", "Confirm", "Cancel");
  1259.         if(strval(inputtext) + BizInfo[BizCreating[playerid]][bSafe] > MAX_BALANCE) return Dialog_Show(playerid, DIALOG_DEPOSIT, DIALOG_STYLE_INPUT, "Deposit money", "Set the amount of money to deposit it.\n"RED_U"This amount exceed the limit.", "Confirm", "Cancel");
  1260.  
  1261.         BizInfo[BizCreating[playerid]][bSafe] += strval(inputtext);
  1262.         SCMF(playerid, X11_CORNSILK_2, "You deposit %i$. (Balance : %i$)", strval(inputtext), BizInfo[BizCreating[playerid]][bSafe]);
  1263.         GivePlayerMoney(playerid, -strval(inputtext));
  1264.         BizCreating[playerid] = -1;
  1265.  
  1266.         if(BizInv[BizCreating[playerid]][iInves])
  1267.         {
  1268.             if(!IsPlayerConnectedByName(BizInv[BizCreating[playerid]][iName]) || !IsPlayerConnectedByName(BizInfo[BizCreating[playerid]][bOwner]))
  1269.             {
  1270.                 BizCreating[playerid] = -1;
  1271.                 return 1;
  1272.             }
  1273.             else
  1274.             {
  1275.                 GivePlayerMoney(GetIDByName(BizInv[BizCreating[playerid]][iName]), floatround(strval(inputtext)*0.1));
  1276.                 if(IsPlayerConnectedByName(BizInfo[BizCreating[playerid]][bOwner])) SCMF(GetIDByName(BizInfo[BizCreating[playerid]][bOwner]), RED, "%s won %i$.", BizInv[BizCreating[playerid]][iName], floatround(strval(inputtext)*0.1), strval(inputtext));
  1277.  
  1278.                 SetMoneyGameText(playerid, false, strval(inputtext));
  1279.                 BizCreating[playerid] = -1;
  1280.                 return 1;
  1281.             }
  1282.         }
  1283.     }
  1284.     return 1;
  1285. }
  1286.  
  1287. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1288.  
  1289. DIALOG(DIALOG_WITHDRAW)
  1290. {
  1291.     if(response)
  1292.     {
  1293.         if(strval(inputtext) == 0) return Dialog_Show(playerid, DIALOG_WITHDRAW, DIALOG_STYLE_INPUT, "Deposit money", "Set the amount of money to withdraw it.\n"RED_U"Please use only numeric values.", "Confirm", "Cancel");
  1294.         if(strval(inputtext) > BizInfo[BizCreating[playerid]][bSafe]) return Dialog_Show(playerid, DIALOG_WITHDRAW, DIALOG_STYLE_INPUT, "Deposit money", "Set the amount of money to withdraw it.\n"RED_U"You don't have this amount of money in your biz.", "Confirm", "Cancel");
  1295.         if(strval(inputtext) < 0) return Dialog_Show(playerid, DIALOG_WITHDRAW, DIALOG_STYLE_INPUT, "Deposit money", "Set the amount of money to withdraw it.\n"RED_U"Please use only positive values.", "Confirm", "Cancel");
  1296.         if(BizInfo[BizCreating[playerid]][bSafe] - strval(inputtext) < 0) return Dialog_Show(playerid, DIALOG_WITHDRAW, DIALOG_STYLE_INPUT, "Deposit money", "Set the amount of money to withdraw it.\n"RED_U"You don't have this money on your biz.", "Confirm", "Cancel");
  1297.  
  1298.         BizInfo[BizCreating[playerid]][bSafe] -= strval(inputtext);
  1299.         SetMoneyGameText(playerid, false, strval(inputtext));
  1300.         SCMF(playerid, X11_CORNSILK_2, "You withdraw %i$. (Balance : %i$)", strval(inputtext), BizInfo[BizCreating[playerid]][bSafe]);
  1301.         GivePlayerMoney(playerid, strval(inputtext));
  1302.         BizCreating[playerid] = -1;
  1303.     }
  1304.     return 1;
  1305. }
  1306.  
  1307. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1308.  
  1309. DIALOG(DIALOG_NAME)
  1310. {
  1311.     if(response)
  1312.     {
  1313.         if(strlen(inputtext) > MAX_BIZ_NAME && IsPlayerAdmin(playerid)) return Dialog_Show(playerid, DIALOG_NAME, DIALOG_STYLE_INPUT, "Name your biz", "Enter a name for the biz ID:%i (Actually: '%s').\n"RED_U"The name is too long.", "Confirm", "Cancel", BizCreating[playerid], BizInfo[BizCreating[playerid]][bName]);
  1314.             else if(strlen(inputtext) > MAX_BIZ_NAME && !IsPlayerAdmin(playerid)) return Dialog_Show(playerid, DIALOG_NAME, DIALOG_STYLE_INPUT, "Name your biz", "Enter a name for your biz.\n"RED_U"The name is too long.", "Confirm", "Cancel");
  1315.         SCMF(playerid, X11_PEACH_PUFF_2, "You renamed your biz : '%s' -> '%s'", BizInfo[BizCreating[playerid]][bName], inputtext);
  1316.         format(BizInfo[BizCreating[playerid]][bName], MAX_BIZ_NAME, inputtext);
  1317.         Delete3DTextLabel(BizLabelID[BizCreating[playerid]]);
  1318.         Delete3DTextLabel(BizLabelEnterID[BizCreating[playerid]]);
  1319.         DestroyPickup(BizInfo[BizCreating[playerid]][bPickupID]);
  1320.         DestroyPickup(BizInfo[BizCreating[playerid]][bPickupEnter]);
  1321.         SetBizInfos(BizCreating[playerid]);
  1322.         BizCreating[playerid] = -1;
  1323.     }
  1324.     return 1;
  1325. }
  1326.  
  1327. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1328.  
  1329. DIALOG(DIALOG_INFO_BIZ_ADMIN)
  1330. {
  1331.     if(!IsPlayerAdmin(playerid)) return Dialog_Show(playerid, ERROR, DIALOG_STYLE_MSGBOX, "Unknown", WHITE_U"An error occured. Take a screenshoot [F8] and inform Dayrion.\nError ID: 05", "Ok", "");
  1332.     new bizid = BizCreating[playerid];
  1333.     if(response)
  1334.     {
  1335.         switch(listitem)
  1336.         {
  1337.             case 0:
  1338.             {
  1339.                 new str[200];
  1340.                 format(str, sizeof(str),
  1341.                 RED_U"- Biz ID: "WHITE_U"%i\n\
  1342.                 "RED_U"- Owner : "WHITE_U"%s\n\
  1343.                 "RED_U"- Door : "WHITE_U"%s\n\
  1344.                 "RED_U"- Resale price : "WHITE_U"%i$\n\
  1345.                 "RED_U"- Safe : "WHITE_U"%i$\n\
  1346.                 "RED_U"- Name : "WHITE_U"%s", BizInfo[bizid][bID], BizInfo[bizid][bOwner], OpenFormatBiz(bizid), floatround(BizInfo[bizid][bPrice]/2, floatround_round), BizInfo[bizid][bSafe], BizInfo[bizid][bName]);
  1347.                 Dialog_Show(playerid, DIALOG_INFO, DIALOG_STYLE_MSGBOX, "Info biz", str, "Ok", "Back");
  1348.             }
  1349.  
  1350.             case 1:
  1351.             {
  1352.                 Dialog_Show(playerid, DIALOG_PRICECHANGER, DIALOG_STYLE_INPUT, "Change the price enter", "Change the enter price.\nActually : %i$", "Confirm", "Cancel", BizInfo[bizid][bEnterPrice]);
  1353.             }
  1354.  
  1355.             case 2:
  1356.             {
  1357.                 if(BizInfo[bizid][bOpen])
  1358.                 {
  1359.                     BizInfo[bizid][bOpen] = false;
  1360.                     DestroyPickup(BizInfo[bizid][bPickupID]);
  1361.                     SCM(playerid, RED, "You have closed this biz.");
  1362.                     BizInfo[bizid][bPickupID] = CreatePickup(ICON_BIZ_LOCKED, 1, BizInfo[bizid][bX], BizInfo[bizid][bY], BizInfo[bizid][bZ], 0);
  1363.                 }
  1364.                 else
  1365.                 {
  1366.                     BizInfo[bizid][bOpen] = true;
  1367.                     DestroyPickup(BizInfo[bizid][bPickupID]);
  1368.                     SCM(playerid, GREEN, "You have opened this biz.");
  1369.                     BizInfo[bizid][bPickupID] = CreatePickup(ICON_BIZ_OPEN, 1, BizInfo[bizid][bX], BizInfo[bizid][bY], BizInfo[bizid][bZ], 0);
  1370.                 }      
  1371.             }
  1372.  
  1373.             case 3:
  1374.             {
  1375.                 Dialog_Show(playerid, DIALOG_BALANCE, DIALOG_STYLE_INPUT, "Modify balance", "Modify the current balance.\nActually : %i$", "Confirm", "Cancel", BizInfo[bizid][bEnterPrice]);
  1376.             }
  1377.  
  1378.             case 4:
  1379.             {
  1380.                 Dialog_Show(playerid, DIALOG_NAME, DIALOG_STYLE_INPUT, "Name your biz", "Enter a name for the biz ID:%i (Actually : '%s')", "Confirm", "Cancel", bizid, BizInfo[bizid][bName]);
  1381.             }
  1382.  
  1383.             case 5:
  1384.             {
  1385.                 if(!BizInfo[bizid][bBuy]) return SCM(playerid, RED, "Error: This biz is free and can't be sell right now.");
  1386.                 BizInfo[bizid][bBuy] = false;
  1387.                 format(BizInfo[bizid][bOwner], 24, "None");
  1388.                 format(BizInfo[bizid][bName], MAX_BIZ_NAME, "None");
  1389.                 BizInfo[bizid][bSafe] = 0;
  1390.                 GivePlayerMoney(playerid, BizInfo[bizid][bPrice]/2);
  1391.  
  1392.                 DestroyPickup(BizInfo[bizid][bPickupID]);
  1393.                 DestroyPickup(BizInfo[bizid][bPickupEnter]);
  1394.                 Delete3DTextLabel(BizLabelID[bizid]);
  1395.                 Delete3DTextLabel(BizLabelEnterID[bizid]);
  1396.  
  1397.                 SaveBizData(bizid);
  1398.                 SetBizInfos(bizid);
  1399.  
  1400.                 SCMF(playerid, RED, "[Admin]"WHITE_U" You have corretly sold biz ID:"RED_U"%i", bizid);
  1401.             }
  1402.             default : Dialog_Show(playerid, ERROR, DIALOG_STYLE_MSGBOX, "Unknown", WHITE_U"An error occured. Take a screenshoot [F8] and inform Dayrion.\nError ID: 06", "Ok", "");
  1403.         }      
  1404.         if(!BizInfo[bizid][bBuy]) SCM(playerid, RED, "[Admin] Be careful, nobody bought this biz!");
  1405.     }
  1406.     else BizCreating[playerid] = -1;
  1407.     return 1;
  1408. }
  1409.  
  1410. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1411.  
  1412. DIALOG(DIALOG_BALANCE)
  1413. {
  1414.     if(response)
  1415.     {
  1416.         if(strval(inputtext) == 0) return Dialog_Show(playerid, DIALOG_BALANCE, DIALOG_STYLE_INPUT, "Modify balance", "Modify the current balance.\nActually : %i$\n"RED_U"Please use only numeric values.", "Confirm", "Cancel", BizInfo[BizCreating[playerid]][bEnterPrice]);
  1417.         if(strval(inputtext) < 0) return Dialog_Show(playerid, DIALOG_BALANCE, DIALOG_STYLE_INPUT, "Deposit money", "Modify the current balance.\nActually : %i$\n"RED_U"Please use only positive values.", "Confirm", "Cancel");
  1418.         SCMF(playerid, RED, "[Admin] "WHITE_U"You have changed the current balance of the biz ID:%i "RED_U"» %i$ -> %i$", BizCreating[playerid], BizInfo[BizCreating[playerid]][bSafe], strval(inputtext));
  1419.  
  1420.         BizInfo[BizCreating[playerid]][bSafe] = strval(inputtext);
  1421.         BizCreating[playerid] = -1;
  1422.         return 1;  
  1423.     }
  1424.     else BizCreating[playerid] = -1;
  1425.     return 1;
  1426. }
  1427.  
  1428. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1429. // ===========================================================================================================================================================================================
  1430. //                                                                                                  Functions
  1431. // ===========================================================================================================================================================================================
  1432. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1433.  
  1434. SaveBizData(bizid)
  1435. {
  1436.     new INI:File = INI_Open(BizPath(bizid));
  1437.  
  1438.     INI_SetTag(File, "Stats");
  1439.     INI_WriteInt(File,"ID",BizInfo[bizid][bID]);
  1440.     INI_WriteInt(File,"Interior",BizInfo[bizid][bInterior]);
  1441.     INI_WriteInt(File,"PickupID",BizInfo[bizid][bPickupID]);
  1442.     INI_WriteInt(File,"PickupEnter",BizInfo[bizid][bPickupEnter]);
  1443.     INI_WriteInt(File,"Type",BizInfo[bizid][bType]);
  1444.     INI_WriteInt(File,"Level",BizInfo[bizid][bLevel]);
  1445.     INI_WriteInt(File,"Price",BizInfo[bizid][bPrice]);
  1446.     INI_WriteFloat(File,"X",BizInfo[bizid][bX]);
  1447.     INI_WriteFloat(File,"Y",BizInfo[bizid][bY]);
  1448.     INI_WriteFloat(File,"Z",BizInfo[bizid][bZ]);
  1449.     INI_WriteFloat(File,"eX",BizInfo[bizid][beX]);
  1450.     INI_WriteFloat(File,"eY",BizInfo[bizid][beY]);
  1451.     INI_WriteFloat(File,"eZ",BizInfo[bizid][beZ]);
  1452.     INI_WriteBool(File,"Bought",BizInfo[bizid][bBuy]);
  1453.     INI_WriteString(File,"Owner",BizInfo[bizid][bOwner]);
  1454.     INI_WriteBool(File,"Existing",BizInfo[bizid][bCreated]);
  1455.     INI_WriteInt(File,"Safe",BizInfo[bizid][bSafe]);
  1456.     INI_WriteInt(File,"EnterPrice",BizInfo[bizid][bEnterPrice]);
  1457.     INI_WriteString(File,"Name",BizInfo[bizid][bName]);
  1458.     INI_WriteBool(File,"Open",BizInfo[bizid][bOpen]);
  1459.     INI_WriteInt(File,"VirtualWorld",BizInfo[bizid][bVW]);
  1460.     INI_WriteBool(File,"Investor",BizInfo[bizid][bInvestor]);
  1461.  
  1462.     INI_Close(File);
  1463.     return 1;
  1464. }
  1465.  
  1466. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1467.  
  1468. ResetBizData(bizid)
  1469. {
  1470.     BizInfo[bizid][bX]          = 0.0;
  1471.     BizInfo[bizid][bY]          = 0.0;
  1472.     BizInfo[bizid][bZ]          = 0.0;
  1473.     BizInfo[bizid][beX]         = 0.0;
  1474.     BizInfo[bizid][beY]         = 0.0;
  1475.     BizInfo[bizid][beZ]         = 0.0;
  1476.     BizInfo[bizid][bInterior]   = -1;
  1477.     BizInfo[bizid][bCreated]    = false;
  1478.     BizInfo[bizid][bPrice]      = 0;
  1479.     BizInfo[bizid][bID]         = bizid;
  1480.     BizInfo[bizid][bPickupID]   = -1;
  1481.     BizInfo[bizid][bPickupEnter]= -1;
  1482.     BizInfo[bizid][bBuy]        = false;
  1483.     BizInfo[bizid][bType]       = 0;
  1484.     BizInfo[bizid][bLevel]      = 0;
  1485.     BizInfo[bizid][bSafe]       = 0;
  1486.     BizInfo[bizid][bOpen]       = true;
  1487.     BizInfo[bizid][bEnterPrice] = 0;
  1488.     BizInfo[bizid][bVW]         = 0;
  1489.     BizInfo[bizid][bInvestor]   = false;
  1490.  
  1491.     format(BizInfo[bizid][bOwner], 24, "None");
  1492.     format(BizInfo[bizid][bName], MAX_BIZ_NAME, "None");
  1493.  
  1494.     SaveBizData(bizid);
  1495. }
  1496.  
  1497. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1498.  
  1499. GetFreeBizID()
  1500. {
  1501.     new lastid;
  1502.     for(new i; i<MAX_BIZ; i++)
  1503.     {
  1504.         if(BizInfo[i][bCreated]) continue;
  1505.         lastid = i;
  1506.         break;
  1507.     }
  1508.     return lastid;
  1509. }
  1510.  
  1511. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1512.  
  1513. PlayerHasABiz(playerid)
  1514. {
  1515.     new playeri = -1;
  1516.     for(new i; i<MAX_BIZ; i++)
  1517.     {
  1518.         if(!BizInfo[i][bCreated]) continue;
  1519.         if(strcmp(GetName(playerid), BizInfo[i][bOwner])) continue;
  1520.         playeri = i;
  1521.         break;
  1522.     }
  1523.     return playeri > -1 ? true : false;
  1524. }
  1525.  
  1526. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1527.  
  1528. GetName(const playerid)
  1529. {
  1530.     static gName[MAX_PLAYER_NAME];
  1531.     GetPlayerName(playerid, gName, sizeof(gName));
  1532.     return gName;
  1533. }
  1534.  
  1535. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1536.  
  1537. SCMF(playerid, couleur, const msg[], va_args<>)
  1538. {
  1539.     static
  1540.         string[145];
  1541.  
  1542.     va_format(string, sizeof(string), msg, va_start<3>);
  1543.     return SendClientMessage(playerid, couleur, string);
  1544. }
  1545.  
  1546. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1547.  
  1548. SCM(playerid, color, const msg[]) return SendClientMessage(playerid, color, msg);
  1549.  
  1550. stock SCMTA(color, const msg[]) return SendClientMessageToAll(color, msg);
  1551.  
  1552. stock SCMFTA(color, const msg[], va_args<>)
  1553. {
  1554.     static str[145];
  1555.     va_format(str, sizeof(str), msg, va_start<2>);
  1556.     return SCMTA(color, str);
  1557. }
  1558.  
  1559. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1560.  
  1561. GetNameEx(const playerid)
  1562. {
  1563.     static geName[MAX_PLAYER_NAME], geString[50];
  1564.     GetPlayerName(playerid, geName, sizeof(geName));
  1565.     format(geString, sizeof(geString), "%s (ID: %i)", geName, playerid);
  1566.     return geString;
  1567. }
  1568.  
  1569. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1570.  
  1571. SetBizInfos(bizid)
  1572. {
  1573.     if(!BizInfo[bizid][bCreated]) return printf("An error occured during setting infos of the biz ID: %i | Error ID: 07", bizid);
  1574.     static str[120];
  1575.     if(!BizInfo[bizid][bBuy])
  1576.     {
  1577.         format(str, sizeof(str), "~ FOR SALE ~\n"LBLUE_U"%s\nLevel : "WHITE_U"%i\n"LBLUE_U"Price : "WHITE_U"%i$", BizInfo[bizid][bName], BizInfo[bizid][bLevel], BizInfo[bizid][bPrice]);
  1578.  
  1579.         BizLabelID[bizid] = Create3DTextLabel(str, LBLUE, BizInfo[bizid][bX], BizInfo[bizid][bY], BizInfo[bizid][bZ], 20.0, 0, 0);
  1580.         BizInfo[bizid][bPickupID] = CreatePickup(ICON_BIZ_PENDING, 1, BizInfo[bizid][bX], BizInfo[bizid][bY], BizInfo[bizid][bZ], 0);
  1581.  
  1582.         BizInfo[bizid][bPickupEnter] = CreatePickup(ICON_BIZ_INTERIOR, 1, BizInfo[bizid][beX], BizInfo[bizid][beY], BizInfo[bizid][beZ], BizInfo[bizid][bVW]);
  1583.         BizLabelEnterID[bizid] = Create3DTextLabel("~ Press F to exit ~", WHITE, BizInfo[bizid][beX], BizInfo[bizid][beY], BizInfo[bizid][beZ], 20.0, BizInfo[bizid][bVW], 0);
  1584.     }
  1585.     else
  1586.     {
  1587.         format(str, sizeof(str), "%s\nOwner : "WHITE_U"%s\n"LBLUE_U"Enter price : "WHITE_U"%i$\n"LBLUE_U"Investor : "WHITE_U"%s", BizInfo[bizid][bName], BizInfo[bizid][bOwner], BizInfo[bizid][bEnterPrice], BizInv[bizid][iName]);
  1588.  
  1589.         BizLabelID[bizid] = Create3DTextLabel(str, LBLUE, BizInfo[bizid][bX], BizInfo[bizid][bY], BizInfo[bizid][bZ], 20.0, 0, 0);
  1590.         if(BizInfo[bizid][bOpen]) BizInfo[bizid][bPickupID] = CreatePickup(ICON_BIZ_OPEN, 1, BizInfo[bizid][bX], BizInfo[bizid][bY], BizInfo[bizid][bZ], 0);
  1591.         else BizInfo[bizid][bPickupID] = CreatePickup(ICON_BIZ_LOCKED, 1, BizInfo[bizid][bX], BizInfo[bizid][bY], BizInfo[bizid][bZ], 0);
  1592.  
  1593.         BizInfo[bizid][bPickupEnter] = CreatePickup(ICON_BIZ_INTERIOR, 1, BizInfo[bizid][beX], BizInfo[bizid][beY], BizInfo[bizid][beZ], BizInfo[bizid][bVW]);
  1594.         BizLabelEnterID[bizid] = Create3DTextLabel("~ Press F to exit ~", WHITE, BizInfo[bizid][beX], BizInfo[bizid][beY], BizInfo[bizid][beZ], 20.0, BizInfo[bizid][bVW], 0);
  1595.     }
  1596.     SaveBizData(bizid);
  1597.     return 1;
  1598. }
  1599.  
  1600.  
  1601. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1602.  
  1603. GetNearestBiz(playerid)
  1604. {
  1605.     new near = INVALID_BIZ_ID;
  1606.  
  1607.     for(new i; i<MAX_BIZ; i++)
  1608.     {
  1609.         if(!BizInfo[i][bCreated]) continue;
  1610.         if(!IsPlayerInRangeOfPoint(playerid, 3.0, BizInfo[i][bX], BizInfo[i][bY], BizInfo[i][bZ])) continue;
  1611.         near = i;
  1612.     }
  1613.     return near;
  1614. }
  1615.  
  1616. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1617.  
  1618. IsNearABiz(playerid) return GetNearestBiz(playerid) == INVALID_BIZ_ID ? false : true;
  1619.  
  1620. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1621.  
  1622. EnterInABiz(playerid, bizid)
  1623. {
  1624.     new IntA = BizInfo[bizid][bInterior];
  1625.     if(IntA == -1) return SCMF(playerid, -1," Debug: IntA: %i | bizid : %i | Interior: %i", IntA, bizid, BizInfo[bizid][bInterior]);
  1626.     switch(BizInfo[bizid][bType])
  1627.     {
  1628.         case 1:
  1629.         {
  1630.             SetPlayerPos(playerid, Int247[IntA][X], Int247[IntA][Y], Int247[IntA][Z]);
  1631.             SetPlayerInterior(playerid, Int247[IntA][Interior]);
  1632.         }
  1633.         case 2:
  1634.         {
  1635.             SetPlayerPos(playerid, Ammunation[IntA][X], Ammunation[IntA][Y], Ammunation[IntA][Z]);
  1636.             SetPlayerInterior(playerid, Ammunation[IntA][Interior]);
  1637.         }
  1638.         case 3:
  1639.         {
  1640.             SetPlayerPos(playerid, Shop[IntA][X], Shop[IntA][Y], Shop[IntA][Z]);
  1641.             SetPlayerInterior(playerid, Shop[IntA][Interior]);
  1642.         }
  1643.         case 4:
  1644.         {
  1645.             SetPlayerPos(playerid, Clothes[IntA][X], Clothes[IntA][Y], Clothes[IntA][Z]);
  1646.             SetPlayerInterior(playerid, Clothes[IntA][Interior]);
  1647.         }
  1648.         case 5:
  1649.         {
  1650.             SetPlayerPos(playerid, Food[IntA][X], Food[IntA][Y], Food[IntA][Z]);
  1651.             SetPlayerInterior(playerid, Food[IntA][Interior]);
  1652.         }
  1653.         case 6:
  1654.         {
  1655.             SetPlayerPos(playerid, Gym[IntA][X], Gym[IntA][Y], Gym[IntA][Z]);
  1656.             SetPlayerInterior(playerid, Gym[IntA][Interior]);
  1657.         }
  1658.         default : SCMF(playerid, -1," Debug: IntA: %i | bizid : %i | Interior: %i", IntA, bizid, BizInfo[bizid][bInterior]);
  1659.     }
  1660.  
  1661.     SetPlayerVirtualWorld(playerid, BizInfo[bizid][bVW]);
  1662.     LastBizVisited[playerid] = bizid;
  1663.  
  1664.     return 1;
  1665. }
  1666.  
  1667. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1668.  
  1669. ExitABiz(playerid, bizid)
  1670. {
  1671.     SetPlayerInterior(playerid, 0);
  1672.     SetPlayerVirtualWorld(playerid, 0);
  1673.     SetPlayerPos(playerid, BizInfo[bizid][bX], BizInfo[bizid][bY], BizInfo[bizid][bZ]);
  1674.     LastBizVisited[playerid] = INVALID_BIZ_ID;
  1675.     return 1;
  1676. }
  1677.  
  1678. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1679.  
  1680. GetPlayerBiz(playerid)
  1681. {
  1682.     static biz = INVALID_BIZ_ID;
  1683.     for(new i; i<MAX_BIZ; i++)
  1684.     {
  1685.         if(!BizInfo[i][bCreated]) continue;
  1686.         if(!strcmp(BizInfo[i][bOwner], GetName(playerid))) biz = i;
  1687.         else continue;
  1688.     }
  1689.     return biz;
  1690. }
  1691.  
  1692. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1693.  
  1694. OpenFormatBiz(bizid)
  1695. {
  1696.     static open[40];
  1697.     if(BizInfo[bizid][bOpen]) format(open, sizeof(open), "Open");
  1698.     else format(open, sizeof(open), "Closed");
  1699.     return open;
  1700. }
  1701.  
  1702. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1703.  
  1704. forward TeleChecking(playerid);
  1705. public TeleChecking(playerid)
  1706. {
  1707.     if(GetPlayerInterior(playerid) > 0 && GetPlayerVirtualWorld(playerid) > 214799999) return 1;
  1708.  
  1709.     SCMF(playerid, RED, "An error occured. You left a biz by teleportation.");
  1710.     printf("[FS] Admin | %s left a biz by teleportation | LastBizVisited ID:%i", GetNameEx(playerid), LastBizVisited[playerid]);
  1711.     LastBizVisited[playerid] = INVALID_BIZ_ID;
  1712.     return 1;
  1713. }
  1714.  
  1715. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1716.  
  1717. SaveInvestorData(bizid)
  1718. {
  1719.     new INI:File = INI_Open(InvestorPath(bizid));
  1720.     INI_SetTag(File, "Stats");
  1721.     INI_WriteInt(File,"ID",BizInv[bizid][iID]);
  1722.     INI_WriteString(File,"Name", BizInv[bizid][iName]);
  1723.     INI_WriteBool(File,"Inves",BizInv[bizid][iInves]);
  1724.     INI_WriteBool(File,"Safe",BizInv[bizid][iLock]);
  1725.     INI_WriteBool(File,"Safe",BizInv[bizid][iSafe]);
  1726.     INI_WriteBool(File,"EnterPrice",BizInv[bizid][iEnterPrice]);
  1727.     INI_WriteBool(File,"Rename",BizInv[bizid][iRename]);
  1728.     INI_WriteBool(File,"Deposit",BizInv[bizid][iDeposit]);
  1729.     INI_WriteBool(File,"Withdraw",BizInv[bizid][iWithdraw]);
  1730.     INI_Close(File);
  1731. }
  1732.  
  1733. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1734.  
  1735. IsPlayerConnectedByName(const name[])
  1736. {
  1737.     foreach(new i : Player)
  1738.     {
  1739.         if(strcmp(name, GetName(i))) continue;
  1740.         return true;
  1741.     }
  1742.     return false;
  1743. }
  1744.  
  1745. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1746.  
  1747. GetIDByName(const name[])
  1748. {
  1749.     foreach(new i : Player)
  1750.     {
  1751.         if(!strcmp(GetName(i), name)) return i;
  1752.     }
  1753.     printf("[FS] Error : No player found for the name '%s'.", name);
  1754.     return -1;
  1755. }
  1756.  
  1757. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1758.  
  1759. ShowDialogInvPerm(playerid, bizid)
  1760. {
  1761.     new final[1000], str[150];
  1762.  
  1763.     if(BizInv[bizid][iSafe]) format(str, sizeof(str), WHITE_U "Access to biz's informations : "GREEN_U"Authorized"), strcat(final, str);
  1764.     else format(str, sizeof(str), WHITE_U "Access to biz's informations : "RED_U"Unauthorized"), strcat(final, str);
  1765.  
  1766.     if(BizInv[bizid][iLock]) format(str, sizeof(str), "\n"LBLUE_U"Can lock the biz : "GREEN_U"Authorized"), strcat(final, str);
  1767.     else format(str, sizeof(str), LBLUE_U "\nCan lock the biz : "RED_U"Unauthorized"), strcat(final, str);
  1768.  
  1769.     if(BizInv[bizid][iEnterPrice]) format(str, sizeof(str), LBLUE_U "\nModfiy the enter price : "GREEN_U"Authorized"), strcat(final, str);
  1770.     else format(str, sizeof(str), LBLUE_U "\nModfiy the enter price : "RED_U"Unauthorized"), strcat(final, str);
  1771.  
  1772.     if(BizInv[bizid][iRename]) format(str, sizeof(str), LBLUE_U "\nRename the biz : "GREEN_U"Authorized"), strcat(final, str);
  1773.     else format(str, sizeof(str), LBLUE_U "\nRename the biz : "RED_U"Unauthorized"), strcat(final, str);
  1774.  
  1775.     if(BizInv[bizid][iDeposit]) format(str, sizeof(str), LBLUE_U "\nCan deposit : "GREEN_U"Authorized"), strcat(final, str);
  1776.     else format(str, sizeof(str), LBLUE_U "\nCan deposit : "RED_U"Unauthorized"), strcat(final, str);
  1777.  
  1778.     if(BizInv[bizid][iWithdraw]) format(str, sizeof(str), LBLUE_U "\nCan withdraw : "GREEN_U"Authorized"), strcat(final, str);
  1779.     else format(str, sizeof(str), LBLUE_U "\nCan withdraw : "RED_U"Unauthorized"), strcat(final, str);
  1780.  
  1781.     format(str, sizeof(str), WHITE_U "Modify investor's rights of %s", BizInv[bizid][iName]);
  1782.  
  1783.     Dialog_Show(playerid, DIALOG_MODIFY_INVESTOR, DIALOG_STYLE_LIST, str, final, "Choose", "Cancel");
  1784.  
  1785.     BizCreating[playerid] = -1;
  1786.  
  1787.     BizCreating[playerid] = bizid;
  1788.  
  1789.     return 1;
  1790. }
  1791.  
  1792. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1793.  
  1794. ShowDialogInvestor(playerid, bizid)
  1795. {
  1796.     new final[1000], str[150];
  1797.  
  1798.     if(BizInv[bizid][iSafe]) format(str, sizeof(str), GREEN_U "Access to biz's informations\n"), strcat(final, str);
  1799.     else format(str, sizeof(str), WHITE_U RED_U"Access to biz's informations\n"), strcat(final, str);
  1800.  
  1801.     if(BizInv[bizid][iLock]) format(str, sizeof(str), GREEN_U"Unlock the biz\n"), strcat(final, str);
  1802.     else format(str, sizeof(str), RED_U "Lock the biz\n"), strcat(final, str);
  1803.  
  1804.     if(BizInv[bizid][iEnterPrice]) format(str, sizeof(str), GREEN_U "Modfiy the enter price\n"), strcat(final, str);
  1805.     else format(str, sizeof(str), RED_U "Modfiy the enter price\n"), strcat(final, str);
  1806.  
  1807.     if(BizInv[bizid][iRename]) format(str, sizeof(str), GREEN_U "Rename the biz\n"), strcat(final, str);
  1808.     else format(str, sizeof(str), RED_U "Rename the biz\n"), strcat(final, str);
  1809.  
  1810.     if(BizInv[bizid][iDeposit]) format(str, sizeof(str), GREEN_U "Deposit\n"), strcat(final, str);
  1811.     else format(str, sizeof(str), RED_U "Deposit\n"), strcat(final, str);
  1812.  
  1813.     if(BizInv[bizid][iWithdraw]) format(str, sizeof(str), GREEN_U "Withdraw"), strcat(final, str);
  1814.     else format(str, sizeof(str), RED_U "Withdraw"), strcat(final, str);
  1815.  
  1816.     format(str, sizeof(str), WHITE_U "Info the %s's biz.", BizInfo[bizid][bOwner]);
  1817.  
  1818.     Dialog_Show(playerid, DIALOG_INVESTOR, DIALOG_STYLE_LIST, str, final, "Choose", "Cancel");
  1819.  
  1820.     return 1;
  1821. }
  1822.  
  1823. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1824.  
  1825. ResetInvestorData(bizid)
  1826. {
  1827.     format(BizInv[bizid][iName], 24, "Nobody");
  1828.     BizInv[bizid][iInves]       = false;
  1829.     BizInv[bizid][iSafe]        = false;
  1830.     BizInv[bizid][iLock]        = false;
  1831.     BizInv[bizid][iRename]      = false;
  1832.     BizInv[bizid][iWithdraw]    = false;
  1833.     BizInv[bizid][iDeposit]     = false;
  1834.  
  1835.     SaveInvestorData(bizid);
  1836.     return 1;
  1837. }
  1838.  
  1839. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1840.  
  1841. GetInvestorBizID(playerid)
  1842. {
  1843.     for(new i; i < MAX_BIZ; i++)
  1844.     {
  1845.         if(!BizInv[i][iInves]) continue;
  1846.         if(strcmp(GetName(playerid), BizInv[i][iName])) continue;
  1847.  
  1848.         return i;
  1849.     }
  1850.     return INVALID_BIZ_ID;
  1851. }
  1852.  
  1853. //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1854.  
  1855. SetMoneyGameText(playerid, bool:negative, amount)
  1856. {
  1857.     if(negative)
  1858.     {
  1859.         new str[50];
  1860.         format(str, sizeof(str), "~r~-%i$", amount);
  1861.         GameTextForPlayer(playerid, str, 500, 1);
  1862.     }
  1863.     else
  1864.     {
  1865.         new str[50];
  1866.         format(str, sizeof(str), "~g~%i$", amount);
  1867.         GameTextForPlayer(playerid, str, 500, 1);
  1868.     }
  1869.  
  1870.     return 1;
  1871. }
Advertisement
Add Comment
Please, Sign In to add comment