Advertisement
Guest User

Football Filterscript, by Giuseppe_Mazzei

a guest
Jul 18th, 2010
8,742
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 46.50 KB | None | 0 0
  1. #include <a_samp>
  2. #include <core>
  3. #include <float>
  4. #include <time>
  5. #include <file>
  6. #include <utils>
  7. #include <morphinc>
  8. #include <dini>
  9.  
  10. #define FILTERSCRIPT
  11. #define COLOR_DARKBLUE 0x0000D0FF
  12. #define COLOR_WHITE 0xFFFFFFFF
  13. #define COLOR_LIGHTBLUE 0xBBFFFFFF
  14. #define COLOR_BLACK 0x000000FF
  15. #define COLOR_PURPLE 0xC2A2DAAA
  16. #define COLOR_GROVE 0x00FF00FF
  17.  
  18. forward KeyChanges();
  19. forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
  20. forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
  21. forward SafeGivePlayerMoney(plyid, amounttogive);
  22. forward CustomPickups();
  23. forward MetalDetector(playerid);
  24. forward AntiInvasione();
  25.  
  26. new giocatore[MAX_PLAYERS];
  27. new arbitro[MAX_PLAYERS];
  28. new stuart[MAX_PLAYERS];
  29. new fumogeno[MAX_PLAYERS];
  30. new biglietto[MAX_PLAYERS];
  31. new spettatore[MAX_PLAYERS];
  32. new allenamento[MAX_PLAYERS];
  33. new squadra1[60] = "Team1";
  34. new squadra2[60] = "Team2";
  35. new goal1 = 0;
  36. new goal2 = 0;
  37. new annunciata = 0;
  38. new skin[MAX_PLAYERS];
  39.  
  40. new palla;
  41. new object1;
  42. new object2;
  43. new object3;
  44. new object4;
  45. new object5;
  46. new object6;
  47. new object7;
  48. new object8;
  49. new object9;
  50. new object10;
  51. new object11;
  52. new object12;
  53. new object13;
  54. new object14;
  55. new object15;
  56. new object16;
  57. new object17;
  58. new object18;
  59. new object19;
  60. new object20;
  61. new object21;
  62. new object22;
  63. new object23;
  64. new object24;
  65. new object25;
  66. new object26;
  67. new object27;
  68. new object28;
  69. new object29;
  70. new object30;
  71. new object31;
  72. new object32;
  73. new object33;
  74. new object34;
  75. new object35;
  76. new object36;
  77. new object37;
  78. new object38;
  79. new object39;
  80. new object40;
  81. new object41;
  82. new object42;
  83. new object43;
  84. new object44;
  85. new object45;
  86. new object46;
  87. new object47;
  88. new object48;
  89. new object49;
  90. new object50;
  91. new object51;
  92. new object52;
  93. new object53;
  94.  
  95. #if defined FILTERSCRIPT
  96. main()
  97. {
  98.  
  99. }
  100. public OnPlayerConnect(playerid)
  101. {
  102. giocatore[playerid] = 0;
  103. arbitro[playerid] = 0;
  104. stuart[playerid] = 0;
  105. fumogeno[playerid] = 0;
  106. biglietto[playerid] = 0;
  107. spettatore[playerid]= 0;
  108. skin[playerid] = 0;
  109. allenamento[playerid] = 0;
  110. SetTimerEx("KeyChanges", 100, 1, "i", playerid);
  111. SetTimer("AntiInvasione", 1000, 1);
  112. SendClientMessage(playerid, COLOR_DARKBLUE, "This server uses Football Filterscript created by Giuseppe Mazzei");
  113. //do NOT remove credits, if you want you can add:
  114. //SendClientMessage(playerid, COLOR_DBLUE, "Modified by [your name]");
  115.  
  116. }
  117. public OnFilterScriptInit()
  118.  
  119. {
  120. print("|_________Football Filterscript__________|");
  121. print("|______Created By Giuseppe_Mazzei________|");
  122. print("|_______________Loaded___________________|");
  123.  
  124. object1 = CreateObject(3452, -151.817719, -32.392899, 7.841612, 0.0000, 0.0000, 67.5000);
  125. object2 = CreateObject(3452, -140.492004, -5.026214, 7.841612, 0.0000, 0.0000, 67.5000);
  126. object3 = CreateObject(3452, -218.382690, -6.787929, 7.841612, 0.0000, 0.0000, 247.5000);
  127. object4 = CreateObject(3452, -207.174911, 20.435522, 7.841612, 0.0000, 0.0000, 247.5000);
  128. object5 = CreateObject(3452, -161.063416, 40.956612, 7.841612, 0.0000, 0.0000, 157.5000);
  129. object6 = CreateObject(3452, -197.899384, -52.907509, 7.841612, 0.0000, 0.0000, 337.5000);
  130. object7 = CreateObject(3453, -135.337158, 24.373688, 7.841611, 0.0000, 0.0000, 67.5000);
  131. object8 = CreateObject(3453, -190.542664, 46.279572, 7.841611, 0.0000, 0.0000, 157.5000);
  132. object9 = CreateObject(3453, -223.720779, -36.300037, 7.841611, 0.0000, 0.0000, 247.5000);
  133. object10 = CreateObject(3453, -168.429810, -58.201828, 7.841611, 0.0000, 0.0000, 337.5000);
  134. object11 = CreateObject(10954, -182.091522, -11.985844, 18.400000, 0.0000, 0.0000, 247.5000);
  135. object12 = CreateObject(6063, -182.162048, -109.804596, 9.006953, 0.0000, 0.0000, 258.7500);
  136. object13 = CreateObject(3660, -187.470535, -159.805954, 5.099154, 0.0000, 0.0000, 348.7500);
  137. object14 = CreateObject(7306, -153.592636, 47.829258, 16.330467, 0.0000, 0.0000, 22.5000);
  138. object15 = CreateObject(7307, -203.894562, -60.224949, 16.427698, 0.0000, 0.0000, 112.5001);
  139. object16 = CreateObject(4639, -222.447067, -84.841454, 3.813767, 0.0000, 0.0000, 337.5000);
  140. object17 = CreateObject(17037, -166.016022, 26.244095, 4.608662, 0.0000, 0.0000, 67.5000);
  141. object18 = CreateObject(17037, -194.827393, -40.763809, 4.608662, 0.0000, 0.0000, 247.5000);
  142. object19 = CreateObject(3819, -208.973663, -14.270916, 3.114948, 0.0000, 0.0000, 157.5000);
  143. object20 = CreateObject(3819, -197.349945, 14.621197, 3.114946, 0.0000, 0.0000, 157.5000);
  144. object21 = CreateObject(14485, -155.380585, -141.228271, -0.558419, 0.0000, 0.0000, 90.0000);
  145. object22 = CreateObject(14387, -186.612839, -126.812271, 3.101299, 0.0000, 0.0000, 90.0000);
  146. object23 = CreateObject(1508, -184.073410, -115.547798, 3.779578, 0.0000, 0.0000, 0.0000);
  147. object24 = CreateObject(1508, -183.999069, -136.225800, 5.740783, 0.0000, 0.0000, 270.0000);
  148. object25 = CreateObject(8332, -197.508453, -122.987892, 6.405175, 0.0000, 0.0000, 90.0000);
  149. object26 = CreateObject(7592, -198.493240, 4.074304, 2.670010, 0.0000, 0.0000, 337.5000);
  150. object27 = CreateObject(7592, -159.629807, -13.374039, 2.677804, 0.0000, 0.0000, 337.5000);
  151. object28 = CreateObject(7592, -166.538422, 24.221302, 2.677805, 0.0000, 0.0000, 247.5000);
  152. object29 = CreateObject(7592, -186.473572, -42.112274, 2.677804, 0.0000, 0.0000, 247.5000);
  153. object30 = CreateObject(10397, -179.837433, -6.690983, 6.042799, 0.0000, 0.0000, 247.5000);
  154. object31 = CreateObject(3114, -224.517517, -11.732142, 14.000000, 0.0000, 0.0000, 247.5000);
  155. object32 = CreateObject(3114, -216.446411, 7.763443, 14.000000, 0.0000, 0.0000, 247.5000);
  156. object33 = CreateObject(3114, -208.367935, 27.250381, 14.000000, 0.0000, 0.0000, 247.5000);
  157. object34 = CreateObject(7614, -241.212860, 48.856384, 3.690308, 0.0000, 0.0000, 337.5000);
  158. object35 = CreateObject(8040, -244.767609, 24.944824, 2.243017, 0.0000, 0.0000, 247.5000);
  159. object36 = CreateObject(978, -264.232971, -9.865314, 2.317612, 0.0000, 0.0000, 157.5000);
  160. object37 = CreateObject(8042, -259.987183, -11.032295, 7.352411, 0.0000, 0.0000, 258.7501);
  161. object38 = CreateObject(979, -263.734314, -6.865885, 2.317614, 0.0000, 0.0000, 337.5000);
  162. object39 = CreateObject(986, -188.261139, 41.596863, 6.872591, 0.0000, 0.0000, 303.7500);
  163. object40 = CreateObject(986, -191.223618, 45.965206, 8.614551, 0.0000, 0.0000, 303.7500);
  164. object41 = CreateObject(986, -194.798935, 51.257202, 10.341534, 0.0000, 0.0000, 303.7500);
  165. object42 = CreateObject(986, -139.869202, 22.509758, 6.872591, 0.0000, 0.0000, 202.5000);
  166. object43 = CreateObject(986, -134.512268, 24.695408, 8.606966, 0.0000, 0.0000, 202.5000);
  167. object44 = CreateObject(986, -129.533249, 26.873953, 10.341534, 0.0000, 0.0000, 202.5000);
  168. object45 = CreateObject(986, -219.514694, -33.217968, 6.872591, 0.0000, 0.0000, 22.5000);
  169. object46 = CreateObject(986, -223.991638, -35.054913, 8.614550, 0.0000, 0.0000, 22.5000);
  170. object47 = CreateObject(986, -230.190796, -37.662083, 9.911654, 0.0000, 0.0000, 22.5000);
  171. object48 = CreateObject(986, -171.166641, -53.654182, 6.872591, 0.0000, 0.0000, 101.2500);
  172. object49 = CreateObject(986, -169.950790, -59.846634, 8.614550, 0.0000, 0.0000, 101.2500);
  173. object50 = CreateObject(986, -168.824356, -65.592049, 10.349154, 0.0000, 0.0000, 101.2500);
  174. object51 = CreateObject(7613, -201.964142, -88.057030, 3.516296, 0.0000, 0.0000, 247.5000);
  175. object52 = CreateObject(10955, -181.623108, -11.519028, 15.778145, 0.0000, 0.0000, 247.5000);
  176. object53 = CreateObject(7306, -138.546173, -23.999727, 16.275385, 0.0000, 0.0000, 292.5000);
  177. palla = CreateObject(1598, -180.464828, -7.425705, 2.414398, 0.0000, 0.0000, 0.0000);
  178. AddStaticPickup(1239, 2, -222.5425,-86.7066,3.1172);//biglietteria
  179. AddStaticPickup(1239, 2, -202.9730,-66.6648,3.3062);//ingresso stadio
  180. AddStaticPickup(1239, 2, -195.1585,-100.0893,3.1163);//ingresso sala stampa
  181. AddStaticPickup(1239, 2, -184.8640,-114.0260,3.1213);//uscita sala stampa
  182. AddStaticPickup(1239, 2, -182.5193,-135.1851,5.0900);//ingresso spogliatoio
  183. AddStaticPickup(1239, 2, -210.6958,-3.7785,3.1094);//campo
  184. SetTimer("CustomPickups", 1000, 1);
  185.  
  186. return 1;
  187. }
  188.  
  189. public OnFilterScriptExit()
  190. {
  191. DestroyObject(palla);
  192. DestroyObject(object1);
  193. DestroyObject(object2);
  194. DestroyObject(object3);
  195. DestroyObject(object4);
  196. DestroyObject(object5);
  197. DestroyObject(object6);
  198. DestroyObject(object7);
  199. DestroyObject(object8);
  200. DestroyObject(object9);
  201. DestroyObject(object10);
  202. DestroyObject(object11);
  203. DestroyObject(object12);
  204. DestroyObject(object13);
  205. DestroyObject(object14);
  206. DestroyObject(object15);
  207. DestroyObject(object16);
  208. DestroyObject(object17);
  209. DestroyObject(object18);
  210. DestroyObject(object19);
  211. DestroyObject(object20);
  212. DestroyObject(object21);
  213. DestroyObject(object22);
  214. DestroyObject(object23);
  215. DestroyObject(object24);
  216. DestroyObject(object25);
  217. DestroyObject(object26);
  218. DestroyObject(object27);
  219. DestroyObject(object28);
  220. DestroyObject(object29);
  221. DestroyObject(object30);
  222. DestroyObject(object31);
  223. DestroyObject(object32);
  224. DestroyObject(object33);
  225. DestroyObject(object34);
  226. DestroyObject(object35);
  227. DestroyObject(object36);
  228. DestroyObject(object37);
  229. DestroyObject(object38);
  230. DestroyObject(object39);
  231. DestroyObject(object40);
  232. DestroyObject(object41);
  233. DestroyObject(object42);
  234. DestroyObject(object43);
  235. DestroyObject(object44);
  236. DestroyObject(object45);
  237. DestroyObject(object46);
  238. DestroyObject(object47);
  239. DestroyObject(object48);
  240. DestroyObject(object49);
  241. DestroyObject(object50);
  242. DestroyObject(object51);
  243. DestroyObject(object52);
  244. DestroyObject(object53);
  245. }
  246.  
  247. #else
  248.  
  249. main()
  250. {
  251.         print(" Football Stadium [FS] LOADED");
  252. }
  253.  
  254. #endif
  255.  
  256. strtok(const string[], &index)
  257. {
  258.         new length = strlen(string);
  259.         while ((index < length) && (string[index] <= ' '))
  260.         {
  261.                 index++;
  262.         }
  263.  
  264.         new offset = index;
  265.         new result[20];
  266.         while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  267.         {
  268.                 result[index - offset] = string[index];
  269.                 index++;
  270.         }
  271.         result[index - offset] = EOS;
  272.         return result;
  273. }
  274.  
  275. GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
  276. {
  277.         new Float:a;
  278.         GetPlayerPos(playerid, x, y, a);
  279.         GetPlayerFacingAngle(playerid, a);
  280.         if (GetPlayerVehicleID(playerid))
  281.         {
  282.             GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
  283.         }
  284.         x += (distance * floatsin(-a, degrees));
  285.         y += (distance * floatcos(-a, degrees));
  286. }
  287. public CustomPickups()
  288. {
  289.         new Float:oldposx, Float:oldposy, Float:oldposz;
  290.        
  291.         for(new i = 0; i < MAX_PLAYERS; i++)
  292.         {
  293.                 if(IsPlayerConnected(i))
  294.                 {
  295.                         GetPlayerPos(i, oldposx, oldposy, oldposz);
  296.                         if (PlayerToPoint(1.7, i, -222.5425,-86.7066,3.1172))
  297.                         {//biglietteria
  298.                          GameTextForPlayer(i, "~g~Tikets,~n~~y~press the key to ~r~RUN~y~~n~~w~to buy somthing", 5000, 3);
  299.                         }
  300.                         else if (PlayerToPoint(1.7, i, -202.9730,-66.6648,3.3062))
  301.                         {//entrata allo stadio
  302.                          GameTextForPlayer(i, "~g~Entrance~n~~y~press the key to ~r~RUN~y~~n~~w~to enter", 5000, 3);
  303.                         }
  304.                         else if(PlayerToPoint(1.7, i, -195.1585,-100.0893,3.1163))
  305.                         {//ingresso sala stampa
  306.                         SetPlayerPos(i, -186.7655,-116.7739,3.1213);
  307.                         GameTextForPlayer(i, "~g~Newsroom", 5000, 1);
  308.                         }
  309.                         else if(PlayerToPoint(1.7, i, -184.8640,-114.0260,3.1213))
  310.                         {//uscita sala stampa
  311.                         SetPlayerPos(i, -199.5605,-99.5375,3.1163);
  312.                         GameTextForPlayer(i, "~r~Exit", 5000, 1);
  313.                         }
  314.                         else if(PlayerToPoint(1.7, i, -210.6958,-3.7785,3.1094))
  315.                         {//uscita dal campo
  316.                         GameTextForPlayer(i, "~g~Exit~n~~y~press the key to ~r~RUN~y~~n~~w~to go out", 5000, 3);
  317.                         }
  318.                         else if(PlayerToPoint(1.7, i, -182.5193,-135.1851,5.0900))
  319.                         {//ingresso in campo
  320.                         if(annunciata == 1)
  321.                         {
  322.                         if(arbitro[i] == 1 || giocatore [i] >= 1 || stuart[i] == 1)
  323.                         {
  324.                         GameTextForPlayer(i, "~g~Entrance~n~~y~press the key to ~r~RUN~y~~n~~w~to enter", 5000, 3);
  325.                         }
  326.                         else
  327.                         {
  328.                         GameTextForPlayer(i, "~r~You can not enter", 5000, 1);
  329.                         }
  330.                         }
  331.                         else//annunciata == 0
  332.                         {
  333.                         if(arbitro[i] == 1)
  334.                         {
  335.                         GameTextForPlayer(i, "~g~Entrance~n~~y~press the key to ~r~RUN~y~~n~~w~to enter", 5000, 3);
  336.                         }
  337.                         else
  338.                         {
  339.                         GameTextForPlayer(i, "~g~Entrance~n~~y~press the key to ~r~RUN~y~~n~~w~to start training", 5000, 3);
  340.                         }
  341.                         }
  342.                         }
  343.                         }
  344.                        
  345.                        
  346.                 }
  347.         }
  348. public KeyChanges()
  349. {
  350.     new keys, updown, leftright;
  351.     new string[256];
  352.     for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
  353.     {
  354.         if(IsPlayerConnected(playerid))
  355.         {
  356.         GetPlayerKeys(playerid, keys, updown, leftright);
  357.  
  358.         new Float:ox, Float:oy, Float:oz;
  359.         GetObjectPos(palla, ox, oy, oz);
  360.  
  361.         new Float:px, Float:py, Float:pz;
  362.  
  363.         new Float:angle;
  364.         GetPlayerFacingAngle(playerid, angle);
  365.        
  366.         if(keys == KEY_FIRE && giocatore[playerid] >= 1 || keys == KEY_FIRE && allenamento[playerid] >= 1)
  367.                             {
  368.                                 if(PlayerToPoint(2.5,playerid,ox,oy,oz))
  369.                                 {
  370.                                 GetPlayerPos(playerid, px, py, pz);
  371.                                 GetXYInFrontOfPlayer(playerid, px, py, 10.0);
  372.                                 MoveObject(palla,px,py,2.414398,8.0);
  373.                                 PlayerPlaySound(playerid,1130,0.0,0.0,0.0);
  374.                                 ApplyAnimation(playerid,"FIGHT_D","FightD_1",4.1,0,1,1,0,0);
  375.                                 }
  376.                                 }
  377.     else if(keys == KEY_FIRE + KEY_SPRINT && giocatore[playerid] >= 1 || keys == KEY_FIRE + KEY_SPRINT && allenamento[playerid] >= 1)
  378.                             {
  379.                             if(PlayerToPoint(2.5,playerid,ox,oy,oz))
  380.                                 {
  381.                                 GetPlayerPos(playerid, px, py, pz);
  382.                                 GetXYInFrontOfPlayer(playerid, px, py, 10.0);
  383.                                 MoveObject(palla,px,py,2.414398,10.0);
  384.                                 PlayerPlaySound(playerid,1130,0.0,0.0,0.0);
  385.                                 ApplyAnimation(playerid,"FIGHT_D","FightD_1",4.1,0,1,1,0,0);
  386.                         }
  387.                         }
  388.         else if(keys == KEY_SPRINT && PlayerToPoint(1.7, playerid, -222.5425,-86.7066,3.1172))
  389.                         {
  390.                         if(annunciata == 1)
  391.                         {
  392.                         ShowPlayerDialog(playerid, 13, DIALOG_STYLE_LIST, "Tickets - Choose what you want to buy", "Ticket\nSmoker $30", "Seleziona", "Cancella");
  393.                         }
  394.                         else
  395.                         {
  396.                 GameTextForPlayer(playerid, "~r~Closed", 5000, 1);
  397.                 PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
  398.                 return 1;
  399.                 }
  400.                 }
  401.                
  402.         else if(keys == KEY_SPRINT && PlayerToPoint(1.7, playerid, -182.5193,-135.1851,5.0900))
  403.                         {//ingresso in campo
  404.                         if(annunciata == 1)
  405.                         {
  406.                         if(arbitro[playerid] == 1 || giocatore [playerid] >= 1 || stuart[playerid] == 1)
  407.                         {
  408.                         SetPlayerPos(playerid, -210.6958,-3.7785,3.1094);
  409.                         }
  410.                         }
  411.                         else//annunciata == 0
  412.                         {
  413.                         if(arbitro[playerid] == 1)
  414.                         {
  415.                         SetPlayerPos(playerid, -204.9500,-5.2410,3.1094);
  416.                         }
  417.                         else
  418.                         {
  419.                         SetPlayerPos(playerid, -204.9500,-5.2410,3.1094);
  420.                         allenamento[playerid] = 1;
  421.                         }
  422.                         }
  423.                         }//sono
  424.                        
  425.         else if(keys == KEY_SPRINT && PlayerToPoint(1.7, playerid, -210.6958,-3.7785,3.1094))
  426.         {
  427.         if(spettatore[playerid] != 1)
  428.         {
  429.         if(allenamento[playerid] == 1)
  430.         {
  431.         SetPlayerPos(playerid, -183.8667,-131.6020,5.0900);
  432.         SendClientMessage(playerid, COLOR_WHITE, "Finish training");
  433.         allenamento[playerid] = 0;
  434.         }
  435.         else
  436.         {
  437.         SetPlayerPos(playerid, -183.8667,-131.6020,5.0900);
  438.         }
  439.         }
  440.         }
  441.                
  442.     else if(keys == KEY_SPRINT && PlayerToPoint(1.7, playerid, -202.9730,-66.6648,3.3062))
  443.                         {
  444.                         if(biglietto[playerid] == 1)
  445.                         {
  446.                         SetPlayerPos(playerid, -211.9384,3.9319,7.9039);
  447.                         SendClientMessage(playerid, COLOR_WHITE, "Go down from ladders to exit from the stadium");
  448.                         GameTextForPlayer(playerid, "~g~Welcome", 5000, 1);
  449.                         biglietto[playerid] = 0;
  450.                         spettatore[playerid] = 1;
  451.                         MetalDetector(playerid);
  452.                         }
  453.                         else if(biglietto[playerid] == 2)
  454.                         {
  455.                 SetPlayerPos(playerid, -147.5607,-19.1419,8.0165);
  456.                         SendClientMessage(playerid, COLOR_WHITE, "Go down from ladders to exit from the stadium");
  457.                         GameTextForPlayer(playerid, "~g~Welcome", 5000, 1);
  458.                         biglietto[playerid] = 0;
  459.                         spettatore[playerid] = 1;
  460.                         MetalDetector(playerid);                }
  461.                 else if(biglietto[playerid] == 3)
  462.                         {
  463.                 SetPlayerPos(playerid, -200.3670,-55.6259,9.6309);
  464.                         SendClientMessage(playerid, COLOR_WHITE, "Go down from ladders to exit from the stadium");
  465.                         GameTextForPlayer(playerid, "~g~Welcome", 5000, 1);
  466.                         biglietto[playerid] = 0;
  467.                         spettatore[playerid] = 1;
  468.                         MetalDetector(playerid);                }
  469.                 else if(biglietto[playerid] == 4)
  470.                         {
  471.                 SetPlayerPos(playerid, -160.0574,40.9410,8.3338);
  472.                         SendClientMessage(playerid, COLOR_WHITE, "Go down from ladders to exit from the stadium");
  473.                         GameTextForPlayer(playerid, "~g~Welcome", 5000, 1);
  474.                         biglietto[playerid] = 0;
  475.                         spettatore[playerid] = 1;
  476.                         MetalDetector(playerid);
  477.                 }
  478.                 else if(biglietto[playerid] == 0 && stuart[playerid]== 1)
  479.                 {
  480.                 format(string, sizeof(string), "grandstand\ndiscovery platform\ncurve fans %s\ncurve fans %s", squadra1, squadra2);
  481.                 ShowPlayerDialog(playerid, 15, DIALOG_STYLE_LIST, "Stuart Entrance - Choose where to go", string, "Select", "Delete");
  482.                 }
  483.                 else
  484.                 {
  485.                 SendClientMessage(playerid, COLOR_WHITE, "You don't have a ticket!");
  486.                 return 1;
  487.                 }
  488.                 }
  489.                 }
  490.         }return 1;
  491. }
  492.  
  493. public MetalDetector(playerid)
  494. {
  495. new ammo,weap;
  496. GetPlayerWeaponData(playerid, 8,weap,ammo);
  497. if (weap == 17 && ammo >= 1)
  498. {
  499. ResetPlayerWeapons(playerid);
  500. GivePlayerWeapon(playerid, 17, 1);
  501. }
  502. else
  503. {
  504. ResetPlayerWeapons(playerid);
  505. }
  506. }
  507.  
  508. public AntiInvasione()
  509. {
  510. for(new i = 0; i < MAX_PLAYERS; i++)
  511. {
  512. if(spettatore[i] == 1)
  513. {
  514. new Float:X, Float:Y, Float:Z;
  515. GetPlayerPos(i, X, Y, Z);
  516. if(Z < 4 || Z > 12)
  517. {
  518. SetPlayerPos(i, -202.9730,-66.6648,3.3062);
  519. spettatore[i] = 0;
  520. GameTextForPlayer(i, "~r~Exit", 5000, 1);
  521. }
  522. }
  523. }
  524. }
  525.  
  526.  
  527. public SafeGivePlayerMoney(plyid, amounttogive)
  528. {
  529.         new curHour, curMinute, curSecond;
  530.         gettime(curHour, curMinute, curSecond);
  531.         if (amounttogive < 0)
  532.         {
  533.                 GivePlayerMoney(plyid, amounttogive);
  534.         }
  535.         else
  536.         {
  537.                 GivePlayerMoney(plyid, amounttogive);
  538.         }
  539.         return 1;
  540. }
  541.  
  542. public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
  543. {
  544.         if(IsPlayerConnected(playerid))
  545.         {
  546.                 new Float:posx, Float:posy, Float:posz;
  547.                 new Float:oldposx, Float:oldposy, Float:oldposz;
  548.                 new Float:tempposx, Float:tempposy, Float:tempposz;
  549.                 GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  550.                 //radi = 2.0; //Trigger Radius
  551.                 for(new i = 0; i < MAX_PLAYERS; i++)
  552.                 {
  553.                         if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
  554.                         {
  555.                                         GetPlayerPos(i, posx, posy, posz);
  556.                                         tempposx = (oldposx -posx);
  557.                                         tempposy = (oldposy -posy);
  558.                                         tempposz = (oldposz -posz);
  559.                                         //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
  560.                                         if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
  561.                                         {
  562.                                                 SendClientMessage(i, col1, string);
  563.                                         }
  564.                                         else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
  565.                                         {
  566.                                                 SendClientMessage(i, col2, string);
  567.                                         }
  568.                                         else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
  569.                                         {
  570.                                                 SendClientMessage(i, col3, string);
  571.                                         }
  572.                                         else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
  573.                                         {
  574.                                                 SendClientMessage(i, col4, string);
  575.                                         }
  576.                                         else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  577.                                         {
  578.                                                 SendClientMessage(i, col5, string);
  579.                                         }
  580.                         }
  581.                 }
  582.         }//not connected
  583.         return 1;
  584. }
  585.  
  586. public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
  587. {
  588.     if(IsPlayerConnected(playerid))
  589.         {
  590.                 new Float:oldposx, Float:oldposy, Float:oldposz;
  591.                 new Float:tempposx, Float:tempposy, Float:tempposz;
  592.                 GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  593.                 tempposx = (oldposx -x);
  594.                 tempposy = (oldposy -y);
  595.                 tempposz = (oldposz -z);
  596.                 //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
  597.                 if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  598.                 {
  599.                         return 1;
  600.                 }
  601.         }
  602.         return 0;
  603. }
  604.  
  605. public OnPlayerCommandText(playerid, cmdtext[])
  606. {
  607.     new string[256];
  608.         new sendername[MAX_PLAYER_NAME];
  609.         new giveplayer[MAX_PLAYER_NAME];
  610.         new cmd[256];
  611.         new tmp[256];
  612.         new idx;
  613.         cmd = strtok(cmdtext, idx);
  614.         if(strcmp(cmd, "/referee", true) == 0)
  615.         {
  616.             if(IsPlayerConnected(playerid))
  617.             {
  618.                 if(!IsPlayerAdmin(playerid))
  619.                 {
  620.                 SendClientMessage(playerid, COLOR_WHITE, "You are not logged into RCON");
  621.                 return 1;
  622.                 }
  623.                         tmp = strtok(cmdtext, idx);
  624.                         if(!strlen(tmp))
  625.                         {
  626.                                 SendClientMessage(playerid, COLOR_WHITE, "USAGE: /referee [playerid/PartOfName]");
  627.                                 return 1;
  628.                         }
  629.                         new para1;
  630.                         para1 = ReturnUser(tmp);
  631.                         tmp = strtok(cmdtext, idx);
  632.             if(IsPlayerConnected(para1))
  633.                             {
  634.                                 if(para1 != INVALID_PLAYER_ID)
  635.                                 {
  636.                                                 GetPlayerName(para1, giveplayer, sizeof(giveplayer));
  637.                                                 GetPlayerName(playerid, sendername, sizeof(sendername));
  638.                                                 arbitro[para1] = 1;
  639.                                                 printf("%s chooses %s as referee.", sendername, giveplayer);
  640.                                                 format(string, sizeof(string), "   %s chooses you as referee", sendername);
  641.                                                 SendClientMessage(para1, COLOR_WHITE, string);
  642.                                                 format(string, sizeof(string), "   You choose %s as referee.", giveplayer);
  643.                                                 SendClientMessage(playerid, COLOR_WHITE, string);
  644.                                                 format(string, sizeof(string), " %s is the referee for the next match! Go to the stadium!", giveplayer);
  645.                                                 SendClientMessageToAll(COLOR_GROVE, string);
  646.                                                 skin[para1] = GetPlayerSkin(para1);
  647.                                                 SetPlayerSkin(para1, 72);
  648.                                         }
  649.                                 }
  650.                 }
  651.                 return 1;
  652.         }
  653.  
  654.         if(strcmp(cmd, "/rcmds", true) == 0)
  655.     {
  656.         if(IsPlayerConnected(playerid))
  657.         {
  658.         if(arbitro[playerid] == 1)
  659.         {
  660.         format(string, sizeof(string), "%s\n%s\nAnnounce\nStuart\nStart Match\nBall at centre\nBall here\nFire\nGoal\nStop Game\nEnd Match\nCoin", squadra1, squadra2);
  661.         ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Referee Commands", string, "Select", "Exit");
  662.         }
  663.         }return 1;
  664.         }
  665.         return 0;
  666. }
  667.  
  668. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  669. {
  670.         new sendername[MAX_PLAYER_NAME];
  671.         new giveplayer[MAX_PLAYER_NAME];
  672.         GetPlayerName(playerid, sendername, sizeof(sendername));
  673.         new string[128];
  674.         if(response)
  675.         {
  676.         if(dialogid == 1)
  677.         {
  678.                 if(listitem == 0)
  679.                 {
  680.                 format(string, sizeof(string), " Referee commands - %s", squadra1);
  681.                 ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, string, "Change team name\nAdd player", "Select", "Exit");
  682.                 }
  683.                 if(listitem == 1)
  684.                 {
  685.                 format(string, sizeof(string), " Referee commands - %s", squadra2);
  686.                 ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, string, "Change team name\nAdd player", "Select", "Exit");
  687.                 }
  688.                 if(listitem == 2)
  689.                 {
  690.                 if(annunciata == 1)
  691.                 {
  692.                 SendClientMessage(playerid, COLOR_WHITE, "You announced the start of the match! Now type 'Start match'");
  693.                 return 1;
  694.                 }
  695.                 else
  696.                 {
  697.                 format(string, sizeof(string), " Football match between %s and %s will start in 20 minutes! Referee: %s", squadra1, squadra2, sendername);
  698.                 SendClientMessageToAll(COLOR_GROVE, string);
  699.                 annunciata = 1;
  700.                 for(new i = 0; i < MAX_PLAYERS; i++)
  701.                 {
  702.                 if(allenamento[i] == 1)
  703.                 {
  704.                 SetPlayerPos(i, -182.5193,-135.1851,5.0900);
  705.                 SendClientMessage(i, COLOR_WHITE, "Training is finish because a match will start soon!");
  706.                 allenamento[i] = 0;
  707.                 }
  708.                 }
  709.                 }
  710.                 }
  711.                 if(listitem == 3)
  712.                 {
  713.                 ShowPlayerDialog(playerid, 10, DIALOG_STYLE_LIST, string, "Add Stuart\nFire Stuart", "Select", "Exit");
  714.                 }
  715.                 if(listitem == 4)
  716.                 {
  717.                 GetPlayerName(playerid, sendername, sizeof(sendername));
  718.                 format(string, sizeof(string), "* Referee %s starts the match.", sendername);
  719.                 ProxDetector(50.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  720.                 }
  721.                 if(listitem == 5)
  722.                 {
  723.                 DestroyObject(palla);
  724.                 palla = CreateObject(1598, -180.464828, -7.425705, 2.414398, 0.0000, 0.0000, 0.0000);
  725.                 }
  726.                 if(listitem == 6)
  727.                 {
  728.                 new Float: X, Float: Y, Float: Z;
  729.                 GetPlayerPos(playerid, X, Y, Z);
  730.                 DestroyObject(palla);
  731.                 palla = CreateObject(1598, X, Y, 2.414398, 0.0000, 0.0000, 0.0000);
  732.                 }
  733.                 if(listitem == 7)
  734.                 {
  735.                 ShowPlayerDialog(playerid, 4, DIALOG_STYLE_INPUT, "Fire player", "Please insert id of the player", "Select", "Exit");
  736.                 }
  737.                 if(listitem == 8)
  738.                 {
  739.                 format(string, sizeof(string), "%s\n%s", squadra1, squadra2);
  740.         ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "Referee commands - Goal", string, "Select", "Exit");
  741.                 }
  742.                 if(listitem == 9)
  743.                 {
  744.                 GetPlayerName(playerid, sendername, sizeof(sendername));
  745.                 format(string, sizeof(string), "* Referee %s stops the match.", sendername);
  746.                 ProxDetector(50.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  747.                 }
  748.                 if(listitem == 10)
  749.                 {
  750.                 format(string, sizeof(string), "Match is finish: %s %d - %d %s", squadra1, goal1, goal2, squadra2);
  751.                 SendClientMessageToAll(COLOR_GROVE, string);
  752.                 goal1 = 0;
  753.                 goal2 = 0;
  754.                 annunciata = 0;
  755.                 squadra1 = "Team1";
  756.                 squadra2 = "Team2";
  757.                 for(new i = 0; i < MAX_PLAYERS; i++)
  758.                 {
  759.                 if(giocatore[i] >= 1 || arbitro[i] == 1 || stuart[i] == 1)
  760.                 {
  761.                 SetPlayerSkin(i, skin[i]);
  762.                 giocatore[i] = 0;
  763.                 arbitro[i] = 0;
  764.                 stuart[i] = 0;
  765.                 }
  766.                 }
  767.                 }
  768.                 if(listitem == 11)
  769.                 {
  770.                 new coin = random(2)+1;
  771.                 GetPlayerName(playerid, sendername, sizeof(sendername));
  772.                 new coinname[20];
  773.                 if(coin == 1) { coinname = "head"; }
  774.                 else { coinname = "tail"; }
  775.                 format(string, sizeof(string), "*** Referee %s flips a coin and lands on a %s", sendername,coinname);
  776.                 ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  777.                 }
  778.                 }
  779.         if(dialogid == 2)
  780.         {
  781.                 if(listitem == 0)
  782.                 {
  783.                 ShowPlayerDialog(playerid, 6, DIALOG_STYLE_INPUT, "Change name", "Insert the name of the Team1", "Select", "Exit");
  784.                 }
  785.                 if(listitem == 1)
  786.                 {
  787.                 ShowPlayerDialog(playerid, 7, DIALOG_STYLE_INPUT, "Add player", "Insert id of the player to add", "Select", "Exit");
  788.                 }
  789.         }
  790.         if(dialogid == 3)
  791.         {
  792.                 if(listitem == 0)
  793.                 {
  794.                 ShowPlayerDialog(playerid, 8, DIALOG_STYLE_INPUT, "Change name", "Insert the name of the Team2", "Select", "Exit");
  795.                 }
  796.                 if(listitem == 1)
  797.                 {
  798.                 ShowPlayerDialog(playerid, 9, DIALOG_STYLE_INPUT, "Add Player", "Insert id of the player to add", "Select", "Exit");
  799.                 }
  800.         }
  801.         if(dialogid == 4)
  802.         {
  803.         if(strlen(inputtext))
  804.                     {
  805.                                 new giveplayerid;
  806.                                 giveplayerid = ReturnUser(inputtext);
  807.                                 if(IsPlayerConnected(giveplayerid))
  808.                                 {
  809.                                     if(giveplayerid != INVALID_PLAYER_ID && giocatore[giveplayerid] >= 1)
  810.                                     {
  811.                                     giocatore[giveplayerid] = 0;
  812.                                     SetPlayerSkin(giveplayerid, skin[giveplayerid]);
  813.                                     GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  814.                                     format(string, sizeof(string), "You fired %s", giveplayer);
  815.                                     SendClientMessage(playerid, COLOR_WHITE, string);
  816.                                     format(string, sizeof(string), "You were been fired by referee %s", sendername);
  817.                                     SendClientMessage(giveplayerid, COLOR_WHITE, string);
  818.                                     }
  819.                                 }
  820.                         }
  821.         }
  822.         if(dialogid == 5)
  823.         {
  824.                 if(listitem == 0)
  825.                 {
  826.                 goal1 ++;
  827.                 format(string, sizeof(string), "[SPEAKER]: Current goals: %s %d - %d %s", squadra1, goal1, goal2, squadra2);
  828.                 ProxDetector(100.0, playerid, string, COLOR_GROVE,COLOR_GROVE,COLOR_GROVE,COLOR_GROVE,COLOR_GROVE);
  829.                 }
  830.                 if(listitem == 1)
  831.                 {
  832.                 goal2 ++;
  833.                 format(string, sizeof(string), "[SPEAKER]: Current goals: %s %d - %d %s", squadra1, goal1, goal2, squadra2);
  834.                 ProxDetector(100.0, playerid, string, COLOR_GROVE,COLOR_GROVE,COLOR_GROVE,COLOR_GROVE,COLOR_GROVE);
  835.                 }
  836.         }
  837.         if(dialogid == 6)
  838.         {
  839.         if(strlen(inputtext))
  840.                     {
  841.                                 format(string, sizeof(string), "%s", inputtext);
  842.                                 strmid(squadra1, string, 0, strlen(string), 255);
  843.                                 format(string, sizeof(string), "Team1 name: %s", squadra1);
  844.                                 SendClientMessage(playerid, COLOR_WHITE, string);
  845.                         }
  846.         }
  847.         if(dialogid == 7)
  848.         {
  849.         if(strlen(inputtext))
  850.                     {
  851.                                 new giveplayerid;
  852.                                 giveplayerid = ReturnUser(inputtext);
  853.                                 if(IsPlayerConnected(giveplayerid))
  854.                                 {
  855.                                     if(giveplayerid != INVALID_PLAYER_ID)
  856.                                     {
  857.                                     giocatore[giveplayerid] = 1;
  858.                                     skin[giveplayerid] = GetPlayerSkin(giveplayerid);
  859.                                     SetPlayerSkin(giveplayerid, 96);
  860.                                     GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  861.                                     format(string, sizeof(string), "%s now plays for %s", giveplayer, squadra1);
  862.                                     SendClientMessage(playerid, COLOR_WHITE, string);
  863.                                     format(string, sizeof(string), " Referee %s authorized you to play", sendername);
  864.                                     SendClientMessage(giveplayerid, COLOR_WHITE, string);
  865.                                     }
  866.                                 }
  867.                         }
  868.         }
  869.         if(dialogid == 8)
  870.         {
  871.         if(strlen(inputtext))
  872.                     {
  873.                                 format(string, sizeof(string), "%s", inputtext);
  874.                                 strmid(squadra2, string, 0, strlen(string), 255);
  875.                                 format(string, sizeof(string), "Team2 name: %s", squadra2);
  876.                                 SendClientMessage(playerid, COLOR_WHITE, string);
  877.                         }
  878.         }
  879.         if(dialogid == 9)
  880.         {
  881.         if(strlen(inputtext))
  882.                     {
  883.                                 new giveplayerid;
  884.                                 giveplayerid = ReturnUser(inputtext);
  885.                                 if(IsPlayerConnected(giveplayerid))
  886.                                 {
  887.                                     if(giveplayerid != INVALID_PLAYER_ID)
  888.                                     {
  889.                                     giocatore[giveplayerid] = 2;
  890.                                     skin[giveplayerid] = GetPlayerSkin(giveplayerid);
  891.                                     SetPlayerSkin(giveplayerid, 23);
  892.                                     GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  893.                                     format(string, sizeof(string), "%s now plays for %s", giveplayer, squadra2);
  894.                                     SendClientMessage(playerid, COLOR_WHITE, string);
  895.                                     format(string, sizeof(string), " Referee %s has authorized you to play", sendername);
  896.                                     SendClientMessage(giveplayerid, COLOR_WHITE, string);
  897.                                     }
  898.                                 }
  899.                         }
  900.         }
  901.         if(dialogid == 10)
  902.         {
  903.         if(listitem == 0)
  904.         {
  905.         ShowPlayerDialog(playerid, 11, DIALOG_STYLE_INPUT, "Add Stuart", "Insert id of the player to add", "Select", "Exit");
  906.         }
  907.         if(listitem == 1)
  908.         {
  909.         ShowPlayerDialog(playerid, 12, DIALOG_STYLE_INPUT, "Fire Stuart", "Insert id of the player to fire", "Select", "Exit");
  910.         }
  911.         }
  912.         if(dialogid == 11)
  913.         {
  914.         if(strlen(inputtext))
  915.                     {
  916.                                 new giveplayerid;
  917.                                 giveplayerid = ReturnUser(inputtext);
  918.                                 if(IsPlayerConnected(giveplayerid))
  919.                                 {
  920.                                     if(giveplayerid != INVALID_PLAYER_ID)
  921.                                     {
  922.                                     stuart[giveplayerid] = 1;
  923.                                     skin[giveplayerid] = GetPlayerSkin(giveplayerid);
  924.                                     SetPlayerSkin(giveplayerid, 16);
  925.                                     GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  926.                                     format(string, sizeof(string), "%s now is a stuart", giveplayer);
  927.                                     SendClientMessage(playerid, COLOR_WHITE, string);
  928.                                     format(string, sizeof(string), " Referee %s authorized you as a stuart", sendername);
  929.                                     SendClientMessage(giveplayerid, COLOR_WHITE, string);
  930.                                     }
  931.                                 }
  932.                         }
  933.         }
  934.         if(dialogid == 12)
  935.         {
  936.         if(strlen(inputtext))
  937.                     {
  938.                                 new giveplayerid;
  939.                                 giveplayerid = ReturnUser(inputtext);
  940.                                 if(IsPlayerConnected(giveplayerid))
  941.                                 {
  942.                                     if(giveplayerid != INVALID_PLAYER_ID && stuart[giveplayerid] >= 1)
  943.                                     {
  944.                                     stuart[giveplayerid] = 0;
  945.                                     SetPlayerSkin(giveplayerid, skin[giveplayerid]);
  946.                                     GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  947.                                     format(string, sizeof(string), "You fired %s from", giveplayer);
  948.                                     SendClientMessage(playerid, COLOR_WHITE, string);
  949.                                     format(string, sizeof(string), "Referee %s has de-authorized you as stuart", sendername);
  950.                                     SendClientMessage(giveplayerid, COLOR_WHITE, string);
  951.                                     }
  952.                                 }
  953.                         }
  954.         }
  955.         if(dialogid == 13)
  956.         {
  957.         if(listitem == 0)
  958.         {
  959.         format(string, sizeof(string), "grandstand $6\ndiscovery platform $5\ncurve fans %s $3\ncurve fans %s $3", squadra1, squadra2);
  960.     ShowPlayerDialog(playerid, 14, DIALOG_STYLE_LIST, "Tickets - Buy ticket", string, "Select", "Exit");
  961.         }
  962.         if(listitem == 1)
  963.         {
  964.         new money = GetPlayerMoney(playerid);
  965.         if(money < 30)
  966.         {
  967.         SendClientMessage(playerid, COLOR_WHITE, "You don't have $30!");
  968.         return 1;
  969.         }
  970.         else
  971.         {
  972.         if(fumogeno[playerid] == 1)
  973.         {
  974.         SendClientMessage(playerid, COLOR_WHITE, "You can't buy another smoker for this match!");
  975.         return 1;
  976.         }
  977.         else
  978.         {
  979.         GivePlayerMoney(playerid, -30);
  980.         SendClientMessage(playerid, COLOR_WHITE, "You bought a smoker for $30!");
  981.         GivePlayerWeapon(playerid, 17, 1);
  982.         fumogeno[playerid] = 1;
  983.         }
  984.         }
  985.         }
  986.         }
  987.         if(dialogid == 14)
  988.         {
  989.         if(listitem == 0)
  990.         {
  991.         new money = GetPlayerMoney(playerid);
  992.         if(money < 6)
  993.         {
  994.         SendClientMessage(playerid, COLOR_WHITE, "You don't have $6!");
  995.         return 1;
  996.         }
  997.         else
  998.         {
  999.         GivePlayerMoney(playerid, -6);
  1000.         biglietto[playerid] = 1;
  1001.         SendClientMessage(playerid, COLOR_WHITE, "You bought a ticket, it can't be used 2 times");
  1002.         SendClientMessage(playerid, COLOR_LIGHTBLUE, "[HINT]: You will pass into a metal detector and all your guns will be taken");
  1003.         }
  1004.         }
  1005.         if(listitem == 1)
  1006.         {
  1007.         new money = GetPlayerMoney(playerid);
  1008.         if(money < 5)
  1009.         {
  1010.         SendClientMessage(playerid, COLOR_WHITE, "You don't have $5!");
  1011.         return 1;
  1012.         }
  1013.         else
  1014.         {
  1015.         GivePlayerMoney(playerid, -5);
  1016.         biglietto[playerid] = 2;
  1017.         SendClientMessage(playerid, COLOR_WHITE, "You bought a ticket, it can't be used 2 times");
  1018.         SendClientMessage(playerid, COLOR_LIGHTBLUE, "[HINT]: You will pass into a metal detector and all your guns will be taken");
  1019.         }
  1020.         }
  1021.         if(listitem == 2)
  1022.         {
  1023.         new money = GetPlayerMoney(playerid);
  1024.         if(money < 3)
  1025.         {
  1026.         SendClientMessage(playerid, COLOR_WHITE, "You don't have $3!");
  1027.         return 1;
  1028.         }
  1029.         else
  1030.         {
  1031.         GivePlayerMoney(playerid, -3);
  1032.         biglietto[playerid] = 3;
  1033.         SendClientMessage(playerid, COLOR_WHITE, "You bought a ticket, it can't be used 2 times");
  1034.         SendClientMessage(playerid, COLOR_LIGHTBLUE, "[HINT]: You will pass into a metal detector and all your guns will be taken");
  1035.         }
  1036.         }
  1037.         if(listitem == 3)
  1038.         {
  1039.         new money = GetPlayerMoney(playerid);
  1040.         if(money < 5)
  1041.         {
  1042.         SendClientMessage(playerid, COLOR_WHITE, "You don't have $3!");
  1043.         return 1;
  1044.         }
  1045.         else
  1046.         {
  1047.         GivePlayerMoney(playerid, -3);
  1048.         biglietto[playerid] = 4;
  1049.         SendClientMessage(playerid, COLOR_WHITE, "You bought a ticket, it can't be used 2 times");
  1050.         SendClientMessage(playerid, COLOR_LIGHTBLUE, "[HINT]: You will pass into a metal detector and all your guns will be taken");
  1051.         }
  1052.         }
  1053.         }
  1054.         if(dialogid == 15)
  1055.         {
  1056.         if(listitem == 0)
  1057.                         {
  1058.                         SetPlayerPos(playerid, -211.9384,3.9319,7.9039);
  1059.                         SendClientMessage(playerid, COLOR_WHITE, "Go down from ladders to exit from the stadium");
  1060.                         GameTextForPlayer(playerid, "~g~Welcome", 5000, 1);
  1061.                         spettatore[playerid] = 1;
  1062.                         }
  1063.         if(listitem == 1)
  1064.                         {
  1065.                 SetPlayerPos(playerid, -147.5607,-19.1419,8.0165);
  1066.                         SendClientMessage(playerid, COLOR_WHITE, "Go down from ladders to exit from the stadium");
  1067.                         GameTextForPlayer(playerid, "~g~Welcome", 5000, 1);
  1068.                         spettatore[playerid] = 1;               }
  1069.     if(listitem == 2)
  1070.                         {
  1071.                 SetPlayerPos(playerid, -200.3670,-55.6259,9.6309);
  1072.                         SendClientMessage(playerid, COLOR_WHITE, "Go down from ladders to exit from the stadium");
  1073.                         GameTextForPlayer(playerid, "~g~Welcome", 5000, 1);
  1074.                         spettatore[playerid] = 1;               }
  1075.     if(listitem == 3)
  1076.                         {
  1077.                 SetPlayerPos(playerid, -160.0574,40.9410,8.3338);
  1078.                         SendClientMessage(playerid, COLOR_WHITE, "Go down from ladders to exit from the stadium");
  1079.                         GameTextForPlayer(playerid, "~g~Welcome", 5000, 1);
  1080.                         spettatore[playerid] = 1;
  1081.                 }
  1082.         }
  1083.        
  1084.        
  1085.         }//end response
  1086.         return 1;
  1087. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement