Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Bowling 1.1 by nexotronix

By: a guest on Mar 26th, 2011  |  syntax: C++  |  size: 139.47 KB  |  views: 478  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. /*
  2. ***********************************
  3. The Script: San Fierro Bowling.
  4. ***********************************
  5.  
  6. ***********************************
  7. Author: Nexotronix ( Dmitry Nedoseko ).
  8. ***********************************
  9.  
  10. ***********************************
  11. Authors Skype: nexotronix.
  12. ***********************************
  13.  
  14. ***********************************
  15. Authors MSN: nexotronix@hotmail.com
  16. ***********************************
  17.  
  18. */
  19.  
  20. #include a_samp
  21. #include streamer
  22. #include dini
  23. #include zcmd
  24. #include audio
  25. #include sscanf2
  26.  
  27. #pragma unused strtok
  28. #pragma unused ret_memcpy
  29.  
  30. #define VERSION "1.1"
  31. #define MAX_USERS 50
  32. #define MAX_PINS 10
  33. #define MAX_BOWLING_ROADS 5
  34.  
  35. #define DIALOG_BOWLING                  1000
  36. #define DIALOG_BOWLING_TIME     1001
  37. #define DIALOG_ADD_TIME                 1002
  38. #define DIALOG_ROAD                     1003
  39. #define DIALOG_BOWLING_STATS    1004
  40.  
  41. #define COLOR_CMDERROR  0xB13434AA
  42.  
  43. //bowling
  44.         //pins status
  45. #define PIN_GOAWAY      0
  46. #define PIN_LAST        1
  47.         //players status
  48. #define F_BOWLING_THROW 0
  49. #define S_BOWLING_THROW 1
  50. #define N_BOWLING_THROW 2
  51.         //roads status
  52. #define ROAD_EMPTY 0
  53. #define ROAD_BUSY 1
  54. #define ROAD_NONE 255
  55.         //Y Coordinate for roads
  56. #define Y_ROAD_2 1.43993652586
  57. #define Y_ROAD_3 3.11993652586
  58. #define Y_ROAD_4 4.55993652586
  59. #define Y_ROAD_5 6.10243269586
  60.         //speed of ball
  61. #define BALL_SPEED 5.0
  62. #define BALL_RUN_TIME 1950
  63. //bowling
  64. new BowlingPins[MAX_BOWLING_ROADS][MAX_PINS];//pins
  65. new BowlingMinutes[MAX_USERS];
  66. new BowlingSeconds[MAX_USERS];
  67. new BowlingPinsWaitEndTimer[MAX_USERS];
  68. new BowlingPinsWaitTimer[MAX_USERS];
  69. new BowlingTimer[MAX_BOWLING_ROADS];//timer
  70. new BowlingStatus[MAX_USERS];//statusof playing player
  71. new PinsLeft[MAX_BOWLING_ROADS][MAX_USERS];//how much pins left after first try
  72. new LastPin[MAX_BOWLING_ROADS][MAX_PINS][MAX_USERS];//how much pins left after second try
  73. new AbleToPlay[MAX_USERS];//players able to play
  74. new PlayersBowlingRoad[MAX_USERS];//road what player using
  75. new BowlingRoadStatus[MAX_BOWLING_ROADS];//status of th road
  76. new Text3D:BowlingRoadScreen[MAX_BOWLING_ROADS];//the screens
  77. new BowlingBall[MAX_BOWLING_ROADS];
  78. new BallGoing[MAX_USERS];
  79. new BallRun[MAX_USERS];
  80. new PlayersBowlingScore[MAX_USERS];
  81. new BestScore[MAX_USERS];
  82. new PlayerStrikes[MAX_USERS];
  83. new LastTimePlayed[MAX_USERS][128];
  84. new BowlingCP1;
  85. new Music[MAX_USERS];
  86. new BarGirlBusy;
  87. new PlayerOrder[MAX_PLAYERS][128];
  88. new Text3D:DDJ;
  89. new HelpBowlingRoadPickup[MAX_BOWLING_ROADS];//pickups of bowling
  90. enum PKS
  91. {
  92.         bowlEnter,
  93.         bowlExit
  94. }
  95. new Pickup[PKS];
  96.  
  97. public OnFilterScriptInit()
  98. {
  99.     print("\n\n\n---------------------------------------------------------");
  100.         print("  The Script:            San Fierro Bowling.             ");
  101.         print("  Author:                Nexotronix ( Dmitry Nedoseko ). ");
  102.         print("  Authors Skype:         nexotronix.                     ");
  103.         print("  Date of Start:         January 29, 2011.               ");
  104.         printf("  Version:              %s.                             ",VERSION);
  105.         print("---------------------------------------------------------\n\n\n");
  106.         //timers
  107.         SetTimer("UpdateDjAnim",20000,true);
  108.     SetTimer("UpdateDjText",1000,true);
  109.         //npc
  110.     ConnectNPC("Dj_Nexotronix","nexotronix");
  111.         ConnectNPC("BarGirl","bowling_barman");
  112.         ConnectNPC("Administrator","bowling_admin");
  113.     //pickups
  114.         Pickup[bowlExit] = CreateDynamicPickup(1318,23, -1992.8255615234, 407.70401000977, 2.8625273704529, -1);//pickup inside
  115.         Pickup[bowlEnter] = CreateDynamicPickup(1318,23, -1992.8215,407.0989,35.4719, -1);//pickupoutside
  116.         //3dTexts
  117.         BowlingRoadScreen[0] = CreateDynamic3DTextLabel("{008800}[{FFFFFF} Road 1{008800} ]\n Empty",0xffffffff,-1974.7992,417.17291259766,4.7010, 15.0);
  118.         BowlingRoadScreen[1] = CreateDynamic3DTextLabel("{008800}[{FFFFFF} Road 2{008800} ]\n Empty",0xffffffff,-1974.7992,415.69528198242,4.7010, 15.0);
  119.         BowlingRoadScreen[2] = CreateDynamic3DTextLabel("{008800}[{FFFFFF} Road 3{008800} ]\n Empty",0xffffffff,-1974.7992,414.19616699219,4.7010, 15.0);
  120.         BowlingRoadScreen[3] = CreateDynamic3DTextLabel("{008800}[{FFFFFF} Road 4{008800} ]\n Empty",0xffffffff,-1974.7992,412.72177124023,4.7010, 15.0);
  121.         BowlingRoadScreen[4] = CreateDynamic3DTextLabel("{008800}[{FFFFFF} Road 5{008800} ]\n Empty",0xffffffff,-1974.7992,411.2473449707,4.7010, 15.0);
  122.         DDJ = CreateDynamic3DTextLabel("Dj Nexotronix" , 0xFFFFFFFF, -1965.1602+0.6,402.8761,3.2767+1, 50.0);
  123.     CreateDynamic3DTextLabel("Write in chat what do u want:{FFFFFF}\n \"beer\"  \"wine\"  \"shampagne\"  \"vodka\"  \"sprunk\" \n{00FF00}And girl will give it to you!" , 0xFFFF00FF, -1979.6201,397.0821-0.13,2.5010+1.67, 20.0);
  124.         CreateDynamic3DTextLabel("[* {FFFFFF}Bowling {0C9BCB}*]",0x0C9BCBFF,-1992.8215,407.0989,36.4719,40.0);
  125.     //checkpoints
  126.         BowlingCP1 = CreateDynamicCP(-1988.7483,414.4880,1.6010,1.5,-1,1);
  127.     //objects
  128.     //bowling club
  129.         CreateDynamicObject(16475,-1983.98339844,401.38183594,34.15666199,0.00000000,0.00000000,90.00000000); //object(des_stwnbowl) (1)
  130.         CreateDynamicObject(14671,-1988.21679688,409.67578125,3.48274970,0.00000000,0.00000000,0.00000000); //object(int_7_11a5) (1)
  131.         CreateDynamicObject(8710,-1992.11621094,447.90722656,-32.64123917,0.00000000,0.00000000,270.00000000); //object(bnuhotel01_lvs) (1)
  132.         CreateDynamicObject(8710,-1971.84484863,366.69989014,-26.97655869,0.00000000,0.00000000,90.00000000); //object(bnuhotel01_lvs) (4)
  133.         CreateDynamicObject(8710,-2017.58825684,395.96643066,-27.08176041,0.00000000,0.00000000,90.00000000); //object(bnuhotel01_lvs) (5)
  134.         CreateDynamicObject(7191,-1953.28332520,417.73162842,-0.34434167,0.00000000,0.00000000,90.00000000); //object(vegasnnewfence2b) (1)
  135.         CreateDynamicObject(7191,-1953.28332520,416.19857788,-0.34434167,0.00000000,0.00000000,90.00000000); //object(vegasnnewfence2b) (2)
  136.         CreateDynamicObject(7191,-1953.26269531,415.81542969,1.41164804,0.00000000,90.00000000,89.99450684); //object(vegasnnewfence2b) (3)
  137.         CreateDynamicObject(7191,-1953.26562500,411.89160156,1.41164804,0.00000000,90.00000000,89.99447632); //object(vegasnnewfence2b) (4)
  138.         CreateDynamicObject(7191,-1953.28332520,414.63092041,-0.34434167,0.00000000,0.00000000,90.00000000); //object(vegasnnewfence2b) (6)
  139.         CreateDynamicObject(7191,-1953.28320312,413.08496094,-0.34434167,0.00000000,0.00000000,90.00000000); //object(vegasnnewfence2b) (7)
  140.         CreateDynamicObject(7191,-1953.28332520,411.58847046,-0.34434167,0.00000000,0.00000000,90.00000000); //object(vegasnnewfence2b) (8)
  141.         CreateDynamicObject(7191,-1953.28332520,410.03662109,-0.34434167,0.00000000,0.00000000,90.00000000); //object(vegasnnewfence2b) (9)
  142.         CreateDynamicObject(1555,-1963.70788574,417.80877686,1.46596777,90.00000000,180.59289551,179.65710449); //object(gen_doorext17) (1)
  143.         CreateDynamicObject(7191,-1942.21752930,415.83892822,2.43367004,0.00000000,90.00000000,89.99981689); //object(vegasnnewfence2b) (13)
  144.         CreateDynamicObject(7191,-1942.21777344,411.92166138,2.43367004,0.00000000,90.00000000,89.99996948); //object(vegasnnewfence2b) (14)
  145.         CreateDynamicObject(1555,-1963.70703125,415.34472656,1.46596777,90.00000000,180.58769226,179.65399170); //object(gen_doorext17) (2)
  146.         CreateDynamicObject(1555,-1963.68554688,412.84765625,1.46596777,90.00000000,180.58227539,179.65393066); //object(gen_doorext17) (3)
  147.         CreateDynamicObject(1555,-1963.68554688,412.58203125,1.46596777,90.00000000,179.41784668,180.81842041); //object(gen_doorext17) (4)
  148.         CreateDynamicObject(1555,-1962.98022461,417.62829590,0.90899563,0.00000000,270.00000000,90.00000000); //object(gen_doorext17) (5)
  149.         CreateDynamicObject(1555,-1962.98022461,415.16979980,0.90899563,0.00000000,270.00000000,89.99993896); //object(gen_doorext17) (6)
  150.         CreateDynamicObject(1555,-1962.98022461,412.70278931,0.90899563,0.00000000,270.00000000,89.99993896); //object(gen_doorext17) (7)
  151.         CreateDynamicObject(1555,-1962.98022461,412.64303589,0.90899563,0.00000000,270.00000000,90.00000000); //object(gen_doorext17) (8)
  152.         CreateDynamicObject(7191,-1942.20117188,410.03662109,0.52564448,0.00000000,0.00000000,90.00000000); //object(vegasnnewfence2b) (15)
  153.         CreateDynamicObject(7191,-1942.20117188,411.58847046,0.52564448,0.00000000,0.00000000,90.00000000); //object(vegasnnewfence2b) (16)
  154.         CreateDynamicObject(7191,-1942.20117188,413.08575439,0.52564448,0.00000000,0.00000000,90.00000000); //object(vegasnnewfence2b) (17)
  155.         CreateDynamicObject(7191,-1942.20117188,414.63085938,0.52564448,0.00000000,0.00000000,90.00000000); //object(vegasnnewfence2b) (18)
  156.         CreateDynamicObject(7191,-1942.20117188,416.19857788,0.52564448,0.00000000,0.00000000,90.00000000); //object(vegasnnewfence2b) (19)
  157.         CreateDynamicObject(7191,-1942.20117188,417.73162842,0.52564448,0.00000000,0.00000000,90.00000000); //object(vegasnnewfence2b) (20)
  158.         CreateDynamicObject(3437,-1963.50708008,397.80062866,-0.30842876,0.00000000,0.00000000,270.00000000); //object(ballypllr01_lvs) (2)
  159.         CreateDynamicObject(3437,-1963.60302734,408.50720215,-0.30842876,0.00000000,0.00000000,270.00000000); //object(ballypllr01_lvs) (3)
  160.         CreateDynamicObject(3472,-1960.08154297,417.09658813,-6.13266516,0.00000000,0.00000000,304.50000000); //object(circuslampost03) (1)
  161.         CreateDynamicObject(3472,-1960.00000000,414.12844849,-6.13266516,0.00000000,0.00000000,304.50000000); //object(circuslampost03) (2)
  162.         CreateDynamicObject(3472,-1960.19006348,411.00000000,-6.13266516,0.00000000,0.00000000,304.50000000); //object(circuslampost03) (4)
  163.         CreateDynamicObject(3472,-1960.00830078,402.89712524,-6.13266516,0.00000000,0.00000000,60.49621582); //object(circuslampost03) (5)
  164.         CreateDynamicObject(1594,-1970.30737305,398.48526001,1.97795916,0.00000000,0.00000000,0.00000000); //object(chairsntable) (1)
  165.         CreateDynamicObject(1594,-1969.63330078,403.06884766,1.97795916,0.00000000,0.00000000,0.00000000); //object(chairsntable) (2)
  166.         CreateDynamicObject(1594,-1973.96972656,400.88070679,1.97795916,0.00000000,0.00000000,0.00000000); //object(chairsntable) (3)
  167.         CreateDynamicObject(1594,-1973.36218262,405.84259033,1.97795916,0.00000000,0.00000000,0.00000000); //object(chairsntable) (4)
  168.         CreateDynamicObject(1594,-1966.74902344,407.34863281,1.97795916,0.00000000,0.00000000,0.00000000); //object(chairsntable) (5)
  169.         CreateDynamicObject(1792,-1974.79187012,417.17291260,4.84897375,22.00000000,0.00000000,270.00000000); //ekran(1)
  170.         CreateDynamicObject(1792,-1974.79284668,415.69528198,4.84897375,21.99462891,0.00000000,270.00000000); //ekran(2)
  171.         CreateDynamicObject(1792,-1974.79138184,414.19616699,4.84897375,21.99462891,0.00000000,270.00000000); //ekran(3)
  172.         CreateDynamicObject(1792,-1974.79162598,412.72177124,4.84897375,21.99462891,0.00000000,270.00000000); //ekran(4)
  173.         CreateDynamicObject(1792,-1974.79040527,411.24734497,4.84897375,21.99462891,0.00000000,270.00000000); //ekran(5)
  174.         CreateDynamicObject(1670,-1973.47375488,405.93463135,2.45557547,0.00000000,0.00000000,0.00000000); //object(propcollecttable) (1)
  175.         CreateDynamicObject(1670,-1969.75622559,402.97250366,2.45557547,0.00000000,0.00000000,0.00000000); //object(propcollecttable) (2)
  176.         CreateDynamicObject(1670,-1966.92077637,407.18273926,2.45557547,0.00000000,0.00000000,0.00000000); //object(propcollecttable) (3)
  177.         CreateDynamicObject(2748,-1981.04077148,416.99365234,2.09871221,0.00000000,0.00000000,90.50000000); //object(cj_donut_chair2) (1)
  178.         CreateDynamicObject(2748,-1981.02392578,415.54788208,2.09871221,0.00000000,0.00000000,90.49987793); //object(cj_donut_chair2) (2)
  179.         CreateDynamicObject(2748,-1981.02441406,413.97348022,2.09871221,0.00000000,0.00000000,90.49987793); //object(cj_donut_chair2) (3)
  180.         CreateDynamicObject(2748,-1981.02026367,412.41012573,2.09871221,0.00000000,0.00000000,90.49987793); //object(cj_donut_chair2) (4)
  181.         CreateDynamicObject(2748,-1980.99951172,410.86880493,2.09871221,0.00000000,0.00000000,90.49987793); //object(cj_donut_chair2) (5)
  182.         CreateDynamicObject(2763,-1979.17871094,410.35504150,1.90615499,0.00000000,0.00000000,0.00000000); //object(cj_chick_table_2) (1)
  183.         CreateDynamicObject(2763,-1979.17871094,412.01336670,1.90615499,0.00000000,0.00000000,0.00000000); //object(cj_chick_table_2) (2)
  184.         CreateDynamicObject(2763,-1979.17871094,413.81100464,1.90615499,0.00000000,0.00000000,0.00000000); //object(cj_chick_table_2) (3)
  185.         CreateDynamicObject(2763,-1979.17871094,417.39871216,1.90615499,0.00000000,0.00000000,0.00000000); //object(cj_chick_table_2) (4)
  186.         CreateDynamicObject(2763,-1979.17871094,415.60202026,1.90615499,0.00000000,0.00000000,0.00000000); //object(cj_chick_table_2) (5)
  187.         CreateDynamicObject(8710,-1938.82910156,417.89843750,-47.92550278,0.00000000,0.00000000,269.74182129); //object(bnuhotel01_lvs) (6)
  188.         CreateDynamicObject(2773,-1974.29052734,410.05731201,1.94319594,0.00000000,0.00000000,90.25000000); //object(cj_airprt_bar) (1)
  189.         CreateDynamicObject(2773,-1972.36218262,410.06097412,1.94319594,0.00000000,0.00000000,90.24719238); //object(cj_airprt_bar) (2)
  190.         CreateDynamicObject(2773,-1970.43786621,410.06890869,1.94319594,0.00000000,0.00000000,90.24719238); //object(cj_airprt_bar) (3)
  191.         CreateDynamicObject(2773,-1968.51269531,410.07226562,1.94319594,0.00000000,0.00000000,90.24719238); //object(cj_airprt_bar) (4)
  192.         CreateDynamicObject(2773,-1966.58886719,410.08300781,1.94319594,0.00000000,0.00000000,90.24719238); //object(cj_airprt_bar) (5)
  193.         CreateDynamicObject(2773,-1964.68005371,410.09939575,1.94319594,0.00000000,0.00000000,90.24719238); //object(cj_airprt_bar) (6)
  194.         CreateDynamicObject(2350,-1988.15979004,414.52291870,1.87311888,0.00000000,0.00000000,0.00000000); //object(cj_barstool_2) (2)
  195.         CreateDynamicObject(14831,-1986.83642578,403.54486084,3.05480051,0.00000000,0.00000000,180.00000000); //object(lm_stripbar) (2)
  196.         CreateDynamicObject(2350,-1989.39367676,414.60711670,1.87311888,0.00000000,0.00000000,0.00000000); //object(cj_barstool_2) (9)
  197.         CreateDynamicObject(2350,-1990.86682129,414.64779663,1.87311888,0.00000000,0.00000000,0.00000000); //object(cj_barstool_2) (10)
  198.         CreateDynamicObject(2350,-1992.25915527,414.65734863,1.87311888,0.00000000,0.00000000,0.00000000); //object(cj_barstool_2) (11)
  199.         CreateDynamicObject(1557,-1993.47424316,406.20376587,1.50096750,0.00000000,0.00000000,90.00000000); //object(gen_doorext19) (1)
  200.         CreateDynamicObject(1557,-1993.47460938,409.21188354,1.50096750,0.00000000,0.00000000,270.00000000); //object(gen_doorext19) (2)
  201.         CreateDynamicObject(16151,-1981.04028320,397.52371216,1.82596719,0.00000000,0.00000000,270.00000000); //object(ufo_bar) (1)
  202.         CreateDynamicObject(1665,-1979.17504883,411.95642090,2.33454275,0.00000000,0.00000000,0.00000000); //object(propashtray1) (1)
  203.         CreateDynamicObject(1665,-1979.17883301,410.33941650,2.33454275,0.00000000,0.00000000,0.00000000); //object(propashtray1) (2)
  204.         CreateDynamicObject(1665,-1979.44213867,413.51092529,2.33454275,0.00000000,0.00000000,0.00000000); //object(propashtray1) (3)
  205.         CreateDynamicObject(1665,-1988.91394043,415.37057495,2.62042212,0.00000000,0.00000000,0.00000000); //object(propashtray1) (4)
  206.         CreateDynamicObject(1665,-1970.39685059,398.32879639,2.46602869,0.00000000,0.00000000,0.00000000); //object(propashtray1) (5)
  207.         CreateDynamicObject(1664,-1970.55346680,398.23052979,2.62227917,0.00000000,0.00000000,0.00000000); //object(propwinebotl2) (1)
  208.         CreateDynamicObject(1667,-1970.59387207,398.13912964,2.54415464,0.00000000,0.00000000,0.00000000); //object(propwineglass1) (1)
  209.         CreateDynamicObject(1551,-1979.34191895,413.94085693,2.56435370,0.00000000,0.00000000,0.00000000); //object(dyn_wine_big) (1)
  210.         CreateDynamicObject(1544,-1979.09692383,417.29763794,2.32408953,0.00000000,0.00000000,0.00000000); //object(cj_beer_b_1) (1)
  211.         CreateDynamicObject(1544,-1978.97949219,417.19369507,2.32408953,0.00000000,0.00000000,0.00000000); //object(cj_beer_b_1) (2)
  212.         CreateDynamicObject(1544,-1979.20446777,417.08142090,2.32408953,0.00000000,0.00000000,0.00000000); //object(cj_beer_b_1) (3)
  213.         CreateDynamicObject(1546,-1979.40930176,415.48516846,2.41321850,0.00000000,0.00000000,0.00000000); //object(cj_pint_glass) (1)
  214.         CreateDynamicObject(2232,-1963.27111816,417.94244385,4.82136917,0.00000000,179.99993896,315.50000000); //object(med_speaker_4) (1)
  215.         CreateDynamicObject(2232,-1963.86682129,396.67074585,4.74921751,356.01208496,177.99517822,241.87011719); //object(med_speaker_4) (2)
  216.         CreateDynamicObject(1594,-1976.69604492,404.03070068,1.97795916,0.00000000,0.00000000,0.00000000); //object(chairsntable) (8)
  217.         CreateDynamicObject(1594,-1980.65112305,402.00286865,1.97795916,0.00000000,0.00000000,0.00000000); //object(chairsntable) (9)
  218.         CreateDynamicObject(1594,-1980.81201172,405.61914062,1.97795916,0.00000000,0.00000000,0.00000000); //object(chairsntable) (10)
  219.         CreateDynamicObject(1594,-1976.61096191,407.31570435,1.97795916,0.00000000,0.00000000,0.00000000); //object(chairsntable) (11)
  220.         CreateDynamicObject(2190,-1988.31689453,415.55139160,2.60996890,0.00000000,0.00000000,180.00000000); //object(pc_1) (1)
  221.         CreateDynamicObject(2190,-1989.34155273,415.80358887,2.60996890,0.00000000,0.00000000,139.99450684); //object(pc_1) (2)
  222.         CreateDynamicObject(2184,-1966.09143066,403.89233398,1.50096750,0.00000000,0.00000000,272.00000000); //object(med_office6_desk_2) (1)
  223.         CreateDynamicObject(1958,-1965.77929688,402.82293701,2.32661963,0.00000000,0.00000000,92.00000000); //object(mxr_mix_body) (1)
  224.         CreateDynamicObject(2261,-1969.43139648,417.67276001,3.95796394,0.00000000,0.00000000,0.00000000); //object(frame_slim_2) (1)
  225.         CreateDynamicObject(2259,-1988.78894043,417.67144775,3.81773138,0.00000000,0.00000000,0.00000000); //object(frame_clip_6) (1)
  226.         CreateDynamicObject(2258,-1977.10363770,418.14941406,4.20190430,0.00000000,0.00000000,0.00000000); //object(frame_clip_5) (1)
  227.         CreateDynamicObject(2262,-1975.07031250,396.92706299,4.19417381,0.00000000,0.00000000,180.00000000); //object(frame_slim_3) (1)
  228.         CreateDynamicObject(2266,-1968.56567383,396.92285156,3.97239256,0.00000000,0.00000000,180.00000000); //object(frame_wood_5) (1)
  229.         CreateDynamicObject(2894,-1987.28552246,417.84539795,2.55099177,0.00000000,0.00000000,0.00000000); //object(kmb_rhymesbook) (1)
  230.         CreateDynamicObject(16780,-1986.86901855,406.90533447,5.66260290,0.00000000,0.00000000,0.00000000); //object(ufo_light03) (2)
  231.         CreateDynamicObject(16780,-1979.54589844,401.62506104,5.28252983,0.00000000,0.00000000,0.00000000); //object(ufo_light03) (3)
  232.         CreateDynamicObject(16780,-1964.50903320,402.79486084,5.65087414,0.00000000,0.00000000,0.00000000); //object(ufo_light03) (4)
  233.         CreateDynamicObject(16780,-1971.69982910,407.29949951,5.69184160,0.00000000,0.00000000,0.00000000); //object(ufo_light03) (5)
  234.         CreateDynamicObject(1954,-1965.72692871,403.66027832,2.38389516,0.00000000,0.00000000,250.00000000); //object(turn_table_r) (1)
  235.         CreateDynamicObject(1957,-1965.60949707,402.02478027,2.38389516,0.00000000,0.00000000,300.00000000); //object(turn_tablel) (1)
  236.         CreateDynamicObject(1962,-1965.63891602,402.05975342,2.45170474,88.00000000,0.00000000,0.00000000); //object(record1) (1)
  237.         CreateDynamicObject(1962,-1965.71264648,403.71997070,2.45170474,87.99499512,0.00000000,0.00000000); //object(record1) (2)
  238.         CreateDynamicObject(2232,-1965.78967285,404.87741089,2.09884357,0.00000000,0.00000000,272.00000000); //object(med_speaker_4) (4)
  239.         CreateDynamicObject(2232,-1965.84448242,400.83706665,2.09884357,0.00000000,0.00000000,271.99951172); //object(med_speaker_4) (5)
  240.         CreateDynamicObject(2229,-1963.25744629,406.61846924,1.50096750,0.00000000,0.00000000,270.00000000); //object(swank_speaker) (1)
  241.         CreateDynamicObject(2229,-1963.19604492,399.05960083,1.50096750,0.00000000,0.00000000,270.00000000); //object(swank_speaker) (2)
  242.         CreateDynamicObject(1656,-1974.78381348,416.22280884,1.63934100,0.00000000,0.00000000,0.00000000); //object(esc_step) (1)
  243.         CreateDynamicObject(1656,-1974.78381348,417.70559692,1.63934100,0.00000000,0.00000000,0.00000000); //object(esc_step) (2)
  244.         CreateDynamicObject(1656,-1974.78063965,414.61547852,1.63934100,0.00000000,0.00000000,0.00000000); //object(esc_step) (3)
  245.         CreateDynamicObject(1656,-1974.78271484,413.08093262,1.63934100,0.00000000,0.00000000,0.00000000); //object(esc_step) (4)
  246.         CreateDynamicObject(1656,-1974.78564453,411.56622314,1.63934100,0.00000000,0.00000000,0.00000000); //object(esc_step) (5)
  247.         CreateDynamicObject(1367,-1974.32617188,413.09866333,1.38492167,0.00000000,0.00000000,270.00000000); //object(cj_postbox) (1)
  248.         CreateDynamicObject(1367,-1974.32812500,414.62768555,1.38492167,0.00000000,0.00000000,270.00000000); //object(cj_postbox) (2)
  249.         CreateDynamicObject(1367,-1974.32714844,416.26660156,1.38492167,0.00000000,0.00000000,270.00000000); //object(cj_postbox) (3)
  250.         CreateDynamicObject(1367,-1974.32543945,417.75982666,1.38492167,0.00000000,0.00000000,270.00000000); //object(cj_postbox) (4)
  251.         CreateDynamicObject(1367,-1974.32519531,411.55346680,1.38492167,0.00000000,0.00000000,270.00000000); //object(cj_postbox) (5)
  252.         CreateDynamicObject(3065,-1974.61511230,417.68078613,1.79999089,0.00000000,0.00000000,0.00000000); //object(bball_col) (1)
  253.         CreateDynamicObject(3065,-1974.91210938,417.68667603,1.79999089,0.00000000,0.00000000,0.00000000); //object(bball_col) (2)
  254.         CreateDynamicObject(3065,-1974.59570312,416.26126099,1.79999089,0.00000000,0.00000000,0.00000000); //object(bball_col) (4)
  255.         CreateDynamicObject(3065,-1974.90429688,416.25292969,1.79999089,0.00000000,0.00000000,0.00000000); //object(bball_col) (5)
  256.         CreateDynamicObject(3065,-1975.20019531,416.25146484,1.79999089,0.00000000,0.00000000,0.00000000); //object(bball_col) (6)
  257.         CreateDynamicObject(3065,-1974.72448730,414.64627075,1.79999089,0.00000000,0.00000000,0.00000000); //object(bball_col) (7)
  258.         CreateDynamicObject(3065,-1975.07568359,414.65039062,1.79999089,0.00000000,0.00000000,0.00000000); //object(bball_col) (8)
  259.         CreateDynamicObject(3065,-1975.06469727,413.09951782,1.79999089,0.00000000,0.00000000,0.00000000); //object(bball_col) (9)
  260.         CreateDynamicObject(3065,-1975.34716797,413.12374878,1.79999089,0.00000000,0.00000000,0.00000000); //object(bball_col) (10)
  261.         CreateDynamicObject(3065,-1974.59472656,413.08886719,1.79999089,0.00000000,0.00000000,0.00000000); //object(bball_col) (11)
  262.         CreateDynamicObject(3065,-1974.77441406,411.65020752,1.79999089,0.00000000,0.00000000,0.00000000); //object(bball_col) (12)
  263.         CreateDynamicObject(3065,-1975.04772949,411.61264038,1.79999089,0.00000000,0.00000000,0.00000000); //object(bball_col) (13)
  264.         CreateDynamicObject(3065,-1975.30554199,411.56716919,1.79999089,0.00000000,0.00000000,0.00000000); //object(bball_col) (14)
  265.         CreateDynamicObject(1557,-1991.94335938,405.60870361,34.01562500,0.00000000,0.00000000,90.00000000); //object(gen_doorext19) (3)
  266.         CreateDynamicObject(1557,-1991.93945312,408.63739014,34.01562500,0.00000000,0.00000000,269.75000000); //object(gen_doorext19) (4)
  267.         CreateDynamicObject(2048,-1987.92822266,396.46463013,3.79603434,0.00000000,0.00000000,179.75000000); //object(cj_flag2) (1)
  268.         CreateDynamicObject(3034,-1993.34851074,411.61630249,3.53044128,0.00000000,0.00000000,90.00000000); //object(bd_window) (1)
  269.         CreateDynamicObject(3034,-1993.38757324,403.93206787,3.51708794,0.00000000,0.00000000,90.00000000); //object(bd_window) (2)
  270.         CreateDynamicObject(3034,-1993.41223145,399.30670166,3.49105072,0.00000000,0.00000000,90.00000000); //object(bd_window) (3)
  271.         CreateDynamicObject(2125,-1977.71960449,413.82806396,1.81084192,0.00000000,0.00000000,0.00000000); //object(med_din_chair_1) (1)
  272.         CreateDynamicObject(2125,-1977.71960449,412.07031250,1.81084192,0.00000000,0.00000000,0.00000000); //object(med_din_chair_1) (2)
  273.         CreateDynamicObject(2125,-1977.71960449,410.33688354,1.81084192,0.00000000,0.00000000,0.00000000); //object(med_din_chair_1) (3)
  274.         CreateDynamicObject(2125,-1977.71960449,415.64382935,1.81084192,0.00000000,0.00000000,0.00000000); //object(med_din_chair_1) (4)
  275.         CreateDynamicObject(2125,-1977.71960449,417.35659790,1.81084192,0.00000000,0.00000000,0.00000000); //object(med_din_chair_1) (5)
  276.         CreateDynamicObject(1704,-1992.15136719,399.97558594,1.50096750,0.00000000,0.00000000,90.00000000); //object(kb_chair03) (1)
  277.         CreateDynamicObject(1704,-1992.19677734,398.14965820,1.50096750,0.00000000,0.00000000,90.00000000); //object(kb_chair03) (2)
  278.         CreateDynamicObject(1704,-1990.13342285,397.15026855,1.50096750,0.00000000,0.00000000,178.50000000); //object(kb_chair03) (3)
  279.         CreateDynamicObject(1704,-1988.88659668,399.22921753,1.50096750,0.00000000,0.00000000,270.00000000); //object(kb_chair03) (4)
  280.         CreateDynamicObject(1704,-1988.92846680,400.91891479,1.50096750,0.00000000,0.00000000,270.00000000); //object(kb_chair03) (5)
  281.         CreateDynamicObject(2311,-1990.53735352,400.35412598,1.50096750,0.00000000,0.00000000,270.00000000); //object(cj_tv_table2) (1)
  282.         CreateDynamicObject(1704,-1990.97985840,402.07971191,1.50096750,0.00000000,0.00000000,359.50000000); //object(kb_chair03) (6)
  283.         CreateDynamicObject(1486,-1990.40527344,398.52310181,2.15140820,0.00000000,0.00000000,0.00000000); //object(dyn_beer_1) (1)
  284.         CreateDynamicObject(1486,-1990.90563965,400.33468628,2.15140820,0.00000000,0.00000000,0.00000000); //object(dyn_beer_1) (2)
  285.         CreateDynamicObject(1510,-1990.38635254,399.18048096,2.05645943,0.00000000,0.00000000,0.00000000); //object(dyn_ashtry) (1)
  286.         CreateDynamicObject(1543,-1990.84545898,398.96905518,2.00645924,0.00000000,0.00000000,0.00000000); //object(cj_beer_b_2) (1)
  287.         CreateDynamicObject(1544,-1990.17407227,400.22183228,2.00645924,0.00000000,0.00000000,0.00000000); //object(cj_beer_b_1) (5)
  288.         CreateDynamicObject(1546,-1990.57446289,400.64953613,2.09558821,0.00000000,0.00000000,0.00000000); //object(cj_pint_glass) (2)
  289.         CreateDynamicObject(1668,-1990.56579590,399.72021484,2.17316294,0.00000000,0.00000000,0.00000000); //object(propvodkabotl1) (1)
  290.         CreateDynamicObject(1669,-1990.45507812,399.61505127,2.17316294,0.00000000,0.00000000,0.00000000); //object(propwinebotl1) (1)
  291.         CreateDynamicObject(1950,-1990.19140625,399.15011597,2.19462657,0.00000000,0.00000000,0.00000000); //object(kb_beer) (1)
  292.         CreateDynamicObject(1667,-1990.31188965,398.61380005,2.09503841,0.00000000,0.00000000,0.00000000); //object(propwineglass1) (2)
  293.         CreateDynamicObject(1667,-1990.85742188,399.10348511,2.09503841,0.00000000,0.00000000,0.00000000); //object(propwineglass1) (3)
  294.         CreateDynamicObject(1667,-1990.21252441,398.92254639,2.09503841,0.00000000,0.00000000,0.00000000); //object(propwineglass1) (4)
  295.         CreateDynamicObject(1667,-1990.23571777,400.05093384,2.09503841,0.00000000,0.00000000,0.00000000); //object(propwineglass1) (5)
  296.         CreateDynamicObject(1667,-1990.85607910,400.04284668,2.09503841,0.00000000,0.00000000,0.00000000); //object(propwineglass1) (6)
  297.         CreateDynamicObject(1667,-1990.45361328,400.70193481,2.09503841,0.00000000,0.00000000,0.00000000); //object(propwineglass1) (7)
  298.         CreateDynamicObject(2768,-1979.54443359,415.35848999,2.39140534,0.00000000,0.00000000,0.00000000); //object(cj_cb_burg) (1)
  299.         CreateDynamicObject(2767,-1979.33044434,417.62567139,2.32408953,0.00000000,0.00000000,0.00000000); //object(cj_cb_tray) (1)
  300.         CreateDynamicObject(2768,-1979.21337891,417.71069336,2.39140534,358.00000000,0.00000000,276.00000000); //object(cj_cb_burg) (2)
  301.         CreateDynamicObject(2768,-1979.27197266,417.51815796,2.39140534,357.99499512,0.00000000,145.99853516); //object(cj_cb_burg) (3)
  302.         CreateDynamicObject(2768,-1979.39208984,417.72415161,2.36640525,357.98950195,0.00000000,35.99734497); //object(cj_cb_burg) (4)
  303.         CreateDynamicObject(2769,-1979.51538086,417.50271606,2.34348345,0.00000000,0.00000000,0.00000000); //object(cj_cj_burg2) (1)
  304.         CreateDynamicObject(2814,-1978.82714844,417.64639282,2.32408953,0.00000000,0.00000000,0.00000000); //object(gb_takeaway01) (1)
  305.         CreateDynamicObject(2880,-1979.69177246,417.18093872,2.32930541,338.68923950,285.25561523,308.88677979); //object(cj_burg_2) (1)
  306.         CreateDynamicObject(2866,-1979.27478027,410.39382935,2.35748386,0.00000000,0.00000000,0.00000000); //object(gb_foodwrap04) (1)
  307.         CreateDynamicObject(1409,-1983.99096680,417.62332153,1.50096750,0.00000000,0.00000000,0.00000000); //object(cj_dump1_low) (1)
  308.         CreateDynamicObject(1409,-1973.25634766,396.96475220,1.50096750,0.00000000,0.00000000,0.00000000); //object(cj_dump1_low) (3)
  309.         CreateDynamicObject(17969,-1992.34716797,399.08142090,35.58477402,0.00000000,0.00000000,359.75000000); //object(hub_graffitti) (1)
  310.         CreateDynamicObject(1486,-1980.75646973,398.37597656,2.57633448,0.00000000,0.00000000,0.00000000); //object(dyn_beer_1) (4)
  311.         CreateDynamicObject(1510,-1989.41137695,416.12026978,2.63496900,0.00000000,0.00000000,0.00000000); //object(dyn_ashtry) (2)
  312.         CreateDynamicObject(1510,-1979.38964844,417.03784180,2.34908962,0.00000000,0.00000000,0.00000000); //object(dyn_ashtry) (3)
  313.         CreateDynamicObject(1510,-1965.18640137,402.12326050,2.30170536,0.00000000,0.00000000,0.00000000); //object(dyn_ashtry) (4)
  314.         CreateDynamicObject(1546,-1965.14184570,401.95034790,2.36583424,0.00000000,0.00000000,0.00000000); //object(cj_pint_glass) (3)
  315.         CreateDynamicObject(1544,-1965.03173828,401.83084106,2.27670527,0.00000000,0.00000000,0.00000000); //object(cj_beer_b_1) (7)
  316.         CreateDynamicObject(1485,-1965.09851074,402.33486938,2.36627817,0.00000000,16.00000000,260.00000000); //object(cj_ciggy) (1)
  317.         CreateDynamicObject(1485,-1979.37475586,416.82235718,2.41366243,0.00000000,15.99609375,95.99694824); //object(cj_ciggy) (2)
  318.         CreateDynamicObject(1485,-1990.38574219,398.98437500,2.10994744,0.00000000,15.99060059,95.99304199); //object(cj_ciggy) (3)
  319.         return 1;
  320. }
  321. public OnPlayerConnect(playerid)
  322. {
  323.     //player variables
  324.     if(IsPlayerNPC(playerid)) return 1;
  325.     BowlingMinutes[playerid] = 0;
  326.     BowlingSeconds[playerid] = 0;
  327.         BowlingStatus[playerid] = F_BOWLING_THROW;
  328.         PinsLeft[1][playerid] = 0;
  329.         AbleToPlay[playerid] = 0;
  330.         PlayersBowlingScore[playerid] = 0;
  331.         if(!dini_Exists(PlayerBowlingFile(playerid)))
  332.     {
  333.         dini_Create(PlayerBowlingFile(playerid));
  334.         dini_IntSet(PlayerBowlingFile(playerid),"BestScore",0);
  335.         dini_Set(PlayerBowlingFile(playerid),"LastTime","Never");
  336.         dini_IntSet(PlayerBowlingFile(playerid),"Stirkes",0);
  337.     }
  338.     if(dini_Exists(PlayerBowlingFile(playerid)))
  339.     {
  340.                 BestScore[playerid] = dini_Int(PlayerBowlingFile(playerid),"BestScore");
  341.                 LastTimePlayed[playerid] = dini_Get(PlayerBowlingFile(playerid),"LastTime");
  342.                 PlayerStrikes[playerid] = dini_Int(PlayerBowlingFile(playerid),"Strikes");
  343.         }
  344.         return 1;
  345. }
  346.  
  347. public OnPlayerRequestClass(playerid,classid)
  348. {
  349.     if(IsPlayerNPC(playerid)) return 1;
  350.         return 1;
  351. }
  352.  
  353. public OnPlayerDisconnect(playerid, reason)
  354. {
  355.     if(IsPlayerNPC(playerid)) return 1;
  356.     BowlingMinutes[playerid] = 0;
  357.     BowlingSeconds[playerid] = 0;
  358.         BowlingStatus[playerid] = F_BOWLING_THROW;
  359.         PinsLeft[1][playerid] = 0;
  360.         AbleToPlay[playerid] = 0;
  361.         KillTimer(BowlingTimer[PlayersBowlingRoad[playerid]]);
  362.         BowlingRoadStatus[PlayersBowlingRoad[playerid]] = ROAD_EMPTY;
  363.         if(PlayersBowlingRoad[playerid]==0)
  364.         {
  365.                 UpdateDynamic3DTextLabelText(BowlingRoadScreen[0], 0xFFFFFF,"{008800}[{FFFFFF} Road 1{008800} ]\n Empty");
  366.                 DestroyPins(0);
  367.         }
  368.         else if(PlayersBowlingRoad[playerid]==1)
  369.         {
  370.                 UpdateDynamic3DTextLabelText(BowlingRoadScreen[1], 0xFFFFFF,"{008800}[{FFFFFF} Road 2{008800} ]\n Empty");
  371.                 DestroyPins(1);
  372.         }
  373.         else if(PlayersBowlingRoad[playerid]==2)
  374.         {
  375.                 UpdateDynamic3DTextLabelText(BowlingRoadScreen[2], 0xFFFFFF,"{008800}[{FFFFFF} Road 3{008800} ]\n Empty");
  376.                 DestroyPins(2);
  377.         }
  378.         else if(PlayersBowlingRoad[playerid]==3)
  379.         {
  380.                 UpdateDynamic3DTextLabelText(BowlingRoadScreen[3], 0xFFFFFF,"{008800}[{FFFFFF} Road 4{008800} ]\n Empty");
  381.                 DestroyPins(3);
  382.         }
  383.         else if(PlayersBowlingRoad[playerid]==4)
  384.         {
  385.                 UpdateDynamic3DTextLabelText(BowlingRoadScreen[4], 0xFFFFFF,"{008800}[{FFFFFF} Road 5{008800} ]\n Empty");
  386.                 DestroyPins(4);
  387.         }
  388.         PlayersBowlingRoad[playerid] = ROAD_NONE;
  389.         return 1;
  390. }
  391.  
  392. public OnPlayerSpawn(playerid)
  393. {
  394.     if(IsPlayerNPC(playerid))
  395.         {
  396.         new npcname[MAX_PLAYER_NAME];
  397.         GetPlayerName(playerid, npcname, sizeof(npcname));
  398.         if(!strcmp(npcname, "Dj_Nexotronix", true))
  399.         {
  400.                 SetPlayerSkin(playerid, 188);
  401.             SetPlayerAttachedObject(playerid,2,1485,5);
  402.             SetPlayerColor(playerid,0xFFFFFF00);
  403.             ApplyAnimation(playerid, "SCRATCHING","scdldlp", 4.0, 1, 1, 1, 1, 0, 1);
  404.                 }
  405.                 else if(!strcmp(npcname, "BarGirl", true))
  406.         {
  407.                 SetPlayerSkin(playerid, 211);
  408.             SetPlayerColor(playerid,0xFFFFFF00);
  409.             ApplyAnimation(playerid, "BAR","Barserve_loop", 4.0, 0, 1, 1, 1, 0, 1);
  410.                 }
  411.                 else if(!strcmp(npcname, "Administrator", true))
  412.         {
  413.                 SetPlayerSkin(playerid, 217);
  414.             SetPlayerColor(playerid,0xFFFFFF00);
  415.                 }
  416.         return 1;
  417.         }
  418.         return 1;
  419. }
  420.  
  421. public OnPlayerUpdate(playerid)
  422. {
  423.     if(IsPlayerNPC(playerid)) return 1;
  424.         Streamer_Update(playerid);
  425.         return 1;
  426. }
  427.  
  428. public OnPlayerText(playerid, text[])
  429. {
  430.     new bot = GetClosestPlayer(playerid);
  431.     if(IsPlayerNPC(bot))
  432.         {
  433.             if(BarGirlBusy == 1) return SendClientMessage(playerid,0xFFFF00DD,"Bar:{FFFFFF}Girl is busy now!");
  434.             if(!strcmp(PlayerName(bot),"BarGirl",true))
  435.             {
  436.                 if(!strcmp(text,"beer",true))
  437.                         {
  438.                             BarGirlBusy = 1;
  439.                             PlayerOrder[playerid] = "beer";
  440.                             SetPlayerChatBubble(bot,"Girl: {FFFFFF}One moment please...",0xFFFF00DD,35.0,3000);
  441.                 ApplyAnimation(bot, "BAR","Barserve_bottle", 4.0, 0, 0, 0, 0, 0, 1);
  442.                 SetTimerEx("GetBottle",3000,false,"ii",bot,playerid);
  443.                         }
  444.                         if(!strcmp(text,"shampagne",true))
  445.                         {
  446.                             BarGirlBusy = 1;
  447.                             PlayerOrder[playerid] = "shampagne";
  448.                             SetPlayerChatBubble(bot,"Girl: {FFFFFF}One moment please...",0xFFFF00DD,35.0,3000);
  449.                 ApplyAnimation(bot, "BAR","Barserve_bottle", 4.0, 0, 0, 0, 0, 0, 1);
  450.                 SetTimerEx("GetBottle",3000,false,"ii",bot,playerid);
  451.                         }
  452.                         if(!strcmp(text,"wine",true))
  453.                         {
  454.                             BarGirlBusy = 1;
  455.                             PlayerOrder[playerid] = "wine";
  456.                             SetPlayerChatBubble(bot,"Girl: {FFFFFF}One moment please...",0xFFFF00DD,35.0,3000);
  457.                 ApplyAnimation(bot, "BAR","Barserve_bottle", 4.0, 0, 0, 0, 0, 0, 1);
  458.                 SetTimerEx("GetBottle",3000,false,"ii",bot,playerid);
  459.                         }
  460.                         if(!strcmp(text,"vodka",true))
  461.                         {
  462.                             BarGirlBusy = 1;
  463.                             PlayerOrder[playerid] = "vodka";
  464.                             SetPlayerChatBubble(bot,"Girl: {FFFFFF}One moment please...",0xFFFF00DD,35.0,3000);
  465.                 ApplyAnimation(bot, "BAR","Barserve_bottle", 4.0, 0, 0, 0, 0, 0, 1);
  466.                 SetTimerEx("GetBottle",3000,false,"ii",bot,playerid);
  467.                         }
  468.                         if(!strcmp(text,"sprunk",true))
  469.                         {
  470.                             BarGirlBusy = 1;
  471.                             PlayerOrder[playerid] = "sprunk";
  472.                             SetPlayerChatBubble(bot,"Girl: {FFFFFF}One moment please...",0xFFFF00DD,35.0,3000);
  473.                 ApplyAnimation(bot, "BAR","Barserve_bottle", 4.0, 0, 0, 0, 0, 0, 1);
  474.                 SetTimerEx("GetBottle",3000,false,"ii",bot,playerid);
  475.                         }
  476.             }
  477.         }
  478.         return 1;
  479. }
  480.  
  481. forward GetBottle(bot,playerid);
  482. public GetBottle(bot,playerid)
  483. {
  484.         if(!strcmp(PlayerOrder[playerid],"beer",true))
  485.         {
  486.             SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
  487.             GivePlayerMoney(playerid, -6);
  488.         }
  489.         if(!strcmp(PlayerOrder[playerid],"shampagne",true))
  490.         {
  491.             SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
  492.             GivePlayerMoney(playerid, -100);
  493.         }
  494.         if(!strcmp(PlayerOrder[playerid],"wine",true))
  495.         {
  496.             SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
  497.             GivePlayerMoney(playerid, -50);
  498.         }
  499.         if(!strcmp(PlayerOrder[playerid],"vodka",true))
  500.         {
  501.             SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
  502.             GivePlayerMoney(playerid, -70);
  503.         }
  504.         if(!strcmp(PlayerOrder[playerid],"sprunk",true))
  505.         {
  506.             SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
  507.             GivePlayerMoney(playerid, -7);
  508.         }
  509.     SetPlayerChatBubble(bot,"Girl: {FFFFFF}Take your oreder please!",0xFFFF00DD,35.0,3000);
  510.         ApplyAnimation(bot, "BAR","Barserve_give", 4.0, 0, 1, 1, 1, 0, 1);
  511.         BarGirlBusy = 0;
  512.         return 1;
  513. }
  514.  
  515. public OnPlayerDeath(playerid, killerid, reason)
  516. {
  517.     BowlingMinutes[playerid] = 0;
  518.     BowlingSeconds[playerid] = 0;
  519.         BowlingStatus[playerid] = F_BOWLING_THROW;
  520.         PinsLeft[1][playerid] = 0;
  521.         AbleToPlay[playerid] = 0;
  522.         KillTimer(BowlingTimer[PlayersBowlingRoad[playerid]]);
  523.         BowlingRoadStatus[PlayersBowlingRoad[playerid]] = ROAD_EMPTY;
  524.         if(PlayersBowlingRoad[playerid]==0)
  525.         {
  526.                 UpdateDynamic3DTextLabelText(BowlingRoadScreen[0], 0xFFFFFF,"{008800}[{FFFFFF} Road 1{008800} ]\n Empty");
  527.                 DestroyPins(0);
  528.         }
  529.         else if(PlayersBowlingRoad[playerid]==1)
  530.         {
  531.                 UpdateDynamic3DTextLabelText(BowlingRoadScreen[1], 0xFFFFFF,"{008800}[{FFFFFF} Road 2{008800} ]\n Empty");
  532.                 DestroyPins(1);
  533.         }
  534.         else if(PlayersBowlingRoad[playerid]==2)
  535.         {
  536.                 UpdateDynamic3DTextLabelText(BowlingRoadScreen[2], 0xFFFFFF,"{008800}[{FFFFFF} Road 3{008800} ]\n Empty");
  537.                 DestroyPins(2);
  538.         }
  539.         else if(PlayersBowlingRoad[playerid]==3)
  540.         {
  541.                 UpdateDynamic3DTextLabelText(BowlingRoadScreen[3], 0xFFFFFF,"{008800}[{FFFFFF} Road 4{008800} ]\n Empty");
  542.                 DestroyPins(3);
  543.         }
  544.         else if(PlayersBowlingRoad[playerid]==4)
  545.         {
  546.                 UpdateDynamic3DTextLabelText(BowlingRoadScreen[4], 0xFFFFFF,"{008800}[{FFFFFF} Road 5{008800} ]\n Empty");
  547.                 DestroyPins(4);
  548.         }
  549.         PlayersBowlingRoad[playerid] = ROAD_NONE;
  550.         return 1;
  551. }
  552. CMD:bowling(playerid,params[])
  553. {
  554.         if(AbleToPlay[playerid] == 1)
  555.         {  
  556.                 if(IsAtBowlingRoad(playerid))
  557.                 {
  558.                 if(BowlingStatus[playerid] != N_BOWLING_THROW)
  559.                         {
  560.                             CreateBall(playerid);
  561.                                 BallGoing[playerid] = SetTimerEx("BallGoingTimer",1000,false,"d",playerid);
  562.                                 ApplyAnimation(playerid,"GRENADE","WEAPON_throwu",2.2,0,0,0,0,0,1);
  563.                 }
  564.                 else
  565.                 {
  566.                     SendClientMessage(playerid,0xAA0000FF,"Wait for pins!.");
  567.                 }
  568.                 }
  569.                 else
  570.                 {
  571.                     SendClientMessage(playerid,0xD92626AA,"You too away from road!");
  572.                 }
  573.         }
  574.         else
  575.         {
  576.             SendClientMessage(playerid,0xD92626AA,"You didn't start game yet!");
  577.         }
  578.         return 1;
  579. }
  580. CMD:bowlingstats(playerid,params[])
  581. {
  582.         new str[128];
  583.         format(str,128,"{00CC00}Best result: {EEEEEE}%i\n{00CC00}Strikes: {EEEEEE}%i\n{00CC00}Date of Last game: {EEEEEE}%s ",BestScore[playerid],PlayerStrikes[playerid],LastTimePlayed[playerid]);
  584.         ShowPlayerDialog(playerid, DIALOG_BOWLING_STATS, DIALOG_STYLE_MSGBOX, "My Bowling Stats", str, "Ok", "");
  585.         return 1;
  586. }
  587. CMD:dancing(playerid,params[])
  588. {
  589.         new dj;
  590.         if(sscanf(params,"i",dj)) return SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}Usage:{FFFFFF} /dancing {00FF00}[{FFFFFF}1-11{00FF00}]");
  591.         switch(dj){
  592.             case 0:SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}Usage:{FFFFFF} /dancing {00FF00}[{FFFFFF}1-11{00FF00}]");
  593.                 case 1:ApplyAnimation(playerid, "DANCING","dance_loop", 4.0, 1, 1, 1, 1, 0, 1);
  594.                 case 2:ApplyAnimation(playerid, "DANCING","DAN_Down_A", 4.0, 1, 1, 1, 1, 0, 1);
  595.                 case 3:ApplyAnimation(playerid, "DANCING","DAN_Left_A", 4.0, 1, 1, 1, 1, 0, 1);
  596.                 case 4:ApplyAnimation(playerid, "DANCING","DAN_Loop_A", 4.0, 1, 1, 1, 1, 0, 1);
  597.                 case 5:ApplyAnimation(playerid, "DANCING","DAN_Right_A", 4.0, 1, 1, 1, 1, 0, 1);
  598.                 case 6:ApplyAnimation(playerid, "DANCING","DAN_Up_A", 4.0, 1, 1, 1, 1, 0, 1);
  599.                 case 7:ApplyAnimation(playerid, "DANCING","dnce_M_a", 4.0, 1, 1, 1, 1, 0, 1);
  600.                 case 8:ApplyAnimation(playerid, "DANCING","dnce_M_b", 4.0, 1, 1, 1, 1, 0, 1);
  601.                 case 9:ApplyAnimation(playerid, "DANCING","dnce_M_c", 4.0, 1, 1, 1, 1, 0, 1);
  602.                 case 10:ApplyAnimation(playerid, "DANCING","dnce_M_d", 4.0, 1, 1, 1, 1, 0, 1);
  603.                 case 11:ApplyAnimation(playerid, "DANCING","dnce_M_ e", 4.0, 1, 1, 1, 1, 0, 1);
  604.                 default: SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}Usage:{FFFFFF} /dancing {00FF00}[{FFFFFF}1-11{00FF00}]");
  605.         }
  606.         return 1;
  607. }
  608. CMD:stopanim(playerid,params[])
  609. {
  610.         ApplyAnimation(playerid, "CARRY", "crry_prtial", 2.0, 0, 0, 0, 0, 0,1);
  611.         return 1;
  612. }
  613. //bowling functions
  614. stock PickupBowlingHelp(playerid,pickupid)
  615. {
  616.     if(pickupid == HelpBowlingRoadPickup[0])
  617.         {
  618.             GameTextForPlayer(playerid,"~y~/bowling",1000,0);
  619.             DestroyDynamicPickup(HelpBowlingRoadPickup[0]);
  620.         }
  621.         else if(pickupid == HelpBowlingRoadPickup[1])
  622.         {
  623.             GameTextForPlayer(playerid,"~y~/bowling",1000,0);
  624.             DestroyDynamicPickup(HelpBowlingRoadPickup[1]);
  625.         }
  626.         else if(pickupid == HelpBowlingRoadPickup[2])
  627.         {
  628.             GameTextForPlayer(playerid,"~y~/bowling",1000,0);
  629.             DestroyDynamicPickup(HelpBowlingRoadPickup[2]);
  630.         }
  631.         else if(pickupid == HelpBowlingRoadPickup[3])
  632.         {
  633.             GameTextForPlayer(playerid,"~y~/bowling",1000,0);
  634.             DestroyDynamicPickup(HelpBowlingRoadPickup[3]);
  635.         }
  636.         else if(pickupid == HelpBowlingRoadPickup[4])
  637.         {
  638.             GameTextForPlayer(playerid,"~y~/bowling",1000,0);
  639.             DestroyDynamicPickup(HelpBowlingRoadPickup[4]);
  640.         }
  641.         return 1;
  642. }
  643. stock IsAtBowlingRoad(playerid)
  644. {
  645.         if(PlayersBowlingRoad[playerid]==0)
  646.         {
  647.             if(IsPlayerInRangeOfPoint(playerid,0.5,-1975.0587,416.9655,2.5090))
  648.             {
  649.                 return 1;
  650.             }
  651.         }
  652.         else if(PlayersBowlingRoad[playerid]==1)
  653.         {
  654.             if(IsPlayerInRangeOfPoint(playerid,0.5,-1975.0587,415.4035,2.5090))
  655.             {
  656.                 return 1;
  657.             }
  658.         }
  659.         else if(PlayersBowlingRoad[playerid]==2)
  660.         {
  661.             if(IsPlayerInRangeOfPoint(playerid,0.5,-1975.0587,413.8728,2.5090))
  662.             {
  663.                 return 1;
  664.             }
  665.         }
  666.         else if(PlayersBowlingRoad[playerid]==3)
  667.         {
  668.             if(IsPlayerInRangeOfPoint(playerid,0.5,-1975.0587,412.2807,2.5090))
  669.             {
  670.                 return 1;
  671.             }
  672.         }
  673.         else if(PlayersBowlingRoad[playerid]==4)
  674.         {
  675.             if(IsPlayerInRangeOfPoint(playerid,0.5,-1975.0587,410.7207,2.5090))
  676.             {
  677.                 return 1;
  678.             }
  679.         }
  680.         return 0;
  681. }
  682. stock MoveBall(playerid)
  683. {
  684.     if(PlayersBowlingRoad[playerid] == 0)
  685.         {
  686.         MoveDynamicObject(BowlingBall[0],-1962.90368652,416.9655,1.64401352,BALL_SPEED);
  687.         }
  688.         else if(PlayersBowlingRoad[playerid] == 1)
  689.         {
  690.         MoveDynamicObject(BowlingBall[1],-1962.90368652,415.4035,1.64401352,BALL_SPEED);
  691.         }
  692.         else if(PlayersBowlingRoad[playerid] == 2)
  693.         {
  694.         MoveDynamicObject(BowlingBall[2],-1962.90368652,413.8728,1.64401352,BALL_SPEED);
  695.         }
  696.         else if(PlayersBowlingRoad[playerid] == 3)
  697.         {
  698.         MoveDynamicObject(BowlingBall[3],-1962.90368652,412.2807,1.64401352,BALL_SPEED);
  699.         }
  700.         else if(PlayersBowlingRoad[playerid] == 4)
  701.         {
  702.         MoveDynamicObject(BowlingBall[4],-1962.90368652,410.7207,1.64401352,BALL_SPEED);
  703.         }
  704.         return 1;
  705. }
  706. stock CreateBall(playerid)
  707. {
  708.     if(PlayersBowlingRoad[playerid]==0)
  709.         {
  710.             BowlingBall[0] = CreateDynamicObject(2114,-1975.0587+1,416.9655,1.64401352,0.0,0.0,0.0);
  711.         }
  712.         else if(PlayersBowlingRoad[playerid]==1)
  713.         {
  714.             BowlingBall[1] = CreateDynamicObject(2114,-1975.0587+1,415.4035,1.64401352,0.0,0.0,0.0);
  715.         }
  716.         else if(PlayersBowlingRoad[playerid]==2)
  717.         {
  718.             BowlingBall[2] = CreateDynamicObject(2114,-1975.0587+1,413.8728,1.64401352,0.0,0.0,0.0);
  719.         }
  720.         else if(PlayersBowlingRoad[playerid]==3)
  721.         {
  722.             BowlingBall[3] = CreateDynamicObject(2114,-1975.0587+1,412.2807,1.64401352,0.0,0.0,0.0);
  723.         }
  724.         else if(PlayersBowlingRoad[playerid]==4)
  725.         {
  726.             BowlingBall[4] = CreateDynamicObject(2114,-1975.0587+1,410.7207,1.64401352,0.0,0.0,0.0);
  727.         }
  728.         return 1;
  729. }
  730. stock DestroyBall(playerid)
  731. {
  732.     if(PlayersBowlingRoad[playerid]==0)
  733.         {
  734.             DestroyDynamicObject(BowlingBall[0]);
  735.         }
  736.         else if(PlayersBowlingRoad[playerid]==1)
  737.         {
  738.             DestroyDynamicObject(BowlingBall[1]);
  739.         }
  740.         else if(PlayersBowlingRoad[playerid]==2)
  741.         {
  742.             DestroyDynamicObject(BowlingBall[2]);
  743.         }
  744.         else if(PlayersBowlingRoad[playerid]==3)
  745.         {
  746.             DestroyDynamicObject(BowlingBall[3]);
  747.         }
  748.         else if(PlayersBowlingRoad[playerid]==4)
  749.         {
  750.             DestroyDynamicObject(BowlingBall[4]);
  751.         }
  752.         return 1;
  753. }
  754.  
  755. stock DestroyPins(roadid)
  756. {
  757.        
  758.         for(new pin = 0; pin<=MAX_PINS; pin++)
  759.         {
  760.             DestroyDynamicObject(BowlingPins[roadid][pin]);
  761.         }
  762.     return 1;
  763. }
  764. stock CreatePins(playerid)
  765. {
  766.         if(PlayersBowlingRoad[playerid]==0)
  767.         {
  768.                 BowlingPins[0][9] = CreateDynamicObject(1484, -1963.1579589844, 417.12506103516, 1.7151190042496, 349.04943847656, 24.473388671875, 6.1903991699219);
  769.                 BowlingPins[0][8] = CreateDynamicObject(1484, -1963.1511230469, 416.96856689453, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  770.                 BowlingPins[0][7] = CreateDynamicObject(1484, -1963.1798095703, 416.78656005859, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  771.                 BowlingPins[0][6] = CreateDynamicObject(1484, -1963.1925048828, 416.59609985352, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  772.                 BowlingPins[0][5] = CreateDynamicObject(1484, -1963.3796386719, 416.69662475586, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  773.                 BowlingPins[0][4] = CreateDynamicObject(1484, -1963.3446044922, 416.86737060547, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  774.                 BowlingPins[0][3] = CreateDynamicObject(1484, -1963.3403320313, 417.02703857422, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  775.                 BowlingPins[0][2] = CreateDynamicObject(1484, -1963.5046386719, 416.95327758789, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  776.                 BowlingPins[0][1] = CreateDynamicObject(1484, -1963.5002441406, 416.77334594727, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  777.                 BowlingPins[0][0] = CreateDynamicObject(1484, -1963.6495361328, 416.86196899414, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  778.         }
  779.         else if(PlayersBowlingRoad[playerid]==1)
  780.         {
  781.             BowlingPins[1][9] = CreateDynamicObject(1484, -1963.1579589844, 417.12506103516-Y_ROAD_2, 1.7151190042496, 349.04943847656, 24.473388671875, 6.1903991699219);
  782.                 BowlingPins[1][8] = CreateDynamicObject(1484, -1963.1511230469, 416.96856689453-Y_ROAD_2, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  783.                 BowlingPins[1][7] = CreateDynamicObject(1484, -1963.1798095703, 416.78656005859-Y_ROAD_2, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  784.                 BowlingPins[1][6] = CreateDynamicObject(1484, -1963.1925048828, 416.59609985352-Y_ROAD_2, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  785.                 BowlingPins[1][5] = CreateDynamicObject(1484, -1963.3796386719, 416.69662475586-Y_ROAD_2, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  786.                 BowlingPins[1][4] = CreateDynamicObject(1484, -1963.3446044922, 416.86737060547-Y_ROAD_2, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  787.                 BowlingPins[1][3] = CreateDynamicObject(1484, -1963.3403320313, 417.02703857422-Y_ROAD_2, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  788.                 BowlingPins[1][2] = CreateDynamicObject(1484, -1963.5046386719, 416.95327758789-Y_ROAD_2, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  789.                 BowlingPins[1][1] = CreateDynamicObject(1484, -1963.5002441406, 416.77334594727-Y_ROAD_2, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  790.                 BowlingPins[1][0] = CreateDynamicObject(1484, -1963.6495361328, 416.86196899414-Y_ROAD_2, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  791.         }
  792.         else if(PlayersBowlingRoad[playerid]==2)
  793.         {
  794.             BowlingPins[2][9] = CreateDynamicObject(1484, -1963.1579589844, 417.12506103516-Y_ROAD_3, 1.7151190042496, 349.04943847656, 24.473388671875, 6.1903991699219);
  795.                 BowlingPins[2][8] = CreateDynamicObject(1484, -1963.1511230469, 416.96856689453-Y_ROAD_3, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  796.                 BowlingPins[2][7] = CreateDynamicObject(1484, -1963.1798095703, 416.78656005859-Y_ROAD_3, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  797.                 BowlingPins[2][6] = CreateDynamicObject(1484, -1963.1925048828, 416.59609985352-Y_ROAD_3, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  798.                 BowlingPins[2][5] = CreateDynamicObject(1484, -1963.3796386719, 416.69662475586-Y_ROAD_3, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  799.                 BowlingPins[2][4] = CreateDynamicObject(1484, -1963.3446044922, 416.86737060547-Y_ROAD_3, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  800.                 BowlingPins[2][3] = CreateDynamicObject(1484, -1963.3403320313, 417.02703857422-Y_ROAD_3, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  801.                 BowlingPins[2][2] = CreateDynamicObject(1484, -1963.5046386719, 416.95327758789-Y_ROAD_3, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  802.                 BowlingPins[2][1] = CreateDynamicObject(1484, -1963.5002441406, 416.77334594727-Y_ROAD_3, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  803.                 BowlingPins[2][0] = CreateDynamicObject(1484, -1963.6495361328, 416.86196899414-Y_ROAD_3, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  804.         }
  805.         else if(PlayersBowlingRoad[playerid]==3)
  806.         {
  807.             BowlingPins[3][9] = CreateDynamicObject(1484, -1963.1579589844, 417.12506103516-Y_ROAD_4, 1.7151190042496, 349.04943847656, 24.473388671875, 6.1903991699219);
  808.                 BowlingPins[3][8] = CreateDynamicObject(1484, -1963.1511230469, 416.96856689453-Y_ROAD_4, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  809.                 BowlingPins[3][7] = CreateDynamicObject(1484, -1963.1798095703, 416.78656005859-Y_ROAD_4, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  810.                 BowlingPins[3][6] = CreateDynamicObject(1484, -1963.1925048828, 416.59609985352-Y_ROAD_4, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  811.                 BowlingPins[3][5] = CreateDynamicObject(1484, -1963.3796386719, 416.69662475586-Y_ROAD_4, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  812.                 BowlingPins[3][4] = CreateDynamicObject(1484, -1963.3446044922, 416.86737060547-Y_ROAD_4, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  813.                 BowlingPins[3][3] = CreateDynamicObject(1484, -1963.3403320313, 417.02703857422-Y_ROAD_4, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  814.                 BowlingPins[3][2] = CreateDynamicObject(1484, -1963.5046386719, 416.95327758789-Y_ROAD_4, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  815.                 BowlingPins[3][1] = CreateDynamicObject(1484, -1963.5002441406, 416.77334594727-Y_ROAD_4, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  816.                 BowlingPins[3][0] = CreateDynamicObject(1484, -1963.6495361328, 416.86196899414-Y_ROAD_4, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  817.         }
  818.         else if(PlayersBowlingRoad[playerid]==4)
  819.         {
  820.             BowlingPins[4][9] = CreateDynamicObject(1484, -1963.1579589844, 417.12506103516-Y_ROAD_5, 1.7151190042496, 349.04943847656, 24.473388671875, 6.1903991699219);
  821.                 BowlingPins[4][8] = CreateDynamicObject(1484, -1963.1511230469, 416.96856689453-Y_ROAD_5, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  822.                 BowlingPins[4][7] = CreateDynamicObject(1484, -1963.1798095703, 416.78656005859-Y_ROAD_5, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  823.                 BowlingPins[4][6] = CreateDynamicObject(1484, -1963.1925048828, 416.59609985352-Y_ROAD_5, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  824.                 BowlingPins[4][5] = CreateDynamicObject(1484, -1963.3796386719, 416.69662475586-Y_ROAD_5, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  825.                 BowlingPins[4][4] = CreateDynamicObject(1484, -1963.3446044922, 416.86737060547-Y_ROAD_5, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  826.                 BowlingPins[4][3] = CreateDynamicObject(1484, -1963.3403320313, 417.02703857422-Y_ROAD_5, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  827.                 BowlingPins[4][2] = CreateDynamicObject(1484, -1963.5046386719, 416.95327758789-Y_ROAD_5, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  828.                 BowlingPins[4][1] = CreateDynamicObject(1484, -1963.5002441406, 416.77334594727-Y_ROAD_5, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  829.                 BowlingPins[4][0] = CreateDynamicObject(1484, -1963.6495361328, 416.86196899414-Y_ROAD_5, 1.7151190042496, 349.04663085938, 24.472045898438, 6.185302734375);
  830.         }
  831.     return 1;
  832. }
  833. stock PinsKnocked(playerid)
  834. {
  835.     if(AbleToPlay[playerid] == 0) return SendClientMessage(playerid,0xD92626AA,"You didn't start game yet!");
  836.         new Float:x,Float:y,Float:z;
  837.         new knock = random(10);
  838.         switch(knock)
  839.         {
  840.             case 0:
  841.             {
  842.                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][0],x,y,z);
  843.                         MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][0],x,y,z-1,2.0);
  844.                         LastPin[PlayersBowlingRoad[playerid]][0][playerid] = PIN_GOAWAY;
  845.                         GameTextForPlayer(playerid,"~w~You have knocked~n~ ~g~1 ~w~pin", 3000, 4);
  846.                         PinsLeft[PlayersBowlingRoad[playerid]][playerid] = 9;
  847.                         PlayersBowlingScore[playerid] += 1;
  848.                 }
  849.             case 1:
  850.             {
  851.  
  852.                 for(new pin=0; pin<=1; pin++)
  853.                 {
  854.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][pin],x,y,z);
  855.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][pin],x,y,z-1,2.0);
  856.                                 LastPin[PlayersBowlingRoad[playerid]][pin][playerid] = PIN_GOAWAY;
  857.                         }
  858.                         PinsLeft[PlayersBowlingRoad[playerid]][playerid] = 8;
  859.                         PlayersBowlingScore[playerid] += 2;
  860.                         GameTextForPlayer(playerid,"~w~You have knocked~n~ ~g~2 ~w~pins", 3000, 4);
  861.             }
  862.             case 2:
  863.             {
  864.                         for(new pin=0; pin<=2; pin++)
  865.                 {
  866.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][pin],x,y,z);
  867.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][pin],x,y,z-1,2.0);
  868.                                 LastPin[PlayersBowlingRoad[playerid]][pin][playerid] = PIN_GOAWAY;
  869.                         }
  870.                         PinsLeft[PlayersBowlingRoad[playerid]][playerid] = 7;
  871.                         PlayersBowlingScore[playerid] += 3;
  872.                         GameTextForPlayer(playerid,"~w~You have knocked~n~ ~g~3 ~w~pins", 3000, 4);
  873.             }
  874.             case 3:
  875.             {
  876.                         for(new pin=0; pin<=3; pin++)
  877.                 {
  878.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][pin],x,y,z);
  879.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][pin],x,y,z-1,2.0);
  880.                                 LastPin[PlayersBowlingRoad[playerid]][pin][playerid] = PIN_GOAWAY;
  881.                         }
  882.                         PlayersBowlingScore[playerid] += 4;
  883.                         PinsLeft[PlayersBowlingRoad[playerid]][playerid] = 6;
  884.                         GameTextForPlayer(playerid,"~w~You have knocked~n~ ~g~4 ~w~pins", 3000, 4);
  885.  
  886.             }
  887.             case 4:
  888.             {
  889.                         for(new pin=0; pin<=4; pin++)
  890.                 {
  891.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][pin],x,y,z);
  892.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][pin],x,y,z-1,2.0);
  893.                                 LastPin[PlayersBowlingRoad[playerid]][pin][playerid] = PIN_GOAWAY;
  894.                         }
  895.                         PlayersBowlingScore[playerid] += 5;
  896.                         PinsLeft[PlayersBowlingRoad[playerid]][playerid] = 5;
  897.                         GameTextForPlayer(playerid,"~w~You have knocked~n~ ~g~5 ~w~pins", 3000, 4);
  898.             }
  899.             case 5:
  900.             {
  901.                         for(new pin=0; pin<=5; pin++)
  902.                 {
  903.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][pin],x,y,z);
  904.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][pin],x,y,z-1,2.0);
  905.                                 LastPin[PlayersBowlingRoad[playerid]][pin][playerid] = PIN_GOAWAY;
  906.                         }
  907.                         PlayersBowlingScore[playerid] += 6;
  908.                         PinsLeft[PlayersBowlingRoad[playerid]][playerid] = 4;
  909.                         GameTextForPlayer(playerid,"~w~You have knocked~n~ ~g~6 ~w~pins", 3000, 4);
  910.             }
  911.             case 6:
  912.             {
  913.                         for(new pin=0; pin<=6; pin++)
  914.                 {
  915.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][pin],x,y,z);
  916.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][pin],x,y,z-1,2.0);
  917.                                 LastPin[PlayersBowlingRoad[playerid]][pin][playerid] = PIN_GOAWAY;
  918.                         }
  919.                         PlayersBowlingScore[playerid] += 7;
  920.                         PinsLeft[PlayersBowlingRoad[playerid]][playerid] = 3;
  921.                         GameTextForPlayer(playerid,"~w~You have knocked~n~ ~g~7 ~w~pins", 3000, 4);
  922.             }
  923.             case 7:
  924.             {
  925.                 for(new pin=0; pin<=7; pin++)
  926.                 {
  927.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][pin],x,y,z);
  928.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][pin],x,y,z-1,2.0);
  929.                                 LastPin[PlayersBowlingRoad[playerid]][pin][playerid] = PIN_GOAWAY;
  930.                         }
  931.                         PlayersBowlingScore[playerid] += 8;
  932.                         PinsLeft[PlayersBowlingRoad[playerid]][playerid] = 2;
  933.                         GameTextForPlayer(playerid,"~w~You have knocked~n~ ~g~8 ~w~pins", 3000, 4);
  934.  
  935.             }
  936.             case 8:
  937.             {
  938.                 for(new pin=0; pin<=8; pin++)
  939.                 {
  940.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][pin],x,y,z);
  941.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][pin],x,y,z-1,2.0);
  942.                                 LastPin[PlayersBowlingRoad[playerid]][pin][playerid] = PIN_GOAWAY;
  943.                         }
  944.                         PlayersBowlingScore[playerid] += 9;
  945.                         PinsLeft[PlayersBowlingRoad[playerid]][playerid] = 1;
  946.                         GameTextForPlayer(playerid,"~w~You have knocked~n~ ~g~9 ~w~pins", 3000, 4);
  947.  
  948.             }
  949.             case 9:
  950.             {
  951.                 for(new pin=0; pin<=9; pin++)
  952.                 {
  953.                    
  954.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][pin],x,y,z);
  955.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][pin],x,y,z-1,2.0);
  956.                                 LastPin[PlayersBowlingRoad[playerid]][pin][playerid] = PIN_GOAWAY;
  957.                         }
  958.                         PinsLeft[PlayersBowlingRoad[playerid]][playerid] = 0;
  959.                         BowlingStatus[playerid]=N_BOWLING_THROW;
  960.                         PlayerStrikes[playerid]+=1;
  961.                         dini_IntSet(PlayerBowlingFile(playerid),"Strikes",PlayerStrikes[playerid]);
  962.                         PlayersBowlingScore[playerid] += 15;
  963.                         BowlingPinsWaitTimer[playerid] = SetTimerEx("PinsWaitTimer",3000,false,"d",playerid);
  964.                         GameTextForPlayer(playerid,"~y~STRIKE!!!", 3000, 4);
  965.             }
  966.         }
  967.         return 1;
  968. }
  969. stock LastPinsKnocked(playerid)
  970. {
  971.     if(AbleToPlay[playerid] == 0) return SendClientMessage(playerid,0xD92626AA,"You didn't start the game yet!");
  972.     new Float:x,Float:y,Float:z;
  973.         if(PinsLeft[PlayersBowlingRoad[playerid]][playerid] == 1)
  974.         {
  975.             new knock = random(2);
  976.                 switch(knock)
  977.                 {
  978.                     case 0:
  979.                     {
  980.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z);
  981.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z-1,2.0);
  982.                                 GameTextForPlayer(playerid,"~g~SPARE!", 3000, 4);
  983.                                
  984.                                 LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_GOAWAY;
  985.                                 PlayersBowlingScore[playerid] += 1;
  986.                         }
  987.                     case 1:
  988.                         {
  989.                         GameTextForPlayer(playerid,"~r~You missed!", 3000, 4);
  990.                        
  991.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_LAST;
  992.                         }
  993.                 }
  994.                
  995.         }
  996.         else if(PinsLeft[PlayersBowlingRoad[playerid]][playerid] == 2)
  997.         {
  998.             new knock = random(4);
  999.                 switch(knock)
  1000.                 {
  1001.                     case 0:
  1002.                     {
  1003.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z);
  1004.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z-1,2.0);
  1005.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~1 ~w~pin!", 3000, 4);
  1006.                                 LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_LAST;
  1007.                                 LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_GOAWAY;
  1008.                                 PlayersBowlingScore[playerid] += 1;
  1009.                                
  1010.                         }
  1011.                         case 1:
  1012.                     {
  1013.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z);
  1014.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z-1,2.0);
  1015.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~1 ~w~pin!", 3000, 4);
  1016.                                 LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_LAST;
  1017.                                 LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_GOAWAY;
  1018.                                 PlayersBowlingScore[playerid] += 1;
  1019.                                
  1020.                         }
  1021.                         case 2:
  1022.                         {
  1023.                             GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z);
  1024.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z-1,2.0);
  1025.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z);
  1026.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z-1,2.0);
  1027.                             GameTextForPlayer(playerid,"~g~SPARE!", 3000, 4);
  1028.                            
  1029.                             LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_GOAWAY;
  1030.                             LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_GOAWAY;
  1031.                             PlayersBowlingScore[playerid] += 2;
  1032.                         }
  1033.                         case 3:
  1034.                         {
  1035.                             GameTextForPlayer(playerid,"~r~You missed!", 3000, 4);
  1036.                            
  1037.                             LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_LAST;
  1038.                             LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_LAST;
  1039.                         }
  1040.                 }
  1041.         }
  1042.         else if(PinsLeft[PlayersBowlingRoad[playerid]][playerid] == 3)
  1043.         {
  1044.             new knock = random(6);
  1045.                 switch(knock)
  1046.                 {
  1047.                     case 0:
  1048.                     {
  1049.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z);
  1050.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z-1,2.0);
  1051.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z);
  1052.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z-1,2.0);
  1053.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z);
  1054.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z-1,2.0);
  1055.                                 LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_GOAWAY;
  1056.                             LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_GOAWAY;
  1057.                             LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_GOAWAY;
  1058.                                 GameTextForPlayer(playerid,"~g~SPARE!", 3000, 4);
  1059.                                 PlayersBowlingScore[playerid] += 3;
  1060.                                
  1061.                         }
  1062.                         case 1:
  1063.                     {
  1064.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z);
  1065.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z-1,2.0);
  1066.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~1 ~w~pin!", 3000, 4);
  1067.                                 LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_GOAWAY;
  1068.                             LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_LAST;
  1069.                             LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_LAST;
  1070.                             PlayersBowlingScore[playerid] += 1;
  1071.                            
  1072.                     }
  1073.                     case 2:
  1074.                     {
  1075.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z);
  1076.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z-1,2.0);
  1077.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~1 ~w~pin!", 3000, 4);
  1078.                                 LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_LAST;
  1079.                             LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_LAST;
  1080.                             LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_GOAWAY;
  1081.                             PlayersBowlingScore[playerid] += 1;
  1082.                            
  1083.                     }
  1084.                     case 3:
  1085.                     {
  1086.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z);
  1087.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z-1,2.0);
  1088.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z);
  1089.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z-1,2.0);
  1090.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~2 ~w~pins!", 3000, 4);
  1091.                                 LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_LAST;
  1092.                             LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_GOAWAY;
  1093.                             LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_GOAWAY;
  1094.                             PlayersBowlingScore[playerid] += 2;
  1095.                            
  1096.                     }
  1097.                         case 4:
  1098.                     {
  1099.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z);
  1100.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z-1,2.0);
  1101.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z);
  1102.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z-1,2.0);
  1103.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~2 ~w~pins!", 3000, 4);
  1104.                                 LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_GOAWAY;
  1105.                             LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_GOAWAY;
  1106.                             LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_LAST;
  1107.                             PlayersBowlingScore[playerid] += 2;
  1108.                            
  1109.                         }
  1110.                         case 5:
  1111.                     {
  1112.                         GameTextForPlayer(playerid,"~r~You missed!", 3000, 4);
  1113.                        
  1114.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_LAST;
  1115.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_LAST;
  1116.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_LAST;
  1117.                     }
  1118.                 }
  1119.                    
  1120.         }
  1121.         else if(PinsLeft[PlayersBowlingRoad[playerid]][playerid] == 4)
  1122.         {
  1123.                 new knock = random(8);
  1124.                 switch(knock)
  1125.                 {
  1126.                     case 0:
  1127.                     {
  1128.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z);
  1129.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z-1,2.0);
  1130.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z);
  1131.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z-1,2.0);
  1132.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z);
  1133.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z-1,2.0);
  1134.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z);
  1135.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z-1,2.0);
  1136.                                 GameTextForPlayer(playerid,"~g~SPARE!", 3000, 4);
  1137.                                
  1138.                                 LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_GOAWAY;
  1139.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_GOAWAY;
  1140.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_GOAWAY;
  1141.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_GOAWAY;
  1142.                         PlayersBowlingScore[playerid] += 4;
  1143.                         }
  1144.                         case 1:
  1145.                     {
  1146.                         GameTextForPlayer(playerid,"~r~You missed!", 3000, 4);
  1147.                        
  1148.                         LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_LAST;
  1149.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_LAST;
  1150.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_LAST;
  1151.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_LAST;
  1152.                     }
  1153.                     case 2:
  1154.                     {
  1155.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z);
  1156.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z-1,2.0);
  1157.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~1 ~w~pin!", 3000, 4);
  1158.                                 LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_LAST;
  1159.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_LAST;
  1160.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_LAST;
  1161.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_GOAWAY;
  1162.                         PlayersBowlingScore[playerid] += 1;
  1163.                        
  1164.  
  1165.                     }
  1166.                     case 3:
  1167.                     {
  1168.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z);
  1169.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z-1,2.0);
  1170.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~1 ~w~pin!", 3000, 4);
  1171.                                 LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_GOAWAY;
  1172.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_LAST;
  1173.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_LAST;
  1174.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_LAST;
  1175.                         PlayersBowlingScore[playerid] += 1;
  1176.                        
  1177.                         }
  1178.                         case 4:
  1179.                     {
  1180.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z);
  1181.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z-1,2.0);
  1182.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z);
  1183.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z-1,2.0);
  1184.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~2 ~w~pins!", 3000, 4);
  1185.                                 LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_LAST;
  1186.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_LAST;
  1187.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_GOAWAY;
  1188.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_GOAWAY;
  1189.                         PlayersBowlingScore[playerid] += 2;
  1190.                        
  1191.                         }
  1192.                         case 5:
  1193.                     {
  1194.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z);
  1195.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z-1,2.0);
  1196.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z);
  1197.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z-1,2.0);
  1198.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~2 ~w~pins!", 3000, 4);
  1199.                                 LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_GOAWAY;
  1200.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_GOAWAY;
  1201.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_LAST;
  1202.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_LAST;
  1203.                         PlayersBowlingScore[playerid] += 2;
  1204.                        
  1205.                         }
  1206.                         case 6:
  1207.                     {
  1208.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z);
  1209.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z-1,2.0);
  1210.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z);
  1211.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z-1,2.0);
  1212.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z);
  1213.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z-1,2.0);
  1214.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~3 ~w~pins!", 3000, 4);
  1215.                                 LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_GOAWAY;
  1216.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_GOAWAY;
  1217.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_GOAWAY;
  1218.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_LAST;
  1219.                         PlayersBowlingScore[playerid] += 3;
  1220.                        
  1221.                         }
  1222.                         case 7:
  1223.                     {
  1224.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z);
  1225.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z-1,2.0);
  1226.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z);
  1227.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z-1,2.0);
  1228.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z);
  1229.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z-1,2.0);
  1230.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~3 ~w~pins!", 3000, 4);
  1231.                                 LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_LAST;
  1232.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_GOAWAY;
  1233.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_GOAWAY;
  1234.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_GOAWAY;
  1235.                         PlayersBowlingScore[playerid] += 3;
  1236.                         }
  1237.                 }
  1238.         }
  1239.         else if(PinsLeft[PlayersBowlingRoad[playerid]][playerid] == 5)
  1240.         {
  1241.             new knock = random(8);
  1242.                 switch(knock)
  1243.                 {
  1244.                     case 0:
  1245.                     {
  1246.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z);
  1247.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z-1,2.0);
  1248.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z);
  1249.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z-1,2.0);
  1250.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z);
  1251.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z-1,2.0);
  1252.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z);
  1253.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z-1,2.0);
  1254.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][5],x,y,z);
  1255.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][5],x,y,z-1,2.0);
  1256.                                 LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_GOAWAY;
  1257.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_GOAWAY;
  1258.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_GOAWAY;
  1259.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_GOAWAY;
  1260.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_GOAWAY;
  1261.                         PlayersBowlingScore[playerid] += 5;
  1262.                                 GameTextForPlayer(playerid,"~g~SPARE!", 3000, 4);
  1263.                                
  1264.                         }
  1265.                         case 1:
  1266.                     {
  1267.                         GameTextForPlayer(playerid,"~r~You missed!", 3000, 4);
  1268.                        
  1269.                         LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_LAST;
  1270.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_LAST;
  1271.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_LAST;
  1272.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_LAST;
  1273.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_LAST;
  1274.                     }
  1275.                     case 2:
  1276.                     {
  1277.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z);
  1278.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z-1,2.0);
  1279.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~1 ~w~pin!", 3000, 4);
  1280.                         LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_GOAWAY;
  1281.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_LAST;
  1282.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_LAST;
  1283.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_LAST;
  1284.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_LAST;
  1285.                         PlayersBowlingScore[playerid] += 1;
  1286.                     }
  1287.                     case 3:
  1288.                     {
  1289.                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z);
  1290.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z-1,2.0);
  1291.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z);
  1292.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z-1,2.0);
  1293.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~2 ~w~pins!", 3000, 4);
  1294.                         LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_GOAWAY;
  1295.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_LAST;
  1296.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_GOAWAY;
  1297.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_LAST;
  1298.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_LAST;
  1299.                         PlayersBowlingScore[playerid] += 2;
  1300.                     }
  1301.                     case 4:
  1302.                     {
  1303.                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z);
  1304.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z-1,2.0);
  1305.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~1 ~w~pin!", 3000, 4);
  1306.                         LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_LAST;
  1307.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_LAST;
  1308.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_LAST;
  1309.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_LAST;
  1310.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_GOAWAY;
  1311.                         PlayersBowlingScore[playerid] += 1;
  1312.  
  1313.                     }
  1314.                     case 5:
  1315.                     {
  1316.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z);
  1317.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z-1,2.0);
  1318.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z);
  1319.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z-1,2.0);
  1320.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z);
  1321.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z-1,2.0);
  1322.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~3 ~w~pins!", 3000, 4);
  1323.                         LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_GOAWAY;
  1324.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_LAST;
  1325.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_GOAWAY;
  1326.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_GOAWAY;
  1327.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_LAST;
  1328.                         PlayersBowlingScore[playerid] += 3;
  1329.                     }
  1330.                     case 6:
  1331.                     {
  1332.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][5],x,y,z);
  1333.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][5],x,y,z-1,2.0);
  1334.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z);
  1335.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z-1,2.0);
  1336.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z);
  1337.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z-1,2.0);
  1338.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~3 ~w~pins!", 3000, 4);
  1339.                         LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_LAST;
  1340.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_GOAWAY;
  1341.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_LAST;
  1342.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_GOAWAY;
  1343.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_GOAWAY;
  1344.                         PlayersBowlingScore[playerid] += 3;
  1345.                     }
  1346.                     case 7:
  1347.                     {
  1348.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z);
  1349.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z-1,2.0);
  1350.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z);
  1351.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z-1,2.0);
  1352.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][5],x,y,z);
  1353.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][5],x,y,z-1,2.0);
  1354.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z);
  1355.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z-1,2.0);
  1356.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~4 ~w~pins!", 3000, 4);
  1357.                         LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_LAST;
  1358.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_GOAWAY;
  1359.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_GOAWAY;
  1360.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_GOAWAY;
  1361.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_GOAWAY;
  1362.                         PlayersBowlingScore[playerid] += 4;
  1363.                     }
  1364.                 }
  1365.         }
  1366.         else if(PinsLeft[PlayersBowlingRoad[playerid]][playerid] == 6)
  1367.         {
  1368.                 new knock = random(10);
  1369.                 switch(knock)
  1370.                 {
  1371.                     case 0:
  1372.                     {
  1373.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z);
  1374.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z-1,2.0);
  1375.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z);
  1376.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z-1,2.0);
  1377.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z);
  1378.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z-1,2.0);
  1379.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z);
  1380.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z-1,2.0);
  1381.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][5],x,y,z);
  1382.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][5],x,y,z-1,2.0);
  1383.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][4],x,y,z);
  1384.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][4],x,y,z-1,2.0);
  1385.                                 GameTextForPlayer(playerid,"~g~SPARE!", 3000, 4);
  1386.                                 PlayersBowlingScore[playerid] += 6;
  1387.                                 LastPin[PlayersBowlingRoad[playerid]][4][playerid] = PIN_GOAWAY;
  1388.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_GOAWAY;
  1389.                         LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_GOAWAY;
  1390.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_GOAWAY;
  1391.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_GOAWAY;
  1392.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_GOAWAY;
  1393.                         }
  1394.                         case 1:
  1395.                     {
  1396.                         GameTextForPlayer(playerid,"~r~You missed!", 3000, 4);
  1397.                        
  1398.                         LastPin[PlayersBowlingRoad[playerid]][4][playerid] = PIN_LAST;
  1399.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_LAST;
  1400.                         LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_LAST;
  1401.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_LAST;
  1402.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_LAST;
  1403.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_LAST;
  1404.                     }
  1405.                     case 2:
  1406.                     {
  1407.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z);
  1408.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z-1,2.0);
  1409.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~1 ~w~pin!", 3000, 4);
  1410.                         LastPin[PlayersBowlingRoad[playerid]][4][playerid] = PIN_LAST;
  1411.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_LAST;
  1412.                         LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_GOAWAY;
  1413.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_LAST;
  1414.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_LAST;
  1415.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_LAST;
  1416.                         PlayersBowlingScore[playerid] += 1;
  1417.  
  1418.                     }
  1419.                     case 3:
  1420.                     {
  1421.                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z);
  1422.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z-1,2.0);
  1423.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z);
  1424.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z-1,2.0);
  1425.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~2 ~w~pins!", 3000, 4);
  1426.                                 LastPin[PlayersBowlingRoad[playerid]][4][playerid] = PIN_LAST;
  1427.                         LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_GOAWAY;
  1428.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_LAST;
  1429.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_GOAWAY;
  1430.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_LAST;
  1431.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_LAST;
  1432.                         PlayersBowlingScore[playerid] += 2;
  1433.                        
  1434.                     }
  1435.                     case 4:
  1436.                     {
  1437.                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z);
  1438.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z-1,2.0);
  1439.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~1 ~w~pin!", 3000, 4);
  1440.                                 LastPin[PlayersBowlingRoad[playerid]][4][playerid] = PIN_LAST;
  1441.                         LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_LAST;
  1442.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_LAST;
  1443.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_LAST;
  1444.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_LAST;
  1445.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_GOAWAY;
  1446.                         PlayersBowlingScore[playerid] += 1;
  1447.                        
  1448.  
  1449.                     }
  1450.                     case 5:
  1451.                     {
  1452.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][4],x,y,z);
  1453.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][4],x,y,z-1,2.0);
  1454.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z);
  1455.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z-1,2.0);
  1456.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z);
  1457.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z-1,2.0);
  1458.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~3 ~w~pins!", 3000, 4);
  1459.                                 LastPin[PlayersBowlingRoad[playerid]][4][playerid] = PIN_GOAWAY;
  1460.                                 LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_LAST;
  1461.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_LAST;
  1462.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_GOAWAY;
  1463.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_GOAWAY;
  1464.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_LAST;
  1465.                         PlayersBowlingScore[playerid] += 3;
  1466.                        
  1467.                     }
  1468.                     case 6:
  1469.                     {
  1470.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][4],x,y,z);
  1471.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][4],x,y,z-1,2.0);
  1472.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z);
  1473.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z-1,2.0);
  1474.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z);
  1475.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z-1,2.0);
  1476.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z);
  1477.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z-1,2.0);
  1478.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~4 ~w~pins!", 3000, 4);
  1479.                                 LastPin[PlayersBowlingRoad[playerid]][4][playerid] = PIN_GOAWAY;
  1480.                                 LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_LAST;
  1481.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_LAST;
  1482.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_GOAWAY;
  1483.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_GOAWAY;
  1484.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_GOAWAY;
  1485.                         PlayersBowlingScore[playerid] += 4;
  1486.                        
  1487.                     }
  1488.                     case 7:
  1489.                     {
  1490.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][4],x,y,z);
  1491.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][4],x,y,z-1,2.0);
  1492.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][5],x,y,z);
  1493.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][5],x,y,z-1,2.0);
  1494.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z);
  1495.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z-1,2.0);
  1496.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z);
  1497.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z-1,2.0);
  1498.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z);
  1499.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z-1,2.0);
  1500.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~5 ~w~pins!", 3000, 4);
  1501.                                 LastPin[PlayersBowlingRoad[playerid]][4][playerid] = PIN_GOAWAY;
  1502.                                 LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_LAST;
  1503.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_GOAWAY;
  1504.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_GOAWAY;
  1505.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_GOAWAY;
  1506.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_GOAWAY;
  1507.                         PlayersBowlingScore[playerid] += 5;
  1508.                     }
  1509.                     case 8:
  1510.                     {
  1511.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][5],x,y,z);
  1512.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][5],x,y,z-1,2.0);
  1513.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z);
  1514.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z-1,2.0);
  1515.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z);
  1516.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z-1,2.0);
  1517.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~3 ~w~pins!", 3000, 4);
  1518.                                 LastPin[PlayersBowlingRoad[playerid]][4][playerid] = PIN_LAST;
  1519.                                 LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_LAST;
  1520.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_GOAWAY;
  1521.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_LAST;
  1522.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_GOAWAY;
  1523.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_GOAWAY;
  1524.                         PlayersBowlingScore[playerid] += 3;
  1525.                    
  1526.                     }
  1527.                     case 9:
  1528.                     {
  1529.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][4],x,y,z);
  1530.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][4],x,y,z-1,2.0);
  1531.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][5],x,y,z);
  1532.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][5],x,y,z-1,2.0);
  1533.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z);
  1534.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z-1,2.0);
  1535.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z);
  1536.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z-1,2.0);
  1537.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~4 ~w~pins!", 3000, 4);
  1538.                                 LastPin[PlayersBowlingRoad[playerid]][4][playerid] = PIN_GOAWAY;
  1539.                                 LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_LAST;
  1540.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_GOAWAY;
  1541.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_LAST;
  1542.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_GOAWAY;
  1543.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_GOAWAY;
  1544.                         PlayersBowlingScore[playerid] += 4;
  1545.                    
  1546.                     }
  1547.                 }
  1548.         }
  1549.         else if(PinsLeft[PlayersBowlingRoad[playerid]][playerid] == 7)
  1550.         {
  1551.             new knock = random(13);
  1552.                 switch(knock)
  1553.                 {
  1554.                     case 0:
  1555.                     {
  1556.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z);
  1557.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z-1,2.0);
  1558.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z);
  1559.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z-1,2.0);
  1560.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z);
  1561.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z-1,2.0);
  1562.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z);
  1563.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z-1,2.0);
  1564.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][5],x,y,z);
  1565.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][5],x,y,z-1,2.0);
  1566.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][4],x,y,z);
  1567.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][4],x,y,z-1,2.0);
  1568.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][3],x,y,z);
  1569.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][3],x,y,z-1,2.0);
  1570.                                 GameTextForPlayer(playerid,"~g~SPARE!", 3000, 4);
  1571.                                 LastPin[PlayersBowlingRoad[playerid]][3][playerid] = PIN_GOAWAY;
  1572.                                 LastPin[PlayersBowlingRoad[playerid]][4][playerid] = PIN_GOAWAY;
  1573.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_GOAWAY;
  1574.                         LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_GOAWAY;
  1575.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_GOAWAY;
  1576.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_GOAWAY;
  1577.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_GOAWAY;
  1578.                         PlayersBowlingScore[playerid] += 7;
  1579.                         }
  1580.                         case 1:
  1581.                     {
  1582.                         GameTextForPlayer(playerid,"~r~You missed!", 3000, 4);
  1583.                        
  1584.                         LastPin[PlayersBowlingRoad[playerid]][3][playerid] = PIN_LAST;
  1585.                         LastPin[PlayersBowlingRoad[playerid]][4][playerid] = PIN_LAST;
  1586.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_LAST;
  1587.                         LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_LAST;
  1588.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_LAST;
  1589.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_LAST;
  1590.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_LAST;
  1591.                     }
  1592.                     case 2:
  1593.                     {
  1594.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z);
  1595.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z-1,2.0);
  1596.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~1 ~w~pin!", 3000, 4);
  1597.                                 LastPin[PlayersBowlingRoad[playerid]][3][playerid] = PIN_LAST;
  1598.                         LastPin[PlayersBowlingRoad[playerid]][4][playerid] = PIN_LAST;
  1599.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_LAST;
  1600.                         LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_GOAWAY;
  1601.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_LAST;
  1602.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_LAST;
  1603.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_LAST;
  1604.                         PlayersBowlingScore[playerid] += 1;
  1605.                        
  1606.  
  1607.                     }
  1608.                     case 3:
  1609.                     {
  1610.                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z);
  1611.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z-1,2.0);
  1612.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z);
  1613.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z-1,2.0);
  1614.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~2 ~w~pins!", 3000, 4);
  1615.                                 LastPin[PlayersBowlingRoad[playerid]][3][playerid] = PIN_LAST;
  1616.                                 LastPin[PlayersBowlingRoad[playerid]][4][playerid] = PIN_LAST;
  1617.                         LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_GOAWAY;
  1618.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_LAST;
  1619.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_GOAWAY;
  1620.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_LAST;
  1621.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_LAST;
  1622.                         PlayersBowlingScore[playerid] += 2;
  1623.                     }
  1624.                     case 4:
  1625.                     {
  1626.                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z);
  1627.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z-1,2.0);
  1628.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~1 ~w~pin!", 3000, 4);
  1629.                                 LastPin[PlayersBowlingRoad[playerid]][3][playerid] = PIN_LAST;
  1630.                                 LastPin[PlayersBowlingRoad[playerid]][4][playerid] = PIN_LAST;
  1631.                         LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_LAST;
  1632.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_LAST;
  1633.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_LAST;
  1634.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_LAST;
  1635.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_GOAWAY;
  1636.                         PlayersBowlingScore[playerid] += 1;
  1637.  
  1638.                     }
  1639.                     case 5:
  1640.                     {
  1641.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][4],x,y,z);
  1642.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][4],x,y,z-1,2.0);
  1643.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z);
  1644.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z-1,2.0);
  1645.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z);
  1646.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z-1,2.0);
  1647.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~3 ~w~pins!", 3000, 4);
  1648.                                 LastPin[PlayersBowlingRoad[playerid]][3][playerid] = PIN_LAST;
  1649.                                 LastPin[PlayersBowlingRoad[playerid]][4][playerid] = PIN_GOAWAY;
  1650.                                 LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_LAST;
  1651.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_LAST;
  1652.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_GOAWAY;
  1653.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_GOAWAY;
  1654.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_LAST;
  1655.                         PlayersBowlingScore[playerid] += 3;
  1656.                     }
  1657.                     case 6:
  1658.                     {
  1659.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][4],x,y,z);
  1660.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][4],x,y,z-1,2.0);
  1661.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z);
  1662.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z-1,2.0);
  1663.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z);
  1664.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z-1,2.0);
  1665.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z);
  1666.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z-1,2.0);
  1667.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~4 ~w~pins!", 3000, 4);
  1668.                                 LastPin[PlayersBowlingRoad[playerid]][3][playerid] = PIN_LAST;
  1669.                                 LastPin[PlayersBowlingRoad[playerid]][4][playerid] = PIN_GOAWAY;
  1670.                                 LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_LAST;
  1671.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_LAST;
  1672.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_GOAWAY;
  1673.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_GOAWAY;
  1674.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_GOAWAY;
  1675.                         PlayersBowlingScore[playerid] += 4;
  1676.                     }
  1677.                     case 7:
  1678.                     {
  1679.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][4],x,y,z);
  1680.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][4],x,y,z-1,2.0);
  1681.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][5],x,y,z);
  1682.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][5],x,y,z-1,2.0);
  1683.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z);
  1684.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z-1,2.0);
  1685.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z);
  1686.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z-1,2.0);
  1687.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z);
  1688.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z-1,2.0);
  1689.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~5 ~w~pins!", 3000, 4);
  1690.                                 LastPin[PlayersBowlingRoad[playerid]][3][playerid] = PIN_LAST;
  1691.                                 LastPin[PlayersBowlingRoad[playerid]][4][playerid] = PIN_GOAWAY;
  1692.                                 LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_LAST;
  1693.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_GOAWAY;
  1694.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_GOAWAY;
  1695.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_GOAWAY;
  1696.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_GOAWAY;
  1697.                         PlayersBowlingScore[playerid] += 5;
  1698.                     }
  1699.                     case 8:
  1700.                     {
  1701.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][5],x,y,z);
  1702.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][5],x,y,z-1,2.0);
  1703.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z);
  1704.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z-1,2.0);
  1705.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z);
  1706.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z-1,2.0);
  1707.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~3 ~w~pins!", 3000, 4);
  1708.                                 LastPin[PlayersBowlingRoad[playerid]][3][playerid] = PIN_LAST;
  1709.                                 LastPin[PlayersBowlingRoad[playerid]][4][playerid] = PIN_LAST;
  1710.                                 LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_LAST;
  1711.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_GOAWAY;
  1712.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_LAST;
  1713.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_GOAWAY;
  1714.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_GOAWAY;
  1715.                         PlayersBowlingScore[playerid] += 3;
  1716.  
  1717.                     }
  1718.                     case 9:
  1719.                     {
  1720.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][4],x,y,z);
  1721.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][4],x,y,z-1,2.0);
  1722.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][5],x,y,z);
  1723.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][5],x,y,z-1,2.0);
  1724.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z);
  1725.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z-1,2.0);
  1726.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z);
  1727.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z-1,2.0);
  1728.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~4 ~w~pins!", 3000, 4);
  1729.                                 LastPin[PlayersBowlingRoad[playerid]][3][playerid] = PIN_LAST;
  1730.                                 LastPin[PlayersBowlingRoad[playerid]][4][playerid] = PIN_GOAWAY;
  1731.                                 LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_LAST;
  1732.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_GOAWAY;
  1733.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_LAST;
  1734.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_GOAWAY;
  1735.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_GOAWAY;
  1736.                         PlayersBowlingScore[playerid] += 4;
  1737.  
  1738.                     }
  1739.                     case 10:
  1740.                     {
  1741.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z);
  1742.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z-1,2.0);
  1743.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z);
  1744.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z-1,2.0);
  1745.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][3],x,y,z);
  1746.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][3],x,y,z-1,2.0);
  1747.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~3 ~w~pins!", 3000, 4);
  1748.                                 LastPin[PlayersBowlingRoad[playerid]][3][playerid] = PIN_GOAWAY;
  1749.                                 LastPin[PlayersBowlingRoad[playerid]][4][playerid] = PIN_LAST;
  1750.                                 LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_GOAWAY;
  1751.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_LAST;
  1752.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_GOAWAY;
  1753.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_LAST;
  1754.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_LAST;
  1755.                         PlayersBowlingScore[playerid] += 3;
  1756.  
  1757.                     }
  1758.                     case 11:
  1759.                     {
  1760.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z);
  1761.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z-1,2.0);
  1762.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z);
  1763.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z-1,2.0);
  1764.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][3],x,y,z);
  1765.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][3],x,y,z-1,2.0);
  1766.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][4],x,y,z);
  1767.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][4],x,y,z-1,2.0);
  1768.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z);
  1769.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z-1,2.0);
  1770.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~5 ~w~pins!", 3000, 4);
  1771.                                 LastPin[PlayersBowlingRoad[playerid]][3][playerid] = PIN_GOAWAY;
  1772.                                 LastPin[PlayersBowlingRoad[playerid]][4][playerid] = PIN_GOAWAY;
  1773.                                 LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_GOAWAY;
  1774.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_LAST;
  1775.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_GOAWAY;
  1776.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_GOAWAY;
  1777.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_LAST;
  1778.                         PlayersBowlingScore[playerid] += 5;
  1779.                     }
  1780.                     case 12:
  1781.                     {
  1782.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z);
  1783.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z-1,2.0);
  1784.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z);
  1785.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z-1,2.0);
  1786.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][3],x,y,z);
  1787.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][3],x,y,z-1,2.0);
  1788.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][4],x,y,z);
  1789.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][4],x,y,z-1,2.0);
  1790.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z);
  1791.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z-1,2.0);
  1792.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~5 ~w~pins!", 3000, 4);
  1793.                                 LastPin[PlayersBowlingRoad[playerid]][3][playerid] = PIN_GOAWAY;
  1794.                                 LastPin[PlayersBowlingRoad[playerid]][4][playerid] = PIN_GOAWAY;
  1795.                                 LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_GOAWAY;
  1796.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_LAST;
  1797.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_GOAWAY;
  1798.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_GOAWAY;
  1799.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_LAST;
  1800.                         PlayersBowlingScore[playerid] += 5;
  1801.                     }
  1802.                 }
  1803.         }
  1804.         else if(PinsLeft[PlayersBowlingRoad[playerid]][playerid] == 8)
  1805.         {
  1806.             new knock = random(8);
  1807.                 switch(knock)
  1808.                 {
  1809.                     case 0:
  1810.                     {
  1811.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z);
  1812.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z-1,2.0);
  1813.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z);
  1814.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z-1,2.0);
  1815.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z);
  1816.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z-1,2.0);
  1817.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z);
  1818.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z-1,2.0);
  1819.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][5],x,y,z);
  1820.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][5],x,y,z-1,2.0);
  1821.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][4],x,y,z);
  1822.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][4],x,y,z-1,2.0);
  1823.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][3],x,y,z);
  1824.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][3],x,y,z-1,2.0);
  1825.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][2],x,y,z);
  1826.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][2],x,y,z-1,2.0);
  1827.                                 GameTextForPlayer(playerid,"~g~SPARE!", 3000, 4);
  1828.                                
  1829.                         LastPin[PlayersBowlingRoad[playerid]][2][playerid] = PIN_GOAWAY;
  1830.                                 LastPin[PlayersBowlingRoad[playerid]][3][playerid] = PIN_GOAWAY;
  1831.                         LastPin[PlayersBowlingRoad[playerid]][4][playerid] = PIN_GOAWAY;
  1832.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_GOAWAY;
  1833.                         LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_GOAWAY;
  1834.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_GOAWAY;
  1835.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_GOAWAY;
  1836.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_GOAWAY;
  1837.                         PlayersBowlingScore[playerid] += 8;
  1838.                     }
  1839.                         case 1:
  1840.                     {
  1841.                         GameTextForPlayer(playerid,"~r~You missed!", 3000, 4);
  1842.                        
  1843.                         LastPin[PlayersBowlingRoad[playerid]][2][playerid] = PIN_LAST;
  1844.                         LastPin[PlayersBowlingRoad[playerid]][3][playerid] = PIN_LAST;
  1845.                         LastPin[PlayersBowlingRoad[playerid]][4][playerid] = PIN_LAST;
  1846.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_LAST;
  1847.                         LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_LAST;
  1848.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_LAST;
  1849.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_LAST;
  1850.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_LAST;
  1851.                     }
  1852.                     case 2:
  1853.                     {
  1854.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z);
  1855.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z-1,2.0);
  1856.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~1 ~w~pin!", 3000, 4);
  1857.                                 LastPin[PlayersBowlingRoad[playerid]][2][playerid] = PIN_LAST;
  1858.                         LastPin[PlayersBowlingRoad[playerid]][3][playerid] = PIN_LAST;
  1859.                         LastPin[PlayersBowlingRoad[playerid]][4][playerid] = PIN_LAST;
  1860.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_LAST;
  1861.                         LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_LAST;
  1862.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_LAST;
  1863.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_LAST;
  1864.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_GOAWAY;
  1865.                         PlayersBowlingScore[playerid] += 1;
  1866.                        
  1867.                     }
  1868.                     case 3:
  1869.                     {
  1870.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z);
  1871.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z-1,2.0);
  1872.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~1 ~w~pin!", 3000, 4);
  1873.                                 LastPin[PlayersBowlingRoad[playerid]][2][playerid] = PIN_LAST;
  1874.                         LastPin[PlayersBowlingRoad[playerid]][3][playerid] = PIN_LAST;
  1875.                         LastPin[PlayersBowlingRoad[playerid]][4][playerid] = PIN_LAST;
  1876.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_LAST;
  1877.                         LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_GOAWAY;
  1878.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_LAST;
  1879.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_LAST;
  1880.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_LAST;
  1881.                         PlayersBowlingScore[playerid] += 1;
  1882.                        
  1883.                     }
  1884.                     case 4:
  1885.                     {
  1886.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z);
  1887.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z-1,2.0);
  1888.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z);
  1889.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z-1,2.0);
  1890.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][3],x,y,z);
  1891.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][3],x,y,z-1,2.0);
  1892.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~3 ~w~pins!", 3000, 4);
  1893.                                 LastPin[PlayersBowlingRoad[playerid]][2][playerid] = PIN_LAST;
  1894.                         LastPin[PlayersBowlingRoad[playerid]][3][playerid] = PIN_GOAWAY;
  1895.                         LastPin[PlayersBowlingRoad[playerid]][4][playerid] = PIN_LAST;
  1896.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_LAST;
  1897.                         LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_GOAWAY;
  1898.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_GOAWAY;
  1899.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_LAST;
  1900.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_LAST;
  1901.                         PlayersBowlingScore[playerid] += 3;
  1902.                        
  1903.                     }
  1904.                     case 5:
  1905.                     {
  1906.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z);
  1907.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z-1,2.0);
  1908.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z);
  1909.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z-1,2.0);
  1910.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][5],x,y,z);
  1911.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][5],x,y,z-1,2.0);
  1912.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~3 ~w~pins!", 3000, 4);
  1913.                                 LastPin[PlayersBowlingRoad[playerid]][2][playerid] = PIN_LAST;
  1914.                         LastPin[PlayersBowlingRoad[playerid]][3][playerid] = PIN_LAST;
  1915.                         LastPin[PlayersBowlingRoad[playerid]][4][playerid] = PIN_LAST;
  1916.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_GOAWAY;
  1917.                         LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_LAST;
  1918.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_LAST;
  1919.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_GOAWAY;
  1920.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_GOAWAY;
  1921.                         PlayersBowlingScore[playerid] += 3;
  1922.  
  1923.                     }
  1924.                     case 6:
  1925.                     {
  1926.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z);
  1927.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z-1,2.0);
  1928.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z);
  1929.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z-1,2.0);
  1930.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][5],x,y,z);
  1931.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][5],x,y,z-1,2.0);
  1932.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][2],x,y,z);
  1933.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][2],x,y,z-1,2.0);
  1934.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~4 ~w~pins!", 3000, 4);
  1935.                                 LastPin[PlayersBowlingRoad[playerid]][2][playerid] = PIN_GOAWAY;
  1936.                         LastPin[PlayersBowlingRoad[playerid]][3][playerid] = PIN_LAST;
  1937.                         LastPin[PlayersBowlingRoad[playerid]][4][playerid] = PIN_LAST;
  1938.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_GOAWAY;
  1939.                         LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_LAST;
  1940.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_LAST;
  1941.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_GOAWAY;
  1942.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_GOAWAY;
  1943.                         PlayersBowlingScore[playerid] += 4;
  1944.                     }
  1945.                     case 7:
  1946.                     {
  1947.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z);
  1948.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z-1,2.0);
  1949.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z);
  1950.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z-1,2.0);
  1951.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z);
  1952.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z-1,2.0);
  1953.                                 GameTextForPlayer(playerid,"~r~You have knocked only ~y~3 ~w~pins!", 3000, 4);
  1954.                                 LastPin[PlayersBowlingRoad[playerid]][2][playerid] = PIN_LAST;
  1955.                         LastPin[PlayersBowlingRoad[playerid]][3][playerid] = PIN_LAST;
  1956.                         LastPin[PlayersBowlingRoad[playerid]][4][playerid] = PIN_LAST;
  1957.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_LAST;
  1958.                         LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_GOAWAY;
  1959.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_GOAWAY;
  1960.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_GOAWAY;
  1961.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_LAST;
  1962.                         PlayersBowlingScore[playerid] += 3;
  1963.                     }
  1964.                 }
  1965.         }
  1966.         else if(PinsLeft[PlayersBowlingRoad[playerid]][playerid] == 9)
  1967.         {
  1968.             new knock = random(2);
  1969.                 switch(knock)
  1970.                 {
  1971.                     case 0:
  1972.                     {
  1973.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z);
  1974.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][9],x,y,z-1,2.0);
  1975.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z);
  1976.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][8],x,y,z-1,2.0);
  1977.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z);
  1978.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][7],x,y,z-1,2.0);
  1979.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z);
  1980.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][6],x,y,z-1,2.0);
  1981.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][5],x,y,z);
  1982.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][5],x,y,z-1,2.0);
  1983.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][4],x,y,z);
  1984.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][4],x,y,z-1,2.0);
  1985.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][3],x,y,z);
  1986.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][3],x,y,z-1,2.0);
  1987.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][2],x,y,z);
  1988.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][2],x,y,z-1,2.0);
  1989.                                 GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][1],x,y,z);
  1990.                                 MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][1],x,y,z-1,2.0);
  1991.                                 GameTextForPlayer(playerid,"~g~SPARE!", 3000, 4);
  1992.                                
  1993.                                 LastPin[PlayersBowlingRoad[playerid]][1][playerid] = PIN_GOAWAY;
  1994.                         LastPin[PlayersBowlingRoad[playerid]][2][playerid] = PIN_GOAWAY;
  1995.                                 LastPin[PlayersBowlingRoad[playerid]][3][playerid] = PIN_GOAWAY;
  1996.                         LastPin[PlayersBowlingRoad[playerid]][4][playerid] = PIN_GOAWAY;
  1997.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_GOAWAY;
  1998.                         LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_GOAWAY;
  1999.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_GOAWAY;
  2000.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_GOAWAY;
  2001.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_GOAWAY;
  2002.                         PlayersBowlingScore[playerid] += 9;
  2003.                         }
  2004.                         case 1:
  2005.                     {
  2006.                         GameTextForPlayer(playerid,"~r~You missed!", 3000, 4);
  2007.                        
  2008.                         LastPin[PlayersBowlingRoad[playerid]][1][playerid] = PIN_LAST;
  2009.                         LastPin[PlayersBowlingRoad[playerid]][2][playerid] = PIN_LAST;
  2010.                         LastPin[PlayersBowlingRoad[playerid]][3][playerid] = PIN_LAST;
  2011.                         LastPin[PlayersBowlingRoad[playerid]][4][playerid] = PIN_LAST;
  2012.                         LastPin[PlayersBowlingRoad[playerid]][5][playerid] = PIN_LAST;
  2013.                         LastPin[PlayersBowlingRoad[playerid]][6][playerid] = PIN_LAST;
  2014.                         LastPin[PlayersBowlingRoad[playerid]][7][playerid] = PIN_LAST;
  2015.                         LastPin[PlayersBowlingRoad[playerid]][8][playerid] = PIN_LAST;
  2016.                         LastPin[PlayersBowlingRoad[playerid]][9][playerid] = PIN_LAST;
  2017.                     }
  2018.                 }
  2019.         }
  2020.         return 1;
  2021. }
  2022. //bowling timers
  2023. forward UpdateDjText();
  2024. public UpdateDjText()
  2025. {
  2026.     new color = random(25);
  2027.         new colors[25] = {
  2028.                 0xFF0000FF, 0xFF2C00FF, 0xFF5000FF, 0xFF8700FF, 0xFFA700FF,
  2029.                 0xFFDC00FF, 0xFFFB00FF, 0xC4FF00FF, 0x7BFF00FF, 0x00FF00FF,
  2030.                 0x00FF1EFF, 0x00FF3BFF, 0x00FF7CFF, 0x00FFAEFF, 0x00FFD5FF,
  2031.                 0x00FFFFFF, 0x00CCFFFF, 0x00ACFFFF, 0x0083FFFF, 0x0054FFFF,
  2032.                 0x0000FFFF, 0x2C00FFFF, 0x5F00FFFF, 0x9B00FFFF, 0xCB00FFFF
  2033.         };
  2034.  
  2035.         new str[5][128] = {
  2036.                 {"> Dj Nexotronix <"},
  2037.         {"* Dj Nexotronix *"},
  2038.         {"! Dj Nexotronix !"},
  2039.         {"- Dj Nexotronix -"},
  2040.         {"# Dj Nexotronix #"}
  2041.         };
  2042.     UpdateDynamic3DTextLabelText(DDJ, colors[color], str[random(5)]);
  2043.     return 1;
  2044. }
  2045. forward UpdateDjAnim();
  2046. public UpdateDjAnim()
  2047. {
  2048.     for(new i=0; i<MAX_PLAYERS; i++)
  2049.         {
  2050.                 if(IsPlayerNPC(i))
  2051.                 {
  2052.                 new npcname[MAX_PLAYER_NAME];
  2053.                 GetPlayerName(i, npcname, sizeof(npcname));
  2054.                 if(!strcmp(npcname, "Dj_Nexotronix", true))
  2055.                         {
  2056.                             new anm = random(7);
  2057.                                 switch(anm)
  2058.                                 {
  2059.                         case 0:ApplyAnimation(i, "SCRATCHING","scdldlp", 4.0, 1, 1, 1, 1, 0, 1);
  2060.                         case 1:ApplyAnimation(i, "SCRATCHING","scdlulp", 4.0, 1, 1, 1, 1, 0, 1);
  2061.                         case 2:ApplyAnimation(i, "SCRATCHING","scdrdlp", 4.0, 1, 1, 1, 1, 0, 1);
  2062.                         case 3:ApplyAnimation(i, "SCRATCHING","scdrulp", 4.0, 1, 1, 1, 1, 0, 1);
  2063.                         /*case 4:ApplyAnimation(i, "SCRATCHING","sclng_l", 4.0, 1, 1, 1, 1, 0, 1);
  2064.                         case 5:ApplyAnimation(i, "SCRATCHING","sclng_r", 4.0, 1, 1, 1, 1, 0, 1);
  2065.                         case 6:ApplyAnimation(i, "SCRATCHING","scmid_l", 4.0, 1, 1, 1, 1, 0, 1);
  2066.                         case 7:ApplyAnimation(i, "SCRATCHING","scmid_r", 4.0, 1, 1, 1, 1, 0, 1);*/
  2067.                         case 4:ApplyAnimation(i,"RIOT", "RIOT_CHANT",4.1,1,1,1,1,0,1);
  2068.                         case 5:ApplyAnimation(i, "DANCING","dnce_M_b", 4.0, 1, 1, 1, 1, 0, 1);
  2069.                         case 6:ApplyAnimation(i, "SCRATCHING","sclng_l", 4.0, 1, 1, 1, 1, 0, 1);
  2070.                 }
  2071.  
  2072.                         }
  2073.                 }
  2074.         }
  2075. }
  2076. forward PinsWaitTimer(playerid);
  2077. public PinsWaitTimer(playerid)
  2078. {
  2079.     new Float:x,Float:y,Float:z;
  2080.     for(new pin=0; pin<=MAX_PINS; pin++)
  2081.         {
  2082.             if(LastPin[PlayersBowlingRoad[playerid]][pin][playerid] == PIN_GOAWAY)
  2083.             {
  2084.                         GetDynamicObjectPos(BowlingPins[PlayersBowlingRoad[playerid]][pin],x,y,z);
  2085.                         MoveDynamicObject(BowlingPins[PlayersBowlingRoad[playerid]][pin],x,y,1.7151190042496,1.0);
  2086.                         BowlingPinsWaitEndTimer[playerid] = SetTimerEx("PinsWaitEnd",2000,false,"d",playerid);
  2087.                 }
  2088.         }
  2089. }
  2090. forward PinsWaitEnd(playerid);
  2091. public PinsWaitEnd(playerid)
  2092. {
  2093.         BowlingStatus[playerid]=F_BOWLING_THROW;
  2094. }
  2095. forward BowlingCountDown(playerid);
  2096. public BowlingCountDown(playerid)
  2097. {
  2098.            
  2099.                 BowlingSeconds[playerid] -= 1;
  2100.                 new str[150];
  2101.                         if(PlayersBowlingRoad[playerid]==0)
  2102.                         {
  2103.                                 format(str,150,"{E32A2A}[{FFFFFF} Road 1{E32A2A} ]\n Busy \n {BBBB00}Player: {FFFFFF}%s\n {BBBB00} Time:{FFFFFF} %02d : %02d \n {BBBB00} Points:{FFFFFF} %i",PlayerName(playerid),BowlingMinutes[playerid],BowlingSeconds[playerid],PlayersBowlingScore[playerid]);
  2104.                                 UpdateDynamic3DTextLabelText(BowlingRoadScreen[0], 0xFFFFFF,str);
  2105.                         }
  2106.                         if(PlayersBowlingRoad[playerid]==1)
  2107.                         {
  2108.                                 format(str,150,"{E32A2A}[{FFFFFF} Road 2{E32A2A} ]\n Busy \n {BBBB00}Player: {FFFFFF}%s\n {BBBB00} Time:{FFFFFF} %02d : %02d \n {BBBB00} Points:{FFFFFF} %i",PlayerName(playerid),BowlingMinutes[playerid],BowlingSeconds[playerid],PlayersBowlingScore[playerid]);
  2109.                                 UpdateDynamic3DTextLabelText(BowlingRoadScreen[1], 0xFFFFFF,str);
  2110.                         }
  2111.                         if(PlayersBowlingRoad[playerid]==2)
  2112.                         {
  2113.                                 format(str,150,"{E32A2A}[{FFFFFF} Road 3{E32A2A} ]\n Busy \n {BBBB00}Player: {FFFFFF}%s\n {BBBB00} Time:{FFFFFF} %02d : %02d \n {BBBB00} Points:{FFFFFF} %i",PlayerName(playerid),BowlingMinutes[playerid],BowlingSeconds[playerid],PlayersBowlingScore[playerid]);
  2114.                                 UpdateDynamic3DTextLabelText(BowlingRoadScreen[2], 0xFFFFFF,str);
  2115.                         }
  2116.                         if(PlayersBowlingRoad[playerid]==3)
  2117.                         {
  2118.                                 format(str,150,"{E32A2A}[{FFFFFF} Road 4{E32A2A} ]\n Busy \n {BBBB00}Player: {FFFFFF}%s\n {BBBB00} Time:{FFFFFF} %02d : %02d \n {BBBB00} Points:{FFFFFF} %i",PlayerName(playerid),BowlingMinutes[playerid],BowlingSeconds[playerid],PlayersBowlingScore[playerid]);
  2119.                                 UpdateDynamic3DTextLabelText(BowlingRoadScreen[3], 0xFFFFFF,str);
  2120.                         }
  2121.                         if(PlayersBowlingRoad[playerid]==4)
  2122.                         {
  2123.                                 format(str,150,"{E32A2A}[{FFFFFF} Road 5{E32A2A} ]\n Busy \n {BBBB00}Player: {FFFFFF}%s\n {BBBB00} Time:{FFFFFF} %02d : %02d \n {BBBB00} Points:{FFFFFF} %i",PlayerName(playerid),BowlingMinutes[playerid],BowlingSeconds[playerid],PlayersBowlingScore[playerid]);
  2124.                                 UpdateDynamic3DTextLabelText(BowlingRoadScreen[4], 0xFFFFFF,str);
  2125.                         }
  2126.                         if(BowlingSeconds[playerid] == 0 && BowlingMinutes[playerid] > 0 )
  2127.                 {
  2128.                         BowlingSeconds[playerid] = 59;
  2129.                         BowlingMinutes[playerid] -= 1;
  2130.                 }
  2131.                 else if(BowlingMinutes[playerid] == 0 && BowlingSeconds[playerid] == 0)
  2132.                         {
  2133.                                 BowlingSeconds[playerid] = 0;
  2134.                                 BowlingMinutes[playerid] = 0;
  2135.                                 AbleToPlay[playerid] = 0;
  2136.                                 BowlingRoadStatus[PlayersBowlingRoad[playerid]] = ROAD_EMPTY;
  2137.                                 KillTimer(BowlingTimer[PlayersBowlingRoad[playerid]]);
  2138.                                 SendClientMessage(playerid,COLOR_CMDERROR,"Time of your game ended.");
  2139.                                 scmf(playerid,COLOR_CMDERROR,"{FFFFFF}You earned {00CC00}%i {FFFFFF}points and taked {00CC00}${FFFFFF}%.",PlayersBowlingScore[playerid],PlayersBowlingScore[playerid]*10);
  2140.                                 GivePlayerMoney(playerid,PlayersBowlingScore[playerid]*10);
  2141.                                 PlayersBowlingScore[playerid] = 0;
  2142.                                 DestroyBall(playerid);
  2143.                                 if(PlayersBowlingRoad[playerid]==0)
  2144.                                 {
  2145.                                         UpdateDynamic3DTextLabelText(BowlingRoadScreen[0], 0xFFFFFF,"{008800}[{FFFFFF} Road 1{008800} ]\n Empty");
  2146.                                         PlayersBowlingRoad[playerid] = ROAD_NONE;
  2147.                                         DestroyPins(0);
  2148.                                 }
  2149.                                 else if(PlayersBowlingRoad[playerid]==1)
  2150.                                 {
  2151.                                         UpdateDynamic3DTextLabelText(BowlingRoadScreen[1], 0xFFFFFF,"{008800}[{FFFFFF} Road 2{008800} ]\n Empty");
  2152.                                         PlayersBowlingRoad[playerid] = ROAD_NONE;
  2153.                                         DestroyPins(1);
  2154.                                 }
  2155.                                 else if(PlayersBowlingRoad[playerid]==2)
  2156.                                 {
  2157.                                         UpdateDynamic3DTextLabelText(BowlingRoadScreen[2], 0xFFFFFF,"{008800}[{FFFFFF} Road 3{008800} ]\n Empty");
  2158.                                         PlayersBowlingRoad[playerid] = ROAD_NONE;
  2159.                                         DestroyPins(2);
  2160.                                 }
  2161.                                 else if(PlayersBowlingRoad[playerid]==3)
  2162.                                 {
  2163.                                         UpdateDynamic3DTextLabelText(BowlingRoadScreen[3], 0xFFFFFF,"{008800}[{FFFFFF} Road 4{008800} ]\n Empty");
  2164.                                         PlayersBowlingRoad[playerid] = ROAD_NONE;
  2165.                                         DestroyPins(3);
  2166.                                 }
  2167.                                 else if(PlayersBowlingRoad[playerid]==4)
  2168.                                 {
  2169.                                         UpdateDynamic3DTextLabelText(BowlingRoadScreen[4], 0xFFFFFF,"{008800}[{FFFFFF} Road 5{008800} ]\n Empty");
  2170.                                         PlayersBowlingRoad[playerid] = ROAD_NONE;
  2171.                                         DestroyPins(4);
  2172.                                 }
  2173.                                
  2174.                         }
  2175.                         return 1;
  2176. }
  2177. forward BallGoingTimer(playerid);
  2178. public BallGoingTimer(playerid)
  2179. {
  2180.     MoveBall(playerid);
  2181.     BallRun[playerid] = SetTimerEx("BallRunTimer",BALL_RUN_TIME,false,"d",playerid);
  2182.         return 1;
  2183. }
  2184. forward BallRunTimer(playerid);
  2185. public BallRunTimer(playerid)
  2186. {
  2187.         if(BowlingStatus[playerid]==F_BOWLING_THROW)
  2188.     {
  2189.         PinsKnocked(playerid);
  2190.         BowlingStatus[playerid]=S_BOWLING_THROW;
  2191.         }
  2192.         else if(BowlingStatus[playerid]==S_BOWLING_THROW)
  2193.         {
  2194.             LastPinsKnocked(playerid);
  2195.             BowlingStatus[playerid]=N_BOWLING_THROW;
  2196.             BowlingPinsWaitTimer[playerid] = SetTimerEx("PinsWaitTimer",3000,false,"d",playerid);
  2197.         }
  2198.         DestroyDynamicObject(BowlingBall[PlayersBowlingRoad[playerid]]);
  2199.         return 1;
  2200. }
  2201.  
  2202. public OnPlayerEnterDynamicCP(playerid, checkpointid)
  2203. {
  2204.     if(checkpointid == BowlingCP1)
  2205.     {
  2206.         ShowPlayerDialog(playerid,DIALOG_BOWLING, DIALOG_STYLE_LIST, "Bowling", "{00AA00}1. {FFFFFF}Take a road \n{00AA00}2. {FFFFFF}End the game \n{00AA00}3. {FFFFFF}Add more time ", "Ok", "Exit");
  2207.     }
  2208.         return 1;
  2209. }
  2210.  
  2211. public OnPlayerLeaveDynamicCP(playerid)
  2212. {
  2213.         return 1;
  2214. }
  2215.  
  2216. public OnPlayerEnterDynamicRaceCP(playerid)
  2217. {
  2218.         return 1;
  2219. }
  2220.  
  2221. public OnPlayerLeaveDynamicRaceCP(playerid)
  2222. {
  2223.         return 1;
  2224. }
  2225.  
  2226. public OnDynamicObjectMoved(objectid)
  2227. {
  2228.         return 1;
  2229. }
  2230.  
  2231.  
  2232. public Audio_OnClientConnect(playerid)
  2233. {
  2234.     if(IsPlayerNPC(playerid)) return 1;
  2235.     printf("%s connected to Audio",PlayerName(playerid));
  2236.     Audio_TransferPack(playerid);
  2237.     return 1;
  2238. }
  2239.  
  2240. public Audio_OnClientDisconnect(playerid)
  2241. {
  2242.         if(IsPlayerNPC(playerid)) return 1;
  2243.         printf("%s disconnected form Audio",PlayerName(playerid));
  2244.     Audio_Stop(playerid, Music[playerid]);
  2245.     return 1;
  2246. }
  2247.  
  2248. public OnPlayerPickUpDynamicPickup(playerid, pickupid)
  2249. {
  2250.         if(pickupid == Pickup[bowlExit])
  2251.         {
  2252.             SetPlayerPos(playerid,-1994.5708,407.2563,35.1719);
  2253.             SetPlayerFacingAngle(playerid,91.0912);
  2254.             SetCameraBehindPlayer(playerid);
  2255.             SetPlayerInterior(playerid,0);
  2256.             Audio_Stop(playerid, Music[playerid]);
  2257.         }
  2258.         else if(pickupid == Pickup[bowlEnter])
  2259.         {
  2260.             SetPlayerPos(playerid,-1989.7111,407.6148,2.1010);
  2261.             SetPlayerFacingAngle(playerid,268.7060);
  2262.             SetCameraBehindPlayer(playerid);
  2263.             SetPlayerInterior(playerid,1);
  2264.             Music[playerid] = Audio_PlayStreamed(playerid, "http://radio.kazantip-fm.ru:8000/mp3",false,false,true);
  2265.                 Audio_SetVolume(playerid, Music[playerid], 100);
  2266.                 Audio_SetFX(playerid, Music[playerid], 3);
  2267.         }
  2268.         PickupBowlingHelp(playerid,pickupid);
  2269.         return 1;
  2270. }
  2271.  
  2272. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  2273. {
  2274.     if(dialogid == DIALOG_BOWLING_STATS)
  2275.         {
  2276.             if(response) return 1;
  2277.         }
  2278.     if(dialogid == DIALOG_BOWLING)
  2279.         {
  2280.             if(response)
  2281.             {
  2282.                 switch(listitem)
  2283.                 {
  2284.                     case 0:
  2285.                     {
  2286.                         if(AbleToPlay[playerid] == 1) return SendClientMessage(playerid,0xD92626AA,"You are already playing!");
  2287.                         ShowPlayerDialog(playerid,DIALOG_ROAD, DIALOG_STYLE_LIST, "Choose the road", "{00AA00}1. {FFFFFF}Road 1 \n{00AA00}2. {FFFFFF}Road 2 \n{00AA00}3. {FFFFFF}Road 3 \n{00AA00}4. {FFFFFF}Road 4 \n{00AA00}5. {FFFFFF}Road 5  ", "Ok", "Back");
  2288.                     }
  2289.                     case 1:
  2290.                     {
  2291.                         if(AbleToPlay[playerid] == 0) return SendClientMessage(playerid,0xD92626AA,"You didn't start the game!");
  2292.                         AbleToPlay[playerid] = 0;
  2293.                         BowlingRoadStatus[PlayersBowlingRoad[playerid]] = ROAD_EMPTY;
  2294.                         KillTimer(BowlingTimer[PlayersBowlingRoad[playerid]]);
  2295.                         BowlingMinutes[playerid] = 0;
  2296.                         BowlingSeconds[playerid] = 0;
  2297.                         SendClientMessage(playerid,0xD92626AA,"You ended the game!");
  2298.                         scmf(playerid,COLOR_CMDERROR,"{FFFFFF}You earned {00CC00}%i {FFFFFF}points and take {00CC00}${FFFFFF}%i.",PlayersBowlingScore[playerid],PlayersBowlingScore[playerid]*10);
  2299.                                         GivePlayerMoney(playerid,PlayersBowlingScore[playerid]*10);
  2300.                                         DestroyBall(playerid);
  2301.                                         if(PlayersBowlingScore[playerid] > BestScore[playerid])
  2302.                                         {
  2303.                                             scmf(playerid,0xD92626AA,"{00CC00}You beat your best score: {FFFFFF}%i!",BestScore[playerid]);
  2304.                                 scmf(playerid,0xFFFFFF,"{00CC00}New best score is: {FFFFFF}%i!",PlayersBowlingScore[playerid]);
  2305.                                                 dini_IntSet(PlayerBowlingFile(playerid),"BestScore",PlayersBowlingScore[playerid]);
  2306.                                                 BestScore[playerid] = PlayersBowlingScore[playerid];
  2307.                                         }
  2308.                                         else
  2309.                                         {
  2310.                                         scmf(playerid,0xD92626AA,"{00CC00}Your best score is: {FFFFFF}%i!",BestScore[playerid]);
  2311.                                         }
  2312.                     PlayersBowlingScore[playerid] = 0;
  2313.                         if(PlayersBowlingRoad[playerid]==0)
  2314.                         {
  2315.                                                 UpdateDynamic3DTextLabelText(BowlingRoadScreen[0], 0xFFFFFF,"{008800}[{FFFFFF} Road 1{008800} ]\n Empty");
  2316.                                                 PlayersBowlingRoad[playerid] = ROAD_NONE;
  2317.                                 DestroyPins(0);
  2318.                         }
  2319.                                         else if(PlayersBowlingRoad[playerid]==1)
  2320.                                         {
  2321.                                                 UpdateDynamic3DTextLabelText(BowlingRoadScreen[1], 0xFFFFFF,"{008800}[{FFFFFF} Road 2{008800} ]\n Empty");
  2322.                                                 PlayersBowlingRoad[playerid] = ROAD_NONE;
  2323.                                                 DestroyPins(1);
  2324.                                         }
  2325.                                         else if(PlayersBowlingRoad[playerid]==2)
  2326.                                         {
  2327.                                                 UpdateDynamic3DTextLabelText(BowlingRoadScreen[2], 0xFFFFFF,"{008800}[{FFFFFF} Road 3{008800} ]\n Empty");
  2328.                                                 PlayersBowlingRoad[playerid] = ROAD_NONE;
  2329.                                                 DestroyPins(2);
  2330.                     }
  2331.                                         else if(PlayersBowlingRoad[playerid]==3)
  2332.                     {
  2333.                                                 UpdateDynamic3DTextLabelText(BowlingRoadScreen[3], 0xFFFFFF,"{008800}[{FFFFFF} Road 4{008800} ]\n Empty");
  2334.                                                 PlayersBowlingRoad[playerid] = ROAD_NONE;
  2335.                                                 DestroyPins(3);
  2336.                     }
  2337.                                         else if(PlayersBowlingRoad[playerid]==4)
  2338.                                         {
  2339.                                                 UpdateDynamic3DTextLabelText(BowlingRoadScreen[4], 0xFFFFFF,"{008800}[{FFFFFF} Road 5{008800} ]\n Empty");
  2340.                                                 PlayersBowlingRoad[playerid] = ROAD_NONE;
  2341.                                                 DestroyPins(4);
  2342.                                         }
  2343.                        
  2344.                         return 1;
  2345.                     }
  2346.                     case 2:
  2347.                     {
  2348.                         if(AbleToPlay[playerid] == 0) return SendClientMessage(playerid,0xD92626AA,"You didn't start game yet!");
  2349.                     ShowPlayerDialog(playerid,DIALOG_ADD_TIME, DIALOG_STYLE_LIST, "Add time","{00AA00}+3 {FFFFFF}minutes {00AA00} 30$ \n{00AA00}+5 {FFFFFF}minutes {00AA00} 50$ \n{00AA00}+10 {FFFFFF}minutes{00AA00} 100$ \n{00AA00}+25 {FFFFFF}minutes{00AA00} 250$ \n{00AA00}+30 {FFFFFF}minutes{00AA00} 300$ ","Ok","Back");
  2350.                     }
  2351.                 }
  2352.             }
  2353.             return 1;
  2354.         }
  2355.         if(dialogid == DIALOG_ROAD)
  2356.         {
  2357.         if(response)
  2358.             {
  2359.                 switch(listitem)
  2360.                 {
  2361.                     case 0:
  2362.                     {
  2363.                         if(BowlingRoadStatus[0] == ROAD_EMPTY)
  2364.                         {
  2365.                                                 PlayersBowlingRoad[playerid] = 0;
  2366.                                                 ShowPlayerDialog(playerid,DIALOG_BOWLING_TIME, DIALOG_STYLE_LIST, "Time","{BBBB00}3 {FFFFFF}minutes {00AA00} 30$ \n{BBBB00}5 {FFFFFF}minutes {00AA00} 50$ \n{BBBB00}10 {FFFFFF}minutes{00AA00} 100$ \n{BBBB00}25 {FFFFFF}minutes{00AA00} 250$ \n{BBBB00}30 {FFFFFF}minutes{00AA00} 300$ ","Ok","Back");
  2367.                                         }
  2368.                                         else if(BowlingRoadStatus[0] == ROAD_BUSY) return SendClientMessage(playerid,COLOR_CMDERROR,"Road çàíÿòà.");
  2369.                                 }
  2370.                                 case 1:
  2371.                     {
  2372.                         if(BowlingRoadStatus[1] == ROAD_EMPTY)
  2373.                                         {
  2374.                                             PlayersBowlingRoad[playerid] = 1;
  2375.                                                 ShowPlayerDialog(playerid,DIALOG_BOWLING_TIME, DIALOG_STYLE_LIST, "Time","{BBBB00}3 {FFFFFF}minutes {00AA00} 30$ \n{BBBB00}5 {FFFFFF}minutes {00AA00} 50$ \n{BBBB00}10 {FFFFFF}minutes{00AA00} 100$ \n{BBBB00}25 {FFFFFF}minutes{00AA00} 250$ \n{BBBB00}30 {FFFFFF}minutes{00AA00} 300$ ","Ok","Back");
  2376.                                         }
  2377.                                         else if(BowlingRoadStatus[1] == ROAD_BUSY) return SendClientMessage(playerid,COLOR_CMDERROR,"Road çàíÿòà.");
  2378.                                 }
  2379.                                 case 2:
  2380.                     {
  2381.                         if(BowlingRoadStatus[2] == ROAD_EMPTY)
  2382.                         {
  2383.                                                 PlayersBowlingRoad[playerid] = 2;
  2384.                                                 ShowPlayerDialog(playerid,DIALOG_BOWLING_TIME, DIALOG_STYLE_LIST, "Time","{BBBB00}3 {FFFFFF}minutes {00AA00} 30$ \n{BBBB00}5 {FFFFFF}minutes {00AA00} 50$ \n{BBBB00}10 {FFFFFF}minutes{00AA00} 100$ \n{BBBB00}25 {FFFFFF}minutes{00AA00} 250$ \n{BBBB00}30 {FFFFFF}minutes{00AA00} 300$ ","Ok","Back");
  2385.                                         }
  2386.                                         else if(BowlingRoadStatus[2] == ROAD_BUSY) return SendClientMessage(playerid,COLOR_CMDERROR,"Road çàíÿòà.");
  2387.                                 }
  2388.                                 case 3:
  2389.                     {
  2390.                         if(BowlingRoadStatus[3] == ROAD_EMPTY)
  2391.                         {
  2392.                                                 PlayersBowlingRoad[playerid] = 3;
  2393.                                                 ShowPlayerDialog(playerid,DIALOG_BOWLING_TIME, DIALOG_STYLE_LIST, "Time","{BBBB00}3 {FFFFFF}minutes {00AA00} 30$ \n{BBBB00}5 {FFFFFF}minutes {00AA00} 50$ \n{BBBB00}10 {FFFFFF}minutes{00AA00} 100$ \n{BBBB00}25 {FFFFFF}minutes{00AA00} 250$ \n{BBBB00}30 {FFFFFF}minutes{00AA00} 300$ ","Ok","Back");
  2394.                                         }
  2395.                                         else if(BowlingRoadStatus[3] == ROAD_BUSY) return SendClientMessage(playerid,COLOR_CMDERROR,"Road çàíÿòà.");
  2396.                                 }
  2397.                                 case 4:
  2398.                     {
  2399.                         if(BowlingRoadStatus[4] == ROAD_EMPTY)
  2400.                         {
  2401.                                                 PlayersBowlingRoad[playerid] = 4;
  2402.                                                 ShowPlayerDialog(playerid,DIALOG_BOWLING_TIME, DIALOG_STYLE_LIST, "Time","{BBBB00}3 {FFFFFF}minutes {00AA00} 30$ \n{BBBB00}5 {FFFFFF}minutes {00AA00} 50$ \n{BBBB00}10 {FFFFFF}minutes{00AA00} 100$ \n{BBBB00}25 {FFFFFF}minutes{00AA00} 250$ \n{BBBB00}30 {FFFFFF}minutes{00AA00} 300$","Ok","Back");
  2403.                                         }
  2404.                                         else if(BowlingRoadStatus[4] == ROAD_BUSY) return SendClientMessage(playerid,COLOR_CMDERROR,"Road busy.");
  2405.                                 }
  2406.                         }
  2407.                 }
  2408.                 else if(!response)
  2409.                 {
  2410.                         PlayersBowlingRoad[playerid] = ROAD_NONE;
  2411.                         ShowPlayerDialog(playerid,DIALOG_BOWLING, DIALOG_STYLE_LIST, "Bowling", "{00AA00}1. {FFFFFF}Take a road \n{00AA00}2. {FFFFFF}End your game \n{00AA00}3. {FFFFFF}Add more time ", "Ok", "Exit");
  2412.                 }
  2413.         }
  2414.         if(dialogid == DIALOG_BOWLING_TIME)
  2415.         {
  2416.                 if(response)
  2417.             {
  2418.                 switch(listitem)
  2419.                 {
  2420.                         case 0:
  2421.                         {
  2422.                                         GameTextForPlayer(playerid,"~y~+3 ~w~minutes",3000,1);
  2423.                                         BowlingMinutes[playerid] = 2;
  2424.                                         GivePlayerMoney(playerid,-30);
  2425.                         }
  2426.                         case 1:
  2427.                         {
  2428.                             GameTextForPlayer(playerid,"~y~+5 ~w~minutes",3000,1);
  2429.                             BowlingMinutes[playerid] = 4;
  2430.                             GivePlayerMoney(playerid,-50);
  2431.                         }
  2432.                         case 2:
  2433.                         {
  2434.                             GameTextForPlayer(playerid,"~y~+10 ~w~minutes",3000,1);
  2435.                             BowlingMinutes[playerid] = 9;
  2436.                             GivePlayerMoney(playerid,-100);
  2437.                         }
  2438.                         case 3:
  2439.                         {
  2440.                             GameTextForPlayer(playerid,"~y~+25 ~w~minutes",3000,1);
  2441.                             BowlingMinutes[playerid] = 24;
  2442.                             GivePlayerMoney(playerid,-250);
  2443.                         }
  2444.                         case 4:
  2445.                         {
  2446.                             GameTextForPlayer(playerid,"~y~+30 ~w~minutes",3000,1);
  2447.                             BowlingMinutes[playerid] = 29;
  2448.                             GivePlayerMoney(playerid,-300);
  2449.                         }
  2450.                         }
  2451.                         new str[150];
  2452.                         BowlingSeconds[playerid]=59;
  2453.                         KillTimer(BowlingTimer[PlayersBowlingRoad[playerid]]);
  2454.                         BowlingTimer[PlayersBowlingRoad[playerid]] = SetTimerEx("BowlingCountDown",1000,true,"d",playerid);
  2455.                         CreatePins(playerid);
  2456.                         if(PlayersBowlingRoad[playerid]==0)
  2457.                         {
  2458.                             HelpBowlingRoadPickup[0] = CreateDynamicPickup(1239,3,-1975.0587,416.9655,2.5090);
  2459.                                 format(str,150,"{E32A2A}[{FFFFFF} Road 5{E32A2A} ]\n Busy \n {BBBB00}Player: {FFFFFF}%s\n {BBBB00} Time:{FFFFFF} %02d : %02d \n {BBBB00} Points:{FFFFFF} %i",PlayerName(playerid),BowlingMinutes[playerid],BowlingSeconds[playerid],PlayersBowlingScore[playerid]);
  2460.                                 UpdateDynamic3DTextLabelText(BowlingRoadScreen[0], 0xFFFFFF,str);
  2461.                         }
  2462.                         else if(PlayersBowlingRoad[playerid]==1)
  2463.                         {
  2464.                             HelpBowlingRoadPickup[1] = CreateDynamicPickup(1239,3,-1975.0587,415.4035,2.5090);
  2465.                                 format(str,150,"{E32A2A}[{FFFFFF} Road 5{E32A2A} ]\n Busy \n {BBBB00}Player: {FFFFFF}%s\n {BBBB00} Time:{FFFFFF} %02d : %02d \n {BBBB00} Points:{FFFFFF} %i",PlayerName(playerid),BowlingMinutes[playerid],BowlingSeconds[playerid],PlayersBowlingScore[playerid]);
  2466.                                 UpdateDynamic3DTextLabelText(BowlingRoadScreen[1], 0xFFFFFF,str);
  2467.                         }
  2468.                         else if(PlayersBowlingRoad[playerid]==2)
  2469.                         {
  2470.                             HelpBowlingRoadPickup[2] = CreateDynamicPickup(1239,3,-1975.0587,413.8728,2.5090);
  2471.                                 format(str,150,"{E32A2A}[{FFFFFF} Road 5{E32A2A} ]\n Busy \n {BBBB00}Player: {FFFFFF}%s\n {BBBB00} Time:{FFFFFF} %02d : %02d \n {BBBB00} Points:{FFFFFF} %i",PlayerName(playerid),BowlingMinutes[playerid],BowlingSeconds[playerid],PlayersBowlingScore[playerid]);
  2472.                                 UpdateDynamic3DTextLabelText(BowlingRoadScreen[2], 0xFFFFFF,str);
  2473.                         }
  2474.                         else if(PlayersBowlingRoad[playerid]==3)
  2475.                         {
  2476.                             HelpBowlingRoadPickup[3] = CreateDynamicPickup(1239,3,-1975.0587,412.2807,2.5090);
  2477.                                 format(str,150,"{E32A2A}[{FFFFFF} Road 5{E32A2A} ]\n Busy \n {BBBB00}Player: {FFFFFF}%s\n {BBBB00} Time:{FFFFFF} %02d : %02d \n {BBBB00} Points:{FFFFFF} %i",PlayerName(playerid),BowlingMinutes[playerid],BowlingSeconds[playerid],PlayersBowlingScore[playerid]);
  2478.                                 UpdateDynamic3DTextLabelText(BowlingRoadScreen[3], 0xFFFFFF,str);
  2479.                         }
  2480.                         else if(PlayersBowlingRoad[playerid]==4)
  2481.                         {
  2482.                             HelpBowlingRoadPickup[4] = CreateDynamicPickup(1239,3,-1975.0587,410.7207,2.5090);
  2483.                             format(str,150,"{E32A2A}[{FFFFFF} Road 5{E32A2A} ]\n Busy \n {BBBB00}Player: {FFFFFF}%s\n {BBBB00} Time:{FFFFFF} %02d : %02d \n {BBBB00} Points:{FFFFFF} %i",PlayerName(playerid),BowlingMinutes[playerid],BowlingSeconds[playerid],PlayersBowlingScore[playerid]);
  2484.                                 UpdateDynamic3DTextLabelText(BowlingRoadScreen[4], 0xFFFFFF,str);
  2485.                         }
  2486.                         BowlingRoadStatus[PlayersBowlingRoad[playerid]] = ROAD_BUSY;
  2487.                         AbleToPlay[playerid] = 1;
  2488.                         SendClientMessage(playerid,0xFFFFFF,"{00CC00}You started the game!");
  2489.                         scmf(playerid,0xFFFFFF,"{00CC00}Last time you played: {FFFFFF}%s.",LastTimePlayed[playerid]);
  2490.             scmf(playerid,0xFFFFFF,"{00CC00}Your best score is: {FFFFFF}%i.",BestScore[playerid]);
  2491.             new year,month,day; getdate(year, month, day);
  2492.                         new strdate[128];
  2493.                         format(strdate,128,"%02d.%02d.%02d", day, month, year);
  2494.             LastTimePlayed[playerid] = strdate;
  2495.                         dini_Set(PlayerBowlingFile(playerid),"LastTime",LastTimePlayed[playerid]);
  2496.                 }
  2497.         else if(!response)
  2498.         {
  2499.             ShowPlayerDialog(playerid,DIALOG_ROAD, DIALOG_STYLE_LIST, "Choose the road", "{00AA00}1. {FFFFFF}Road 1 \n{00AA00}2. {FFFFFF}Road 2 \n{00AA00}3. {FFFFFF}Road 3 \n{00AA00}4. {FFFFFF}Road 4 \n{00AA00}5. {FFFFFF}Road 5  ", "Ok", "Back");
  2500.                 }
  2501.         }
  2502.         if(dialogid == DIALOG_ADD_TIME)
  2503.         {
  2504.                 if(response)
  2505.             {
  2506.                 switch(listitem)
  2507.                 {
  2508.                         case 0:
  2509.                         {
  2510.                                         GameTextForPlayer(playerid,"~y~+3 ~w~minutes",3000,1);
  2511.                                         BowlingMinutes[playerid] += 3;
  2512.                                         GivePlayerMoney(playerid,-30);
  2513.                         }
  2514.                         case 1:
  2515.                         {
  2516.                             GameTextForPlayer(playerid,"~y~+5 ~w~minutes",3000,1);
  2517.                             BowlingMinutes[playerid] += 5;
  2518.                             GivePlayerMoney(playerid,-50);
  2519.                         }
  2520.                         case 2:
  2521.                         {
  2522.                             GameTextForPlayer(playerid,"~y~+10 ~w~minutes",3000,1);
  2523.                             BowlingMinutes[playerid] += 10;
  2524.                             GivePlayerMoney(playerid,-100);
  2525.                         }
  2526.                         case 3:
  2527.                         {
  2528.                             GameTextForPlayer(playerid,"~y~+25 ~w~minutes",3000,1);
  2529.                             BowlingMinutes[playerid] += 25;
  2530.                             GivePlayerMoney(playerid,-250);
  2531.                         }
  2532.                         case 4:
  2533.                         {
  2534.                             GameTextForPlayer(playerid,"~y~+30 ~w~minutes",3000,1);
  2535.                             BowlingMinutes[playerid] += 30;
  2536.                             GivePlayerMoney(playerid,-300);
  2537.                         }
  2538.                         }
  2539.                         new str[128];
  2540.                         KillTimer(BowlingTimer[PlayersBowlingRoad[playerid]]);
  2541.                         BowlingTimer[PlayersBowlingRoad[playerid]] = SetTimerEx("BowlingCountDown",1000,true,"d",playerid);
  2542.                         format(str,128,"{E32A2A}[{FFFFFF} Road 5{E32A2A} ]\n Busy \n {BBBB00}Player: {FFFFFF}%s\n {BBBB00} Time:{FFFFFF} %02d : %02d ",PlayerName(playerid),BowlingMinutes[playerid],BowlingSeconds[playerid]);
  2543.                         UpdateDynamic3DTextLabelText(BowlingRoadScreen[PlayersBowlingRoad[playerid]], 0xFFFFFF,str);
  2544.                 }
  2545.         else if(!response)
  2546.         {
  2547.             ShowPlayerDialog(playerid,DIALOG_BOWLING, DIALOG_STYLE_LIST, "Bowling {B0020B}({ffffff}$15{B0020B})", "{00AA00}1. {FFFFFF}Take a road \n {00AA00}2. {FFFFFF}End the game \n {00AA00}3. {FFFFFF}Add more time ", "Ok", "Exit");
  2548.         }
  2549.         }
  2550.         return 1;
  2551. }
  2552.  
  2553. forward GetClosestPlayer(p1);
  2554. public GetClosestPlayer(p1)
  2555. {
  2556.     new x,Float:dis,Float:dis2,player;
  2557.     player = -1;
  2558.     dis = 99999.99;
  2559.     for (x=0;x<MAX_PLAYERS;x++)
  2560.     {
  2561.         if(IsPlayerConnected(x))
  2562.         {
  2563.             if(x != p1)
  2564.             {
  2565.                 dis2 = GetDistanceBetweenPlayers(x,p1);
  2566.                 if(dis2 < dis && dis2 != -1.00)
  2567.                 {
  2568.                     dis = dis2;
  2569.                     player = x;
  2570.                 }
  2571.             }
  2572.         }
  2573.     }
  2574.     return player;
  2575. }
  2576.  
  2577. forward Float:GetDistanceBetweenPlayers(p1,p2);
  2578. public Float:GetDistanceBetweenPlayers(p1,p2)
  2579. {
  2580.     new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
  2581.     if(!IsPlayerConnected(p1) || !IsPlayerConnected(p2))
  2582.     {
  2583.         return -1.00;
  2584.     }
  2585.     GetPlayerPos(p1,x1,y1,z1);
  2586.     GetPlayerPos(p2,x2,y2,z2);
  2587.     return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
  2588. }
  2589.  
  2590. stock PlayerName(playerid)
  2591. {
  2592.     new name[64];
  2593.     GetPlayerName(playerid,name,64);
  2594.     return name;
  2595. }
  2596. stock PlayerBowlingFile(playerid)
  2597. {
  2598.         new file[84];
  2599.     format(file,sizeof(file),"Bowling/%s.bowling",PlayerName(playerid));
  2600.     return file;
  2601. }
  2602. //formated message
  2603. #define scm(%0,%1,%2) SendClientMessage(%0,%1,%2)
  2604. scmf(playerid,color,fstring[],{Float, _}:...) {
  2605.    new n=(numargs()-3)*4;
  2606.    if(n) {
  2607.       new message[255],arg_start,arg_end;
  2608.       #emit CONST.alt                fstring
  2609.       #emit LCTRL                    5
  2610.       #emit ADD
  2611.       #emit STOR.S.pri               arg_start
  2612.       #emit LOAD.S.alt               n
  2613.       #emit ADD
  2614.       #emit STOR.S.pri               arg_end
  2615.       do {
  2616.          #emit LOAD.I
  2617.          #emit PUSH.pri
  2618.          arg_end-=4;
  2619.          #emit LOAD.S.pri           arg_end
  2620.       }
  2621.       while(arg_end>arg_start);
  2622.       #emit PUSH.S                   fstring
  2623.       #emit PUSH.C                   255
  2624.       #emit PUSH.ADR                 message
  2625.       n+=4*3;
  2626.       #emit PUSH.S                   n
  2627.       #emit SYSREQ.C                 format
  2628.       n+=4;
  2629.       #emit LCTRL                    4
  2630.       #emit LOAD.S.alt               n
  2631.       #emit ADD
  2632.       #emit SCTRL                    4
  2633.       return scm(playerid,color,message);
  2634.    } else return scm(playerid,color,fstring);
  2635. }
clone this paste RAW Paste Data