casino.pwn 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737
  1. /*
  2. /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$$
  3. | $$$ | $$ /$$__ $$ | $$__ $$| $$__ $$
  4. | $$$$| $$| $$ \__/ | $$ \ $$| $$ \ $$
  5. | $$ $$ $$| $$ /$$$$ /$$$$$$| $$$$$$$/| $$$$$$$/
  6. | $$ $$$$| $$|_ $$|______/| $$__ $$| $$____/
  7. | $$\ $$$| $$ \ $$ | $$ \ $$| $$
  8. | $$ \ $$| $$$$$$/ | $$ | $$| $$
  9. |__/ \__/ \______/ |__/ |__/|__/
  10. Casino System
  11. ROTHSCHILD
  12. Next Generation Gaming, LLC
  13. (created by Next Generation Gaming Development Team)
  14. * Copyright (c) 2016, Next Generation Gaming, LLC
  15. *
  16. * All rights reserved.
  17. *
  18. * Redistribution and use in source and binary forms, with or without modification,
  19. * are not permitted in any case.
  20. *
  21. *
  22. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  23. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  24. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  25. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  26. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  27. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  28. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  29. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  30. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  31. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  32. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  33. */
  34. #include <YSI\y_hooks>
  35. new CASINOPoint[17];
  36. // --- Automated Dice System by Thomas ---
  37. // Stock Functions
  38. stock IsPlayerInRangeOfPlayer(playerid, targetid, Float:range)
  39. {
  40. if(!IsPlayerConnected(targetid) || !IsPlayerConnected(playerid)) return false;
  41. new Float:Position[3];
  42. GetPlayerPos(targetid, Position[0], Position[1], Position[2]);
  43. if(IsPlayerInRangeOfPoint(playerid, range, Position[0], Position[1], Position[2])) return true;
  44. else return false;
  45. }
  46. stock DestroyOfferDiceData(playerid)
  47. {
  48. if((GetPVarInt(playerid, "OfferDiceID") == 0) && (GetPVarInt(playerid, "OfferingDiceID") == 0))
  49. {
  50. SetPVarInt(playerid, "OfferingDiceID", INVALID_PLAYER_ID);
  51. SetPVarInt(playerid, "OfferDiceID", INVALID_PLAYER_ID);
  52. DeletePVar(playerid, "OfferDiceTimer");
  53. DeletePVar(playerid, "OfferDiceAmount");
  54. DeletePVar(playerid, "OfferDiceRolls");
  55. //printf("[DEBUG-DESTROYOFFERDICEDATA]: %d (1)", playerid);
  56. return 0;
  57. }
  58. if(GetPVarInt(playerid, "OfferDiceID") != INVALID_PLAYER_ID)
  59. {
  60. SetPVarInt(GetPVarInt(playerid, "OfferDiceID"), "OfferingDiceID", INVALID_PLAYER_ID);
  61. DeletePVar(playerid, "OfferDiceAmount");
  62. DeletePVar(playerid, "OfferDiceRolls");
  63. SetPVarInt(playerid, "OfferDiceID", INVALID_PLAYER_ID);
  64. //printf("[DEBUG-DESTROYOFFERDICEDATA]: %d (2)", playerid);
  65. }
  66. else if(GetPVarInt(playerid, "OfferingDiceID") != INVALID_PLAYER_ID)
  67. {
  68. DeletePVar(GetPVarInt(playerid, "OfferingDiceID"), "OfferDiceAmount");
  69. DeletePVar(GetPVarInt(playerid, "OfferingDiceID"), "OfferDiceRolls");
  70. SetPVarInt(GetPVarInt(playerid, "OfferingDiceID"), "OfferDiceID", INVALID_PLAYER_ID);
  71. SetPVarInt(playerid, "OfferingDiceID", INVALID_PLAYER_ID);
  72. //printf("[DEBUG-DESTROYOFFERDICEDATA]: %d (3)", playerid);
  73. }
  74. return 1;
  75. }
  76. // Commands
  77. CMD:offerdice(playerid, params[])
  78. {
  79. new targetid, amount, rolls;
  80. if(sscanf(params, "udd", targetid, amount, rolls)) return SendClientMessageEx(playerid, COLOR_GREY, "Syntax: /offerdice [playerid] [amount] [rolls]");
  81. if(gettime() < GetPVarInt(playerid, "OfferDiceTimer")) return SendClientMessageEx(playerid, COLOR_GREY, "You must wait %d seconds before offering another dice game.", GetPVarInt(playerid, "OfferDiceTimer")-gettime());
  82. if(!IsPlayerInRangeOfPlayer(playerid, targetid, 5)) return SendClientMessageEx(playerid, COLOR_GREY, "Error: You are not near the player.");
  83. if(playerid == targetid) return SendClientMessageEx(playerid, COLOR_GREY, "Error: You are cannot roll with yourself.");
  84. if(GetPVarInt(playerid, "OfferDiceID") != INVALID_PLAYER_ID) return SendClientMessageEx(playerid, COLOR_GREY, "Error: You are already being offered a dice game. Please accept or deny it.");
  85. if(GetPVarInt(playerid, "OfferingDiceID") != INVALID_PLAYER_ID) return SendClientMessageEx(playerid, COLOR_GREY, "Error: You are already offering a dice game. Use /canceldice to cancel it.");
  86. if(amount < 5000000) return SendClientMessageEx(playerid, COLOR_GREY, "Error: You can only bet more than $5,000,000.");
  87. if(rolls < 1 || rolls > 3) return SendClientMessageEx(playerid, COLOR_GREY, "Error: You can only use 1 to 3 rolls.");
  88. if(PlayerInfo[playerid][pCash] < amount) return SendClientMessageEx(playerid, COLOR_GREY, "Error: You don't have enough money.");
  89. if(PlayerInfo[targetid][pCash] < amount) return SendClientMessageEx(playerid, COLOR_GREY, "Error: The player doesn't have enough money.");
  90. SetPVarInt(playerid, "OfferingDiceID", targetid);
  91. SetPVarInt(playerid, "OfferDiceTimer", gettime()+30);
  92. SetPVarInt(targetid, "OfferDiceID", playerid);
  93. SetPVarInt(targetid, "OfferDiceAmount", amount);
  94. SetPVarInt(targetid, "OfferDiceRolls", rolls);
  95. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "DICE: You have offered %s a game of dice for $%s with %d dice rolls. (/canceldice)", GetPlayerNameEx(targetid), number_format(amount), rolls);
  96. SendClientMessageEx(targetid, COLOR_LIGHTBLUE, "DICE: %s has offered you a game of dice for $%s with %d dice rolls. (/acceptdice or /denydice)", GetPlayerNameEx(playerid), number_format(amount), rolls);
  97. return 1;
  98. }
  99. CMD:acceptdice(playerid, params[])
  100. {
  101. if(GetPVarInt(playerid, "OfferDiceID") == INVALID_PLAYER_ID) return SendClientMessageEx(playerid, COLOR_GREY, "Error: No one offered you a dice game.");
  102. if(!IsPlayerInRangeOfPlayer(playerid, GetPVarInt(playerid, "OfferDiceID"), 5)) return SendClientMessageEx(playerid, COLOR_GREY, "Error: You are too far from the player.");
  103. if(PlayerInfo[playerid][pCash] < GetPVarInt(playerid, "OfferDiceAmount")) return SendClientMessageEx(playerid, COLOR_GREY, "Error: You don't have enough money.");
  104. if(PlayerInfo[GetPVarInt(playerid, "OfferDiceID")][pCash] < GetPVarInt(playerid, "OfferDiceAmount")) return SendClientMessageEx(playerid, COLOR_GREY, "Error: The player doesn't have enough money.");
  105. new player1, player2;
  106. player1 = CalculateDiceRoll(GetPVarInt(playerid, "OfferDiceID"), GetPVarInt(playerid, "OfferDiceRolls"));
  107. player2 = CalculateDiceRoll(playerid, GetPVarInt(playerid, "OfferDiceRolls"));
  108. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "DICE: %s got {FF6347}%d{33CCFF} and you got {FF6347}%d{33CCFF}.", GetPlayerNameEx(GetPVarInt(playerid, "OfferDiceID")), player1, player2);
  109. SendClientMessageEx(GetPVarInt(playerid, "OfferDiceID"), COLOR_LIGHTBLUE, "DICE: You got {FF6347}%d{33CCFF} and %s got {FF6347}%d{33CCFF}.", player1, GetPlayerNameEx(playerid), player2);
  110. if(player1 > player2)
  111. {
  112. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "DICE: You lost $%s on the dice game verses %s.", number_format(GetPVarInt(playerid, "OfferDiceAmount")), GetPlayerNameEx(GetPVarInt(playerid, "OfferDiceID")));
  113. SendClientMessageEx(GetPVarInt(playerid, "OfferDiceID"), COLOR_LIGHTBLUE, "DICE: You won $%s on the dice game verses %s.", number_format(GetPVarInt(playerid, "OfferDiceAmount")), GetPlayerNameEx(playerid));
  114. PlayerInfo[playerid][pCash] -= GetPVarInt(playerid, "OfferDiceAmount");
  115. PlayerInfo[GetPVarInt(playerid, "OfferDiceID")][pCash] += GetPVarInt(playerid, "OfferDiceAmount");
  116. CasinoDBLog(GetPVarInt(playerid, "OfferDiceID"), "OFFERDICE", GetPVarInt(playerid, "OfferDiceAmount"), 0, player1, player2, 0);
  117. }
  118. else if (player1 == player2)
  119. {
  120. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "DICE: The dice game for $%s verses %s ended in a draw.", number_format(GetPVarInt(playerid, "OfferDiceAmount")), GetPlayerNameEx(GetPVarInt(playerid, "OfferDiceID")));
  121. SendClientMessageEx(GetPVarInt(playerid, "OfferDiceID"), COLOR_LIGHTBLUE, "DICE: The dice game for $%s verses %s ended in a draw.", number_format(GetPVarInt(playerid, "OfferDiceAmount")), GetPlayerNameEx(playerid));
  122. }
  123. else
  124. {
  125. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "DICE: You won $%s on the dice game verses %s.", number_format(GetPVarInt(playerid, "OfferDiceAmount")), GetPlayerNameEx(GetPVarInt(playerid, "OfferDiceID")));
  126. SendClientMessageEx(GetPVarInt(playerid, "OfferDiceID"), COLOR_LIGHTBLUE, "DICE: You lost $%s on the dice game verses %s.", number_format(GetPVarInt(playerid, "OfferDiceAmount")), GetPlayerNameEx(playerid));
  127. PlayerInfo[playerid][pCash] += GetPVarInt(playerid, "OfferDiceAmount");
  128. PlayerInfo[GetPVarInt(playerid, "OfferDiceID")][pCash] -= GetPVarInt(playerid, "OfferDiceAmount");
  129. CasinoDBLog(playerid, "OFFERDICE", GetPVarInt(playerid, "OfferDiceAmount"), 0, player1, player2, 0);
  130. }
  131. DestroyOfferDiceData(playerid);
  132. return 1;
  133. }
  134. CMD:denydice(playerid, params[])
  135. {
  136. if(GetPVarInt(playerid, "OfferDiceID") == INVALID_PLAYER_ID) return SendClientMessageEx(playerid, COLOR_GREY, "Error: No one offered you a dice game.");
  137. SendClientMessageEx(GetPVarInt(playerid, "OfferDiceID"), COLOR_LIGHTBLUE, "DICE: %s has denied the dice game.", GetPlayerNameEx(playerid));
  138. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "DICE: You have denied the dice game with %s.", GetPlayerNameEx(GetPVarInt(playerid, "OfferDiceID")));
  139. DestroyOfferDiceData(playerid);
  140. return 1;
  141. }
  142. CMD:canceldice(playerid, params[])
  143. {
  144. if(GetPVarInt(playerid, "OfferingDiceID") == INVALID_PLAYER_ID) return SendClientMessageEx(playerid, COLOR_GREY, "Error: You don't have a pending dice game.");
  145. SendClientMessageEx(GetPVarInt(playerid, "OfferingDiceID"), COLOR_LIGHTBLUE, "DICE: %s has cancelled the dice game.", GetPlayerNameEx(playerid));
  146. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "DICE: You have cancelled the dice game with %s.", GetPlayerNameEx(GetPVarInt(playerid, "OfferingDiceID")));
  147. DestroyOfferDiceData(playerid);
  148. return 1;
  149. }
  150. // --- End of Automated Dice System ---
  151. stock randomEx(min, max)
  152. {
  153. new rand = random(max-min)+min;
  154. return rand;
  155. }
  156. CMD:rolldice(playerid, params[])
  157. {
  158. new amount, dice, theplayer;
  159. if(!IsAtCasino(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not in a Casino.");
  160. if (PlayerInfo[playerid][pBusiness] == INVALID_BUSINESS_ID || Businesses[PlayerInfo[playerid][pBusiness]][bType] != BUSINESS_TYPE_CASINO) {
  161. return SendClientMessageEx(playerid, COLOR_GREY, "You are not working for a Casino!");
  162. }
  163. if(PlayerInfo[playerid][pBusiness] != InBusiness(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You are not working for this Casino!");
  164. if(GetPVarInt(playerid, "pRollDiceID") != INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "You are already in a game.");
  165. if(sscanf(params, "udd", theplayer, amount, dice)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /rolldice [PlayerID] [Money Amount] [Amount of Dice]");
  166. if(!IsPlayerConnected(theplayer)) return SendClientMessage(playerid, COLOR_GREY, "This players isn't connected.");
  167. if(playerid == theplayer) return SendClientMessage(playerid, COLOR_GREY, "You can't dice with yourself.");
  168. if(amount > 50000000 || amount < 1000) return SendClientMessage(playerid, COLOR_GREY, "You can only bet $1000-$50,000,000");
  169. if(dice > 3 || dice <= 0) return SendClientMessage(playerid, COLOR_GREY, "You can only use 1-3 Dice.");
  170. if(PlayerInfo[theplayer][pCash] < amount)
  171. {
  172. SendClientMessage(playerid, COLOR_GREY, "The Player doesn't have enough money.");
  173. return SendClientMessage(theplayer, COLOR_GREY, "You don't have enough money.");
  174. }
  175. if(PlayerInfo[theplayer][pCash] < 0) return SendClientMessage(playerid, COLOR_GREY, "You're broke.");
  176. if(Businesses[InBusiness(playerid)][bSafeBalance] <= 0) return SendClientMessage(playerid, COLOR_GREY, "This casino is bankrupt.");
  177. SetPVarInt(theplayer, "pRollDiceID", playerid);
  178. SetPVarInt(theplayer, "pRollDiceMoney", amount);
  179. SetPVarInt(theplayer, "pRollDiceAmount", dice);
  180. SetPVarInt(playerid, "pRollDiceID", theplayer);
  181. SetPVarInt(playerid, "pRollDiceMoney", amount);
  182. SetPVarInt(playerid, "pRollDiceAmount", dice);
  183. format(szMiscArray, sizeof(szMiscArray), "CASINO: %s has offered you a game of dice for $%s with %d dice rolls. (/acceptroll)", GetPlayerNameEx(playerid), number_format(amount), dice);
  184. SendClientMessage(theplayer, COLOR_LIGHTBLUE, szMiscArray);
  185. format(szMiscArray, sizeof(szMiscArray), "CASINO: You have offered %s a game of dice for $%s with %d dice rolls. (/cancelroll)", GetPlayerNameEx(theplayer), number_format(amount), dice);
  186. SendClientMessage(playerid, COLOR_LIGHTBLUE, szMiscArray);
  187. return 1;
  188. }
  189. CMD:acceptroll(playerid, params[])
  190. {
  191. if(GetPVarInt(playerid, "pRollDiceID") == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "You don't have a pending dice game.");
  192. if(PlayerInfo[playerid][pCash] < GetPVarInt(playerid, "pRollDiceMoney")) {
  193. DeletePVar(GetPVarInt(playerid, "pRollDiceID"), "pRollDiceID");
  194. DeletePVar(GetPVarInt(playerid, "pRollDiceID"), "pRollDiceMoney");
  195. DeletePVar(GetPVarInt(playerid, "pRollDiceID"), "pRollDiceAmount");
  196. SendClientMessage(GetPVarInt(playerid, "pRollDiceID"), COLOR_LIGHTBLUE, "The player couldn't afford the dice game. (/rolldice)");
  197. DeletePVar(playerid, "pRollDiceID");
  198. DeletePVar(playerid, "pRollDiceMoney");
  199. DeletePVar(playerid, "pRollDiceAmount");
  200. return SendClientMessage(playerid, COLOR_LIGHTBLUE, "You don't have enough money for the Dice Game.");
  201. }
  202. new player1, player2;
  203. PlayerInfo[playerid][pCash] -= GetPVarInt(playerid, "pRollDiceMoney");
  204. Businesses[InBusiness(playerid)][bSafeBalance] += GetPVarInt(playerid, "pRollDiceMoney");
  205. player1 = CalculateDiceRoll(GetPVarInt(playerid, "pRollDiceID"), GetPVarInt(playerid, "pRollDiceAmount"));
  206. player2 = CalculateDiceRoll(playerid, GetPVarInt(playerid, "pRollDiceAmount"));
  207. format(szMiscArray, sizeof(szMiscArray), "%s says: Casino got %d, Player got %d.", GetPlayerNameEx(GetPVarInt(playerid, "pRollDiceID")), player1, player2);
  208. ProxDetector(5.0, GetPVarInt(playerid, "pRollDiceID"), szMiscArray,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_FADE1,COLOR_FADE2, 1);
  209. if(player1 > player2)
  210. {
  211. format(szMiscArray, sizeof(szMiscArray), "%s says: Casino Wins.", GetPlayerNameEx(GetPVarInt(playerid, "pRollDiceID")));
  212. ProxDetector(5.0, GetPVarInt(playerid, "pRollDiceID"), szMiscArray,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_FADE1,COLOR_FADE2, 1);
  213. CasinoDBLog(playerid, "DICE", GetPVarInt(playerid, "pRollDiceMoney"), 0, player1, player2, 0);
  214. SaveBusiness(InBusiness(playerid));
  215. DeleteDiceData(playerid);
  216. }
  217. else if (player1 == player2) {
  218. format(szMiscArray, sizeof(szMiscArray), "%s says: It's a Draw.", GetPlayerNameEx(GetPVarInt(playerid, "pRollDiceID")));
  219. ProxDetector(5.0, GetPVarInt(playerid, "pRollDiceID"), szMiscArray,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_FADE1,COLOR_FADE2, 1);
  220. PlayerInfo[playerid][pCash] += GetPVarInt(playerid, "pRollDiceMoney");
  221. Businesses[InBusiness(playerid)][bSafeBalance] -= GetPVarInt(playerid, "pRollDiceMoney");
  222. DeleteDiceData(playerid);
  223. }
  224. else {
  225. format(szMiscArray, sizeof(szMiscArray), "%s says: Player Wins.", GetPlayerNameEx(GetPVarInt(playerid, "pRollDiceID")));
  226. ProxDetector(5.0, GetPVarInt(playerid, "pRollDiceID"), szMiscArray,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_FADE1,COLOR_FADE2, 1);
  227. PlayerInfo[playerid][pCash] += GetPVarInt(playerid, "pRollDiceMoney") * 2;
  228. CasinoDBLog(playerid, "DICE", GetPVarInt(playerid, "pRollDiceMoney"), GetPVarInt(playerid, "pRollDiceMoney")*2, player1, player2, 0);
  229. Businesses[InBusiness(playerid)][bSafeBalance] -= GetPVarInt(playerid, "pRollDiceMoney") * 2;
  230. SaveBusiness(InBusiness(playerid));
  231. DeleteDiceData(playerid);
  232. }
  233. return 1;
  234. }
  235. CMD:cancelroll(playerid, params[])
  236. {
  237. if(GetPVarInt(playerid, "pRollDiceID") == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "You don't have a pending dice game.");
  238. format(szMiscArray, sizeof(szMiscArray), "CASINO: %s has cancelled the Dice Game.", GetPlayerNameEx(playerid));
  239. SendClientMessage(GetPVarInt(playerid, "pRollDiceID"), COLOR_LIGHTBLUE, szMiscArray);
  240. SendClientMessage(playerid, COLOR_LIGHTBLUE, "CASINO: You have cancelled the Dice Game.");
  241. DeleteDiceData(playerid);
  242. return 1;
  243. }
  244. CMD:slots(playerid, params[])
  245. {
  246. new amount, rand[3], randsymbol[3], winPrize, areaid[1];
  247. GetPlayerDynamicAreas(playerid, areaid); //Assign nearest areaid
  248. for(new i; i < sizeof(CASINOPoint); ++i) {
  249. if(areaid[0] == CASINOPoint[i]) {
  250. SetPVarInt(playerid, "INCASINOAREA", 1);
  251. }
  252. }
  253. if(!GetPVarInt(playerid, "INCASINOAREA")) return SendClientMessage(playerid, COLOR_GREY, "You're not at a Slot Machine.");
  254. if(GetPVarInt(playerid, "UsedSlot") > gettime()) return SendClientMessage(playerid, COLOR_GREY, "You need to wait ten seconds.");
  255. if(!IsAtCasino(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not in a Casino.");
  256. if(sscanf(params, "d", amount)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /slots [Money Amount]");
  257. if(amount > 1000000 || amount < 1000) return SendClientMessage(playerid, COLOR_GREY, "You can only bet $1000-$1,000,000");
  258. if(PlayerInfo[playerid][pCash] < amount) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money.");
  259. if(PlayerInfo[playerid][pCash] < 0) return SendClientMessage(playerid, COLOR_GREY, "You're broke.");
  260. if(Businesses[InBusiness(playerid)][bSafeBalance] <= 0) return SendClientMessage(playerid, COLOR_GREY, "This casino is bankrupt.");
  261. Businesses[InBusiness(playerid)][bSafeBalance] += amount;
  262. PlayerInfo[playerid][pCash] -= amount;
  263. rand[0] = randomEx(1, 128);
  264. rand[1] = randomEx(1, 128);
  265. rand[2] = randomEx(1, 128);
  266. switch(rand[0])
  267. {
  268. case 1 .. 73: randsymbol[0] = 1;
  269. case 74 .. 78: randsymbol[0] = 2;
  270. case 79 .. 94: randsymbol[0] = 3;
  271. case 95 .. 107: randsymbol[0] = 4;
  272. case 108 .. 118: randsymbol[0] = 5;
  273. case 119 .. 126: randsymbol[0] = 6;
  274. case 127 .. 128: randsymbol[0] = 7;
  275. }
  276. switch(rand[1])
  277. {
  278. case 1 .. 73: randsymbol[1] = 1;
  279. case 74 .. 78: randsymbol[1] = 2;
  280. case 79 .. 94: randsymbol[1] = 3;
  281. case 95 .. 107: randsymbol[1] = 4;
  282. case 108 .. 118: randsymbol[1] = 5;
  283. case 119 .. 126: randsymbol[1] = 6;
  284. case 127 .. 128: randsymbol[1] = 7;
  285. }
  286. switch(rand[2])
  287. {
  288. case 1 .. 73: randsymbol[2] = 1;
  289. case 74 .. 78: randsymbol[2] = 2;
  290. case 79 .. 94: randsymbol[2] = 3;
  291. case 95 .. 107: randsymbol[2] = 4;
  292. case 108 .. 118: randsymbol[2] = 5;
  293. case 119 .. 126: randsymbol[2] = 6;
  294. case 127 .. 128: randsymbol[2] = 7;
  295. }
  296. winPrize = CalculateCasinoWinning(amount, randsymbol[0], randsymbol[1], randsymbol[2]);
  297. format(szMiscArray, sizeof(szMiscArray), "%d", randsymbol[0]);
  298. PlayerTextDrawSetString(playerid, PullDraw[playerid][7], szMiscArray);
  299. format(szMiscArray, sizeof(szMiscArray), "%d", randsymbol[1]);
  300. PlayerTextDrawSetString(playerid, PullDraw[playerid][8], szMiscArray);
  301. format(szMiscArray, sizeof(szMiscArray), "%d", randsymbol[2]);
  302. PlayerTextDrawSetString(playerid, PullDraw[playerid][9], szMiscArray);
  303. DisplayPullDraws(playerid);
  304. SetTimerEx("RemovePullDraws", 5000, false, "i", playerid);
  305. SetPVarInt(playerid, "UsedSlot", gettime() + 10);
  306. CasinoDBLog(playerid, "SLOTS", amount, winPrize, randsymbol[0], randsymbol[1], randsymbol[2]);
  307. DeletePVar(playerid, "INCASINOAREA");
  308. if(winPrize == 0)
  309. {
  310. SendClientMessage(playerid, COLOR_LIGHTBLUE, "You lose! Better luck, next time!");
  311. return 1;
  312. }
  313. else if(randsymbol[0] == randsymbol[1] && randsymbol[1] == randsymbol[2] && randsymbol[1] == 7)
  314. {
  315. format(szMiscArray, sizeof(szMiscArray), "%s has just won the Casino %s JackPot of $%s", GetPlayerNameEx(playerid), Businesses[InBusiness(playerid)][bName], number_format(winPrize));
  316. SendClientMessageToAll(COLOR_YELLOW, szMiscArray);
  317. }
  318. format(szMiscArray, sizeof(szMiscArray), "Congratulations, you won $%s", number_format(winPrize));
  319. PlayerInfo[playerid][pCash] += winPrize;
  320. Businesses[InBusiness(playerid)][bSafeBalance] -= winPrize;
  321. SaveBusiness(InBusiness(playerid));
  322. SendClientMessage(playerid, COLOR_LIGHTBLUE, szMiscArray);
  323. return 1;
  324. }
  325. CalculateCasinoWinning(amount, rand0, rand1, rand2)
  326. {
  327. new prize, calc;
  328. if(rand0 != rand1 && rand0 != rand2 && rand1 != rand2)
  329. {
  330. return 0;
  331. }
  332. else if(rand0 == rand1 && rand1 != rand2)
  333. {
  334. switch(rand0)
  335. {
  336. case 1:
  337. {
  338. calc = amount / 100 * 42;
  339. prize = amount + calc;
  340. }
  341. case 2:
  342. {
  343. calc = amount / 100 * 112;
  344. prize = amount + calc;
  345. }
  346. case 3:
  347. {
  348. calc = amount / 100 * 61;
  349. prize = amount + calc;
  350. }
  351. case 4:
  352. {
  353. calc = amount / 100 * 76;
  354. prize = amount + calc;
  355. }
  356. case 5:
  357. {
  358. calc = amount / 100 * 92;
  359. prize = amount + calc;
  360. }
  361. case 6:
  362. {
  363. calc = amount / 100 * 248;
  364. prize = amount + calc;
  365. }
  366. case 7:
  367. {
  368. calc = amount / 100 * 677;
  369. prize = amount + calc;
  370. }
  371. }
  372. }
  373. else if(rand1 == rand2 && rand1 != rand0)
  374. {
  375. switch(rand1)
  376. {
  377. case 1:
  378. {
  379. calc = amount / 100 * 42;
  380. prize = amount + calc;
  381. }
  382. case 2:
  383. {
  384. calc = amount / 100 * 112;
  385. prize = amount + calc;
  386. }
  387. case 3:
  388. {
  389. calc = amount / 100 * 61;
  390. prize = amount + calc;
  391. }
  392. case 4:
  393. {
  394. calc = amount / 100 * 76;
  395. prize = amount + calc;
  396. }
  397. case 5:
  398. {
  399. calc = amount / 100 * 92;
  400. prize = amount + calc;
  401. }
  402. case 6:
  403. {
  404. calc = amount / 100 * 248;
  405. prize = amount + calc;
  406. }
  407. case 7:
  408. {
  409. calc = amount / 100 * 677;
  410. prize = amount + calc;
  411. }
  412. }
  413. }
  414. else if(rand0 == rand1 && rand1 == rand2)
  415. {
  416. switch(rand2)
  417. {
  418. case 1:
  419. {
  420. calc = amount / 100 * 92;
  421. prize = amount + calc;
  422. }
  423. case 2:
  424. {
  425. calc = amount / 100 * 262;
  426. prize = amount + calc;
  427. }
  428. case 3:
  429. {
  430. calc = amount / 100 * 146;
  431. prize = amount + calc;
  432. }
  433. case 4:
  434. {
  435. calc = amount / 100 * 222;
  436. prize = amount + calc;
  437. }
  438. case 5:
  439. {
  440. calc = amount / 100 * 338;
  441. prize = amount + calc;
  442. }
  443. case 6:
  444. {
  445. calc = amount / 100 * 763;
  446. prize = amount + calc;
  447. }
  448. case 7:
  449. {
  450. calc = amount / 100 * 28190;
  451. prize = amount + calc;
  452. }
  453. }
  454. }
  455. return prize;
  456. }
  457. CalculateDiceRoll(playerid, dice)
  458. {
  459. new total;
  460. for(new i; i < dice; i++)
  461. {
  462. new rand = randomEx(1, 7);
  463. format(szMiscArray, sizeof(szMiscArray), "{FF8000}** {C2A2DA}%s rolls a dice that lands on %d.", GetPlayerNameEx(playerid), rand);
  464. ProxDetector(4.0, playerid, szMiscArray, COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);
  465. total += rand;
  466. }
  467. return total;
  468. }
  469. DeleteDiceData(playerid)
  470. {
  471. SetPVarInt(GetPVarInt(playerid, "pRollDiceID"), "pRollDiceID", INVALID_PLAYER_ID);
  472. DeletePVar(GetPVarInt(playerid, "pRollDiceID"), "pRollDiceMoney");
  473. DeletePVar(GetPVarInt(playerid, "pRollDiceID"), "pRollDiceAmount");
  474. SetPVarInt(playerid, "pRollDiceID", INVALID_PLAYER_ID);
  475. DeletePVar(playerid, "pRollDiceMoney");
  476. DeletePVar(playerid, "pRollDiceAmount");
  477. }
  478. forward DisplayPullDraws(playerid);
  479. public DisplayPullDraws(playerid)
  480. {
  481. PlayerTextDrawShow(playerid, PullDraw[playerid][0]);
  482. PlayerTextDrawShow(playerid, PullDraw[playerid][1]);
  483. PlayerTextDrawShow(playerid, PullDraw[playerid][2]);
  484. PlayerTextDrawShow(playerid, PullDraw[playerid][3]);
  485. PlayerTextDrawShow(playerid, PullDraw[playerid][4]);
  486. PlayerTextDrawShow(playerid, PullDraw[playerid][5]);
  487. PlayerTextDrawShow(playerid, PullDraw[playerid][6]);
  488. PlayerTextDrawShow(playerid, PullDraw[playerid][7]);
  489. PlayerTextDrawShow(playerid, PullDraw[playerid][8]);
  490. PlayerTextDrawShow(playerid, PullDraw[playerid][9]);
  491. PlayerTextDrawShow(playerid, PullDraw[playerid][10]);
  492. PlayerTextDrawShow(playerid, PullDraw[playerid][11]);
  493. }
  494. forward RemovePullDraws(playerid);
  495. public RemovePullDraws(playerid)
  496. {
  497. PlayerTextDrawHide(playerid, PullDraw[playerid][0]);
  498. PlayerTextDrawHide(playerid, PullDraw[playerid][1]);
  499. PlayerTextDrawHide(playerid, PullDraw[playerid][2]);
  500. PlayerTextDrawHide(playerid, PullDraw[playerid][3]);
  501. PlayerTextDrawHide(playerid, PullDraw[playerid][4]);
  502. PlayerTextDrawHide(playerid, PullDraw[playerid][5]);
  503. PlayerTextDrawHide(playerid, PullDraw[playerid][6]);
  504. PlayerTextDrawHide(playerid, PullDraw[playerid][7]);
  505. PlayerTextDrawHide(playerid, PullDraw[playerid][8]);
  506. PlayerTextDrawHide(playerid, PullDraw[playerid][9]);
  507. PlayerTextDrawHide(playerid, PullDraw[playerid][10]);
  508. PlayerTextDrawHide(playerid, PullDraw[playerid][11]);
  509. }
  510. LoadCASINOPoints()
  511. {
  512. CASINOPoint[0] = CreateDynamicSphere(-2792.5225,91.8275,4500.2012,5);
  513. CASINOPoint[1] = CreateDynamicSphere(-2793.6812,85.8193,4500.201,5);
  514. CASINOPoint[2] = CreateDynamicSphere(-2792.5415,79.5602,4500.2012,5);
  515. CASINOPoint[3] = CreateDynamicSphere(-2761.8157,85.8474,4500.2012,5);
  516. CASINOPoint[4] = CreateDynamicSphere(-2761.8154,87.5817,4500.2012,5);
  517. CASINOPoint[5] = CreateDynamicSphere(-2759.2878,87.7986,4500.2012,5);
  518. CASINOPoint[6] = CreateDynamicSphere(-2759.2888,86.0897,4500.2012,5);
  519. CASINOPoint[7] = CreateDynamicSphere(-2780.5718,50.6592,4500.2012,5);
  520. CASINOPoint[8] = CreateDynamicSphere(-2780.5603,52.8230,4500.2012,5);
  521. CASINOPoint[9] = CreateDynamicSphere(-2780.5342,54.3733,4500.2012,5);
  522. CASINOPoint[10] = CreateDynamicSphere(228.35, 1812.55, 2001.09, 5); // Lucky Cowboy Casino
  523. CASINOPoint[11] = CreateDynamicSphere(200.95, 1828.80, 2001.09, 5); // Lucky Cowboy Casino
  524. CASINOPoint[12] = CreateDynamicSphere(1969.5468,1006.3386,992.4745,5);
  525. CASINOPoint[13] = CreateDynamicSphere(1969.6664,1021.0531,992.4688,5);
  526. CASINOPoint[14] = CreateDynamicSphere(1969.5417,1029.4148,992.4745,5);
  527. CASINOPoint[15] = CreateDynamicSphere(1942.3467,1014.5384,992.4688,5);
  528. CASINOPoint[16] = CreateDynamicSphere(1941.8306,1021.7505,992.4688,5);
  529. }
  530. CasinoPullLoad(playerid)
  531. {
  532. PullDraw[playerid][0] = CreatePlayerTextDraw(playerid,247.000000, 244.000000, "LD_SPAC:white");
  533. PlayerTextDrawAlignment(playerid,PullDraw[playerid][0], 2);
  534. PlayerTextDrawBackgroundColor(playerid,PullDraw[playerid][0], -65281);
  535. PlayerTextDrawFont(playerid,PullDraw[playerid][0], 4);
  536. PlayerTextDrawLetterSize(playerid,PullDraw[playerid][0], 0.500000, 1.000000);
  537. PlayerTextDrawColor(playerid,PullDraw[playerid][0], 255);
  538. PlayerTextDrawSetOutline(playerid,PullDraw[playerid][0], 1);
  539. PlayerTextDrawSetProportional(playerid,PullDraw[playerid][0], 1);
  540. PlayerTextDrawUseBox(playerid,PullDraw[playerid][0], 1);
  541. PlayerTextDrawBoxColor(playerid,PullDraw[playerid][0], 255);
  542. PlayerTextDrawTextSize(playerid,PullDraw[playerid][0], 140.000000, 29.000000);
  543. PlayerTextDrawSetSelectable(playerid,PullDraw[playerid][0], 0);
  544. PullDraw[playerid][1] = CreatePlayerTextDraw(playerid,211.000000, 272.000000, "LD_SPAC:white");
  545. PlayerTextDrawAlignment(playerid,PullDraw[playerid][1], 2);
  546. PlayerTextDrawBackgroundColor(playerid,PullDraw[playerid][1], 255);
  547. PlayerTextDrawFont(playerid,PullDraw[playerid][1], 4);
  548. PlayerTextDrawLetterSize(playerid,PullDraw[playerid][1], 0.500000, 1.000000);
  549. PlayerTextDrawColor(playerid,PullDraw[playerid][1], -65281);
  550. PlayerTextDrawSetOutline(playerid,PullDraw[playerid][1], 0);
  551. PlayerTextDrawSetProportional(playerid,PullDraw[playerid][1], 1);
  552. PlayerTextDrawSetShadow(playerid,PullDraw[playerid][1], 1);
  553. PlayerTextDrawUseBox(playerid,PullDraw[playerid][1], 1);
  554. PlayerTextDrawBoxColor(playerid,PullDraw[playerid][1], 255);
  555. PlayerTextDrawTextSize(playerid,PullDraw[playerid][1], 208.000000, 76.000000);
  556. PlayerTextDrawSetSelectable(playerid,PullDraw[playerid][1], 0);
  557. PullDraw[playerid][2] = CreatePlayerTextDraw(playerid,212.000000, 273.000000, "LD_SPAC:white");
  558. PlayerTextDrawAlignment(playerid,PullDraw[playerid][2], 2);
  559. PlayerTextDrawBackgroundColor(playerid,PullDraw[playerid][2], 255);
  560. PlayerTextDrawFont(playerid,PullDraw[playerid][2], 4);
  561. PlayerTextDrawLetterSize(playerid,PullDraw[playerid][2], 0.500000, 1.000000);
  562. PlayerTextDrawColor(playerid,PullDraw[playerid][2], -16776961);
  563. PlayerTextDrawSetOutline(playerid,PullDraw[playerid][2], 0);
  564. PlayerTextDrawSetProportional(playerid,PullDraw[playerid][2], 1);
  565. PlayerTextDrawSetShadow(playerid,PullDraw[playerid][2], 1);
  566. PlayerTextDrawUseBox(playerid,PullDraw[playerid][2], 1);
  567. PlayerTextDrawBoxColor(playerid,PullDraw[playerid][2], 255);
  568. PlayerTextDrawTextSize(playerid,PullDraw[playerid][2], 206.000000, 74.000000);
  569. PlayerTextDrawSetSelectable(playerid,PullDraw[playerid][2], 0);
  570. PullDraw[playerid][3] = CreatePlayerTextDraw(playerid,213.000000, 274.000000, "LD_SPAC:white");
  571. PlayerTextDrawAlignment(playerid,PullDraw[playerid][3], 2);
  572. PlayerTextDrawBackgroundColor(playerid,PullDraw[playerid][3], 255);
  573. PlayerTextDrawFont(playerid,PullDraw[playerid][3], 4);
  574. PlayerTextDrawLetterSize(playerid,PullDraw[playerid][3], 0.500000, 1.000000);
  575. PlayerTextDrawColor(playerid,PullDraw[playerid][3], 65535);
  576. PlayerTextDrawSetOutline(playerid,PullDraw[playerid][3], 0);
  577. PlayerTextDrawSetProportional(playerid,PullDraw[playerid][3], 1);
  578. PlayerTextDrawSetShadow(playerid,PullDraw[playerid][3], 1);
  579. PlayerTextDrawUseBox(playerid,PullDraw[playerid][3], 1);
  580. PlayerTextDrawBoxColor(playerid,PullDraw[playerid][3], 255);
  581. PlayerTextDrawTextSize(playerid,PullDraw[playerid][3], 204.000000, 72.000000);
  582. PlayerTextDrawSetSelectable(playerid,PullDraw[playerid][3], 0);
  583. PullDraw[playerid][4] = CreatePlayerTextDraw(playerid,214.000000, 275.000000, "LD_SPAC:white");
  584. PlayerTextDrawAlignment(playerid,PullDraw[playerid][4], 2);
  585. PlayerTextDrawBackgroundColor(playerid,PullDraw[playerid][4], 255);
  586. PlayerTextDrawFont(playerid,PullDraw[playerid][4], 4);
  587. PlayerTextDrawLetterSize(playerid,PullDraw[playerid][4], 0.500000, 1.000000);
  588. PlayerTextDrawColor(playerid,PullDraw[playerid][4], 255);
  589. PlayerTextDrawSetOutline(playerid,PullDraw[playerid][4], 0);
  590. PlayerTextDrawSetProportional(playerid,PullDraw[playerid][4], 1);
  591. PlayerTextDrawSetShadow(playerid,PullDraw[playerid][4], 1);
  592. PlayerTextDrawUseBox(playerid,PullDraw[playerid][4], 1);
  593. PlayerTextDrawBoxColor(playerid,PullDraw[playerid][4], 255);
  594. PlayerTextDrawTextSize(playerid,PullDraw[playerid][4], 202.000000, 70.000000);
  595. PlayerTextDrawSetSelectable(playerid,PullDraw[playerid][4], 0);
  596. PullDraw[playerid][5] = CreatePlayerTextDraw(playerid,280.000000, 275.000000, "LD_SPAC:white");
  597. PlayerTextDrawAlignment(playerid,PullDraw[playerid][5], 2);
  598. PlayerTextDrawBackgroundColor(playerid,PullDraw[playerid][5], 255);
  599. PlayerTextDrawFont(playerid,PullDraw[playerid][5], 4);
  600. PlayerTextDrawLetterSize(playerid,PullDraw[playerid][5], 0.500000, 1.000000);
  601. PlayerTextDrawColor(playerid,PullDraw[playerid][5], -65281);
  602. PlayerTextDrawSetOutline(playerid,PullDraw[playerid][5], 0);
  603. PlayerTextDrawSetProportional(playerid,PullDraw[playerid][5], 1);
  604. PlayerTextDrawSetShadow(playerid,PullDraw[playerid][5], 1);
  605. PlayerTextDrawUseBox(playerid,PullDraw[playerid][5], 1);
  606. PlayerTextDrawBoxColor(playerid,PullDraw[playerid][5], 255);
  607. PlayerTextDrawTextSize(playerid,PullDraw[playerid][5], 2.000000, 70.000000);
  608. PlayerTextDrawSetSelectable(playerid,PullDraw[playerid][5], 0);
  609. PullDraw[playerid][6] = CreatePlayerTextDraw(playerid,354.000000, 275.000000, "LD_SPAC:white");
  610. PlayerTextDrawAlignment(playerid,PullDraw[playerid][6], 2);
  611. PlayerTextDrawBackgroundColor(playerid,PullDraw[playerid][6], 255);
  612. PlayerTextDrawFont(playerid,PullDraw[playerid][6], 4);
  613. PlayerTextDrawLetterSize(playerid,PullDraw[playerid][6], 0.500000, 1.000000);
  614. PlayerTextDrawColor(playerid,PullDraw[playerid][6], -65281);
  615. PlayerTextDrawSetOutline(playerid,PullDraw[playerid][6], 0);
  616. PlayerTextDrawSetProportional(playerid,PullDraw[playerid][6], 1);
  617. PlayerTextDrawSetShadow(playerid,PullDraw[playerid][6], 1);
  618. PlayerTextDrawUseBox(playerid,PullDraw[playerid][6], 1);
  619. PlayerTextDrawBoxColor(playerid,PullDraw[playerid][6], 255);
  620. PlayerTextDrawTextSize(playerid,PullDraw[playerid][6], 2.000000, 70.000000);
  621. PlayerTextDrawSetSelectable(playerid,PullDraw[playerid][6], 0);
  622. PullDraw[playerid][7] = CreatePlayerTextDraw(playerid,247.000000, 281.000000, "7");
  623. PlayerTextDrawAlignment(playerid,PullDraw[playerid][7], 2);
  624. PlayerTextDrawBackgroundColor(playerid,PullDraw[playerid][7], 65535);
  625. PlayerTextDrawFont(playerid,PullDraw[playerid][7], 3);
  626. PlayerTextDrawLetterSize(playerid,PullDraw[playerid][7], 1.190000, 6.000000);
  627. PlayerTextDrawColor(playerid,PullDraw[playerid][7], -1);
  628. PlayerTextDrawSetOutline(playerid,PullDraw[playerid][7], 1);
  629. PlayerTextDrawSetProportional(playerid,PullDraw[playerid][7], 1);
  630. PlayerTextDrawSetSelectable(playerid,PullDraw[playerid][7], 0);
  631. PullDraw[playerid][8] = CreatePlayerTextDraw(playerid,319.000000, 281.000000, "7");
  632. PlayerTextDrawAlignment(playerid,PullDraw[playerid][8], 2);
  633. PlayerTextDrawBackgroundColor(playerid,PullDraw[playerid][8], 65535);
  634. PlayerTextDrawFont(playerid,PullDraw[playerid][8], 3);
  635. PlayerTextDrawLetterSize(playerid,PullDraw[playerid][8], 1.190000, 6.000000);
  636. PlayerTextDrawColor(playerid,PullDraw[playerid][8], -1);
  637. PlayerTextDrawSetOutline(playerid,PullDraw[playerid][8], 1);
  638. PlayerTextDrawSetProportional(playerid,PullDraw[playerid][8], 1);
  639. PlayerTextDrawSetSelectable(playerid,PullDraw[playerid][8], 0);
  640. PullDraw[playerid][9] = CreatePlayerTextDraw(playerid,389.000000, 281.000000, "7");
  641. PlayerTextDrawAlignment(playerid,PullDraw[playerid][9], 2);
  642. PlayerTextDrawBackgroundColor(playerid,PullDraw[playerid][9], 65535);
  643. PlayerTextDrawFont(playerid,PullDraw[playerid][9], 3);
  644. PlayerTextDrawLetterSize(playerid,PullDraw[playerid][9], 1.190000, 6.000000);
  645. PlayerTextDrawColor(playerid,PullDraw[playerid][9], -1);
  646. PlayerTextDrawSetOutline(playerid,PullDraw[playerid][9], 1);
  647. PlayerTextDrawSetProportional(playerid,PullDraw[playerid][9], 1);
  648. PlayerTextDrawSetSelectable(playerid,PullDraw[playerid][9], 0);
  649. PullDraw[playerid][10] = CreatePlayerTextDraw(playerid,319.000000, 249.000000, "ROTHSCHILD INC");
  650. PlayerTextDrawAlignment(playerid,PullDraw[playerid][10], 2);
  651. PlayerTextDrawBackgroundColor(playerid,PullDraw[playerid][10], -1);
  652. PlayerTextDrawFont(playerid,PullDraw[playerid][10], 2);
  653. PlayerTextDrawLetterSize(playerid,PullDraw[playerid][10], 0.410000, 2.099999);
  654. PlayerTextDrawColor(playerid,PullDraw[playerid][10], 65535);
  655. PlayerTextDrawSetOutline(playerid,PullDraw[playerid][10], 0);
  656. PlayerTextDrawSetProportional(playerid,PullDraw[playerid][10], 1);
  657. PlayerTextDrawSetShadow(playerid,PullDraw[playerid][10], 0);
  658. PlayerTextDrawSetSelectable(playerid,PullDraw[playerid][10], 0);
  659. PullDraw[playerid][11] = CreatePlayerTextDraw(playerid,318.000000, 247.000000, "ROTHSCHILD INC");
  660. PlayerTextDrawAlignment(playerid,PullDraw[playerid][11], 2);
  661. PlayerTextDrawBackgroundColor(playerid,PullDraw[playerid][11], -1);
  662. PlayerTextDrawFont(playerid,PullDraw[playerid][11], 2);
  663. PlayerTextDrawLetterSize(playerid,PullDraw[playerid][11], 0.410000, 2.099999);
  664. PlayerTextDrawColor(playerid,PullDraw[playerid][11], -1);
  665. PlayerTextDrawSetOutline(playerid,PullDraw[playerid][11], 0);
  666. PlayerTextDrawSetProportional(playerid,PullDraw[playerid][11], 1);
  667. PlayerTextDrawSetShadow(playerid,PullDraw[playerid][11], 0);
  668. PlayerTextDrawSetSelectable(playerid,PullDraw[playerid][11], 0);
  669. }
  670. hook OnPlayerConnect(playerid)
  671. {
  672. CasinoPullLoad(playerid);
  673. SetPVarInt(playerid, "pRollDiceID", INVALID_PLAYER_ID);
  674. DestroyOfferDiceData(playerid);
  675. }
  676. hook OnPlayerDisconnect(playerid)
  677. {
  678. PlayerTextDrawHide(playerid, PullDraw[playerid][0]);
  679. PlayerTextDrawHide(playerid, PullDraw[playerid][1]);
  680. PlayerTextDrawHide(playerid, PullDraw[playerid][2]);
  681. PlayerTextDrawHide(playerid, PullDraw[playerid][3]);
  682. PlayerTextDrawHide(playerid, PullDraw[playerid][4]);
  683. PlayerTextDrawHide(playerid, PullDraw[playerid][5]);
  684. PlayerTextDrawHide(playerid, PullDraw[playerid][6]);
  685. PlayerTextDrawHide(playerid, PullDraw[playerid][7]);
  686. PlayerTextDrawHide(playerid, PullDraw[playerid][8]);
  687. SendClientMessage(GetPVarInt(playerid, "pRollDiceID"), COLOR_LIGHTBLUE, "The player you offered dice to, left the server.");
  688. DeleteDiceData(playerid);
  689. }