Guest User

Fudbal fs :D

a guest
Apr 18th, 2012
922
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 46.27 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. #endif
  251.  
  252. strtok(const string[], &index)
  253. {
  254.         new length = strlen(string);
  255.         while ((index < length) && (string[index] <= ' '))
  256.         {
  257.                 index++;
  258.         }
  259.  
  260.         new offset = index;
  261.         new result[20];
  262.         while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  263.         {
  264.                 result[index - offset] = string[index];
  265.                 index++;
  266.         }
  267.         result[index - offset] = EOS;
  268.         return result;
  269. }
  270.  
  271. GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
  272. {
  273.         new Float:a;
  274.         GetPlayerPos(playerid, x, y, a);
  275.         GetPlayerFacingAngle(playerid, a);
  276.         if (GetPlayerVehicleID(playerid))
  277.         {
  278.             GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
  279.         }
  280.         x += (distance * floatsin(-a, degrees));
  281.         y += (distance * floatcos(-a, degrees));
  282. }
  283. public CustomPickups()
  284. {
  285.         new Float:oldposx, Float:oldposy, Float:oldposz;
  286.  
  287.         for(new i = 0; i < MAX_PLAYERS; i++)
  288.         {
  289.                 if(IsPlayerConnected(i))
  290.                 {
  291.                         GetPlayerPos(i, oldposx, oldposy, oldposz);
  292.                         if (PlayerToPoint(1.7, i, -222.5425,-86.7066,3.1172))
  293.                         {//biglietteria
  294.                          GameTextForPlayer(i, "~g~Karte,Dimne bombe,~n~~y~stisni ~r~SPACE~y~~n~~w~da bi kupili nesto", 5000, 3);
  295.                         }
  296.                         else if (PlayerToPoint(1.7, i, -202.9730,-66.6648,3.3062))
  297.                         {//entrata allo stadio
  298.                          GameTextForPlayer(i, "~g~Ulaz~n~~y~Pritisnite space ~r~da bi izasli", 5000, 3);
  299.                         }
  300.                         else if(PlayerToPoint(1.7, i, -195.1585,-100.0893,3.1163))
  301.                         {//ingresso sala stampa
  302.                         SetPlayerPos(i, -186.7655,-116.7739,3.1213);
  303.                         GameTextForPlayer(i, "~g~Redakcija", 5000, 1);
  304.                         }
  305.                         else if(PlayerToPoint(1.7, i, -184.8640,-114.0260,3.1213))
  306.                         {//uscita sala stampa
  307.                         SetPlayerPos(i, -199.5605,-99.5375,3.1163);
  308.                         GameTextForPlayer(i, "~r~Izlaz", 5000, 1);
  309.                         }
  310.                         else if(PlayerToPoint(1.7, i, -210.6958,-3.7785,3.1094))
  311.                         {//uscita dal campo
  312.                         GameTextForPlayer(i, "~g~Ulaz~n~~y~Pritisnite space ~r~da bi izasli", 5000, 3);
  313.                         }
  314.                         else if(PlayerToPoint(1.7, i, -182.5193,-135.1851,5.0900))
  315.                         {//ingresso in campo
  316.                         if(annunciata == 1)
  317.                         {
  318.                         if(arbitro[i] == 1 || giocatore [i] >= 1 || stuart[i] == 1)
  319.                         {
  320.                         GameTextForPlayer(i, "~g~Ulaz~n~~y~Pritisnite space ~r~da bi usli", 5000, 3);
  321.                         }
  322.                         else
  323.                         {
  324.                         GameTextForPlayer(i, "~r~Ne mozete uci", 5000, 1);
  325.                         }
  326.                         }
  327.                         else//annunciata == 0
  328.                         {
  329.                         if(arbitro[i] == 1)
  330.                         {
  331.                         GameTextForPlayer(i, "~g~Ulaz~n~~y~Pritisnite space ~r~da bi usli", 5000, 3);
  332.                         }
  333.                         else
  334.                         {
  335.                         GameTextForPlayer(i, "~g~Ulaz~n~~y~Pritisnite space ~r~da bi poceli trening", 5000, 3);
  336.                         }
  337.                         }
  338.                         }
  339.                         }
  340.  
  341.  
  342.                 }
  343.         }
  344. public KeyChanges()
  345. {
  346.     new keys, updown, leftright;
  347.     new string[256];
  348.     for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
  349.     {
  350.         if(IsPlayerConnected(playerid))
  351.         {
  352.         GetPlayerKeys(playerid, keys, updown, leftright);
  353.  
  354.         new Float:ox, Float:oy, Float:oz;
  355.         GetObjectPos(palla, ox, oy, oz);
  356.  
  357.         new Float:px, Float:py, Float:pz;
  358.  
  359.         new Float:angle;
  360.         GetPlayerFacingAngle(playerid, angle);
  361.  
  362.         if(keys == KEY_FIRE && giocatore[playerid] >= 1 || keys == KEY_FIRE && allenamento[playerid] >= 1)
  363.                             {
  364.                                 if(PlayerToPoint(2.5,playerid,ox,oy,oz))
  365.                                 {
  366.                                 GetPlayerPos(playerid, px, py, pz);
  367.                                 GetXYInFrontOfPlayer(playerid, px, py, 10.0);
  368.                                 MoveObject(palla,px,py,2.414398,8.0);
  369.                                 PlayerPlaySound(playerid,1130,0.0,0.0,0.0);
  370.                                 ApplyAnimation(playerid,"FIGHT_D","FightD_1",4.1,0,1,1,0,0);
  371.                                 }
  372.                                 }
  373.         else if(keys == KEY_FIRE + KEY_SPRINT && giocatore[playerid] >= 1 || keys == KEY_FIRE + KEY_SPRINT && allenamento[playerid] >= 1)
  374.                             {
  375.                             if(PlayerToPoint(2.5,playerid,ox,oy,oz))
  376.                                 {
  377.                                 GetPlayerPos(playerid, px, py, pz);
  378.                                 GetXYInFrontOfPlayer(playerid, px, py, 10.0);
  379.                                 MoveObject(palla,px,py,2.414398,10.0);
  380.                                 PlayerPlaySound(playerid,1130,0.0,0.0,0.0);
  381.                                 ApplyAnimation(playerid,"FIGHT_D","FightD_1",4.1,0,1,1,0,0);
  382.                         }
  383.                         }
  384.         else if(keys == KEY_SPRINT && PlayerToPoint(1.7, playerid, -222.5425,-86.7066,3.1172))
  385.                         {
  386.                         if(annunciata == 1)
  387.                         {
  388.                         ShowPlayerDialog(playerid, 13, DIALOG_STYLE_LIST, "Ulaznice izaberite sta zelite da kupite", "Ulaznica\nSDimne bombe $30", "Odaberi", "Izadji");
  389.                         }
  390.                         else
  391.                         {
  392.                 GameTextForPlayer(playerid, "~r~Zatvoreno", 5000, 1);
  393.                 PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
  394.                 return 1;
  395.                 }
  396.                 }
  397.  
  398.         else if(keys == KEY_SPRINT && PlayerToPoint(1.7, playerid, -182.5193,-135.1851,5.0900))
  399.                         {//ingresso in campo
  400.                         if(annunciata == 1)
  401.                         {
  402.                         if(arbitro[playerid] == 1 || giocatore [playerid] >= 1 || stuart[playerid] == 1)
  403.                         {
  404.                         SetPlayerPos(playerid, -210.6958,-3.7785,3.1094);
  405.                         }
  406.                         }
  407.                         else//annunciata == 0
  408.                         {
  409.                         if(arbitro[playerid] == 1)
  410.                         {
  411.                         SetPlayerPos(playerid, -204.9500,-5.2410,3.1094);
  412.                         }
  413.                         else
  414.                         {
  415.                         SetPlayerPos(playerid, -204.9500,-5.2410,3.1094);
  416.                         allenamento[playerid] = 1;
  417.                         }
  418.                         }
  419.                         }//sono
  420.  
  421.         else if(keys == KEY_SPRINT && PlayerToPoint(1.7, playerid, -210.6958,-3.7785,3.1094))
  422.         {
  423.         if(spettatore[playerid] != 1)
  424.         {
  425.         if(allenamento[playerid] == 1)
  426.         {
  427.         SetPlayerPos(playerid, -183.8667,-131.6020,5.0900);
  428.         SendClientMessage(playerid, COLOR_WHITE, "Zavrsen trening");
  429.         allenamento[playerid] = 0;
  430.         }
  431.         else
  432.         {
  433.         SetPlayerPos(playerid, -183.8667,-131.6020,5.0900);
  434.         }
  435.         }
  436.         }
  437.  
  438.         else if(keys == KEY_SPRINT && PlayerToPoint(1.7, playerid, -202.9730,-66.6648,3.3062))
  439.                         {
  440.                         if(biglietto[playerid] == 1)
  441.                         {
  442.                         SetPlayerPos(playerid, -211.9384,3.9319,7.9039);
  443.                         SendClientMessage(playerid, COLOR_WHITE, "Idite dole da bi izasli sa stadiona");
  444.                         GameTextForPlayer(playerid, "~g~Welcome", 5000, 1);
  445.                         biglietto[playerid] = 0;
  446.                         spettatore[playerid] = 1;
  447.                         MetalDetector(playerid);
  448.                         }
  449.                         else if(biglietto[playerid] == 2)
  450.                         {
  451.                         SetPlayerPos(playerid, -147.5607,-19.1419,8.0165);
  452.                         SendClientMessage(playerid, COLOR_WHITE, "Idite dole da bi izasli sa stadiona");
  453.                         GameTextForPlayer(playerid, "~g~Welcome", 5000, 1);
  454.                         biglietto[playerid] = 0;
  455.                         spettatore[playerid] = 1;
  456.                         MetalDetector(playerid);                }
  457.                         else if(biglietto[playerid] == 3)
  458.                         {
  459.                         SetPlayerPos(playerid, -200.3670,-55.6259,9.6309);
  460.                         SendClientMessage(playerid, COLOR_WHITE, "Idite dole da bi izasli sa stadiona");
  461.                         GameTextForPlayer(playerid, "~g~Welcome", 5000, 1);
  462.                         biglietto[playerid] = 0;
  463.                         spettatore[playerid] = 1;
  464.                         MetalDetector(playerid);                }
  465.                         else if(biglietto[playerid] == 4)
  466.                         {
  467.                         SetPlayerPos(playerid, -160.0574,40.9410,8.3338);
  468.                         SendClientMessage(playerid, COLOR_WHITE, "Idite dole da bi izasli sa stadiona");
  469.                         GameTextForPlayer(playerid, "~g~Welcome", 5000, 1);
  470.                         biglietto[playerid] = 0;
  471.                         spettatore[playerid] = 1;
  472.                         MetalDetector(playerid);
  473.                 }
  474.                 else if(biglietto[playerid] == 0 && stuart[playerid]== 1)
  475.                 {
  476.                 format(string, sizeof(string), "grandstand\ndiscovery platform\ncurve fans %s\ncurve fans %s", squadra1, squadra2);
  477.                 ShowPlayerDialog(playerid, 15, DIALOG_STYLE_LIST, "Stuart Entrance - Choose where to go", string, "Izaberi", "Obrisi");
  478.                 }
  479.                 else
  480.                 {
  481.                 SendClientMessage(playerid, COLOR_WHITE, "Nemas ticket!");
  482.                 return 1;
  483.                 }
  484.                 }
  485.                 }
  486.         }return 1;
  487. }
  488.  
  489. public MetalDetector(playerid)
  490. {
  491. new ammo,weap;
  492. GetPlayerWeaponData(playerid, 8,weap,ammo);
  493. if (weap == 17 && ammo >= 1)
  494. {
  495. ResetPlayerWeapons(playerid);
  496. GivePlayerWeapon(playerid, 17, 1);
  497. }
  498. else
  499. {
  500. ResetPlayerWeapons(playerid);
  501. }
  502. }
  503.  
  504. public AntiInvasione()
  505. {
  506. for(new i = 0; i < MAX_PLAYERS; i++)
  507. {
  508. if(spettatore[i] == 1)
  509. {
  510. new Float:X, Float:Y, Float:Z;
  511. GetPlayerPos(i, X, Y, Z);
  512. if(Z < 4 || Z > 12)
  513. {
  514. SetPlayerPos(i, -202.9730,-66.6648,3.3062);
  515. spettatore[i] = 0;
  516. GameTextForPlayer(i, "~r~Exit", 5000, 1);
  517. }
  518. }
  519. }
  520. }
  521.  
  522.  
  523. public SafeGivePlayerMoney(plyid, amounttogive)
  524. {
  525.         new curHour, curMinute, curSecond;
  526.         gettime(curHour, curMinute, curSecond);
  527.         if (amounttogive < 0)
  528.         {
  529.                 GivePlayerMoney(plyid, amounttogive);
  530.         }
  531.         else
  532.         {
  533.                 GivePlayerMoney(plyid, amounttogive);
  534.         }
  535.         return 1;
  536. }
  537.  
  538. public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
  539. {
  540.         if(IsPlayerConnected(playerid))
  541.         {
  542.                 new Float:posx, Float:posy, Float:posz;
  543.                 new Float:oldposx, Float:oldposy, Float:oldposz;
  544.                 new Float:tempposx, Float:tempposy, Float:tempposz;
  545.                 GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  546.                 //radi = 2.0; //Trigger Radius
  547.                 for(new i = 0; i < MAX_PLAYERS; i++)
  548.                 {
  549.                         if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
  550.                         {
  551.                                         GetPlayerPos(i, posx, posy, posz);
  552.                                         tempposx = (oldposx -posx);
  553.                                         tempposy = (oldposy -posy);
  554.                                         tempposz = (oldposz -posz);
  555.                                         //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
  556.                                         if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
  557.                                         {
  558.                                                 SendClientMessage(i, col1, string);
  559.                                         }
  560.                                         else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
  561.                                         {
  562.                                                 SendClientMessage(i, col2, string);
  563.                                         }
  564.                                         else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
  565.                                         {
  566.                                                 SendClientMessage(i, col3, string);
  567.                                         }
  568.                                         else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
  569.                                         {
  570.                                                 SendClientMessage(i, col4, string);
  571.                                         }
  572.                                         else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  573.                                         {
  574.                                                 SendClientMessage(i, col5, string);
  575.                                         }
  576.                         }
  577.                 }
  578.         }//not connected
  579.         return 1;
  580. }
  581.  
  582. public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
  583. {
  584.     if(IsPlayerConnected(playerid))
  585.         {
  586.                 new Float:oldposx, Float:oldposy, Float:oldposz;
  587.                 new Float:tempposx, Float:tempposy, Float:tempposz;
  588.                 GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  589.                 tempposx = (oldposx -x);
  590.                 tempposy = (oldposy -y);
  591.                 tempposz = (oldposz -z);
  592.                 //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
  593.                 if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  594.                 {
  595.                         return 1;
  596.                 }
  597.         }
  598.         return 0;
  599. }
  600.  
  601. public OnPlayerCommandText(playerid, cmdtext[])
  602. {
  603.         new string[256];
  604.         new sendername[MAX_PLAYER_NAME];
  605.         new giveplayer[MAX_PLAYER_NAME];
  606.         new cmd[256];
  607.         new tmp[256];
  608.         new idx;
  609.         cmd = strtok(cmdtext, idx);
  610.         if(strcmp(cmd, "/sudija", true) == 0)
  611.         {
  612.             if(IsPlayerConnected(playerid))
  613.             {
  614.                 if(!IsPlayerAdmin(playerid))
  615.                 {
  616.                 SendClientMessage(playerid, COLOR_WHITE, "Niste logirani kao RCON Admin");
  617.                 return 1;
  618.                 }
  619.                         tmp = strtok(cmdtext, idx);
  620.                         if(!strlen(tmp))
  621.                         {
  622.                                 SendClientMessage(playerid, COLOR_WHITE, "Koristi: /sudija [playerid/PartOfName]");
  623.                                 return 1;
  624.                         }
  625.                         new para1;
  626.                         para1 = ReturnUser(tmp);
  627.                         tmp = strtok(cmdtext, idx);
  628.                         if(IsPlayerConnected(para1))
  629.                             {
  630.                                 if(para1 != INVALID_PLAYER_ID)
  631.                                 {
  632.                                                 GetPlayerName(para1, giveplayer, sizeof(giveplayer));
  633.                                                 GetPlayerName(playerid, sendername, sizeof(sendername));
  634.                                                 arbitro[para1] = 1;
  635.                                                 printf("%s je izabrao %s za sudiju.", sendername, giveplayer);
  636.                                                 format(string, sizeof(string), "   %s je izabro tebe za sudiju", sendername);
  637.                                                 SendClientMessage(para1, COLOR_WHITE, string);
  638.                                                 format(string, sizeof(string), "   Vi ste izabrali %s za sudiju.", giveplayer);
  639.                                                 SendClientMessage(playerid, COLOR_WHITE, string);
  640.                                                 format(string, sizeof(string), " %s je sudija za sledeci mec! SVI NA STADION !!", giveplayer);
  641.                                                 SendClientMessageToAll(COLOR_GROVE, string);
  642.                                                 skin[para1] = GetPlayerSkin(para1);
  643.                                                 SetPlayerSkin(para1, 72);
  644.                                         }
  645.                                 }
  646.                 }
  647.                 return 1;
  648.         }
  649.  
  650.         if(strcmp(cmd, "/sk", true) == 0)
  651.     {
  652.         if(IsPlayerConnected(playerid))
  653.         {
  654.         if(arbitro[playerid] == 1)
  655.         {
  656.         format(string, sizeof(string), "%s\n%s\nNajava za mec\nStuart\nStartuj mec\nLopta na centru\nLopta kod tebe\nCrveni karton\nGol\nZaustvi igru\nZavrsi mec\nNovcic", squadra1, squadra2);
  657.         ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Komande za sudiju", string, "Izaberi", "Izadji");
  658.         }
  659.         }return 1;
  660.         }
  661.         return 0;
  662. }
  663.  
  664. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  665. {
  666.         new sendername[MAX_PLAYER_NAME];
  667.         new giveplayer[MAX_PLAYER_NAME];
  668.         GetPlayerName(playerid, sendername, sizeof(sendername));
  669.         new string[128];
  670.         if(response)
  671.         {
  672.         if(dialogid == 1)
  673.         {
  674.                 if(listitem == 0)
  675.                 {
  676.                 format(string, sizeof(string), " Komande za sudiju- %s", squadra1);
  677.                 ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, string, "Promeni ime tima\nDodaj igraca", "Select", "Exit");
  678.                 }
  679.                 if(listitem == 1)
  680.                 {
  681.                 format(string, sizeof(string), " Komande za sudiju - %s", squadra2);
  682.                 ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, string, "Promeni ime tima\nDodaj igraca", "Select", "Exit");
  683.                 }
  684.                 if(listitem == 2)
  685.                 {
  686.                 if(annunciata == 1)
  687.                 {
  688.                 SendClientMessage(playerid, COLOR_WHITE, "Najavio si mec! Sada stisni 'Startuj mec'");
  689.                 return 1;
  690.                 }
  691.                 else
  692.                 {
  693.                 format(string, sizeof(string), " Fudbalski mec izmedju %s i %s pocece za 20 minuta! Sudija: %s", squadra1, squadra2, sendername);
  694.                 SendClientMessageToAll(COLOR_GROVE, string);
  695.                 annunciata = 1;
  696.                 for(new i = 0; i < MAX_PLAYERS; i++)
  697.                 {
  698.                 if(allenamento[i] == 1)
  699.                 {
  700.                 SetPlayerPos(i, -182.5193,-135.1851,5.0900);
  701.                 SendClientMessage(i, COLOR_WHITE, "Trening je zavrsen zato sto mec uskoro pocenje!");
  702.                 allenamento[i] = 0;
  703.                 }
  704.                 }
  705.                 }
  706.                 }
  707.                 if(listitem == 3)
  708.                 {
  709.                 ShowPlayerDialog(playerid, 10, DIALOG_STYLE_LIST, string, "Add Stuart\nFire Stuart", "Odaberi", "Izadji");
  710.                 }
  711.                 if(listitem == 4)
  712.                 {
  713.                 GetPlayerName(playerid, sendername, sizeof(sendername));
  714.                 format(string, sizeof(string), "* Sudija %s je startovo mec.", sendername);
  715.                 ProxDetector(50.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  716.                 }
  717.                 if(listitem == 5)
  718.                 {
  719.                 DestroyObject(palla);
  720.                 palla = CreateObject(1598, -180.464828, -7.425705, 2.414398, 0.0000, 0.0000, 0.0000);
  721.                 }
  722.                 if(listitem == 6)
  723.                 {
  724.                 new Float: X, Float: Y, Float: Z;
  725.                 GetPlayerPos(playerid, X, Y, Z);
  726.                 DestroyObject(palla);
  727.                 palla = CreateObject(1598, X, Y, 2.414398, 0.0000, 0.0000, 0.0000);
  728.                 }
  729.                 if(listitem == 7)
  730.                 {
  731.                 ShowPlayerDialog(playerid, 4, DIALOG_STYLE_INPUT, "Crveni karton", "Ukucajte id igraca", "Odaveri", "Izadji");
  732.                 }
  733.                 if(listitem == 8)
  734.                 {
  735.                 format(string, sizeof(string), "%s\n%s", squadra1, squadra2);
  736.                 ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "Komande za sudiju - Goal", string, "Odaberi", "Izadji");
  737.                 }
  738.                 if(listitem == 9)
  739.                 {
  740.                 GetPlayerName(playerid, sendername, sizeof(sendername));
  741.                 format(string, sizeof(string), "* Sudija %s prekida mec.", sendername);
  742.                 ProxDetector(50.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  743.                 }
  744.                 if(listitem == 10)
  745.                 {
  746.                 format(string, sizeof(string), "Mec je zavrsen: %s %d - %d %s", squadra1, goal1, goal2, squadra2);
  747.                 SendClientMessageToAll(COLOR_GROVE, string);
  748.                 goal1 = 0;
  749.                 goal2 = 0;
  750.                 annunciata = 0;
  751.                 squadra1 = "Team1";
  752.                 squadra2 = "Team2";
  753.                 for(new i = 0; i < MAX_PLAYERS; i++)
  754.                 {
  755.                 if(giocatore[i] >= 1 || arbitro[i] == 1 || stuart[i] == 1)
  756.                 {
  757.                 SetPlayerSkin(i, skin[i]);
  758.                 giocatore[i] = 0;
  759.                 arbitro[i] = 0;
  760.                 stuart[i] = 0;
  761.                 }
  762.                 }
  763.                 }
  764.                 if(listitem == 11)
  765.                 {
  766.                 new coin = random(2)+1;
  767.                 GetPlayerName(playerid, sendername, sizeof(sendername));
  768.                 new coinname[20];
  769.                 if(coin == 1) { coinname = "Glava"; }
  770.                 else { coinname = "Pismo"; }
  771.                 format(string, sizeof(string), "*** Sudija %s baca novcic i on pada na %s", sendername,coinname);
  772.                 ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  773.                 }
  774.                 }
  775.         if(dialogid == 2)
  776.         {
  777.                 if(listitem == 0)
  778.                 {
  779.                 ShowPlayerDialog(playerid, 6, DIALOG_STYLE_INPUT, "Promeni ime", "Upisite ime prvog tima", "Odaberi", "Izadji");
  780.                 }
  781.                 if(listitem == 1)
  782.                 {
  783.                 ShowPlayerDialog(playerid, 7, DIALOG_STYLE_INPUT, "Dodaj igraca", "Ukucaj id igraca da dodas", "Odaberi", "Izadji");
  784.                 }
  785.         }
  786.         if(dialogid == 3)
  787.         {
  788.                 if(listitem == 0)
  789.                 {
  790.                 ShowPlayerDialog(playerid, 8, DIALOG_STYLE_INPUT, "Promeni ime", "Ukucajte ime drugog tima", "Odaberi", "Izadji");
  791.                 }
  792.                 if(listitem == 1)
  793.                 {
  794.                 ShowPlayerDialog(playerid, 9, DIALOG_STYLE_INPUT, "Dodaj igraca", "Ukucajte id da bi dodali igraca", "Odaberi", "Izadji");
  795.                 }
  796.         }
  797.         if(dialogid == 4)
  798.         {
  799.         if(strlen(inputtext))
  800.                     {
  801.                                 new giveplayerid;
  802.                                 giveplayerid = ReturnUser(inputtext);
  803.                                 if(IsPlayerConnected(giveplayerid))
  804.                                 {
  805.                                     if(giveplayerid != INVALID_PLAYER_ID && giocatore[giveplayerid] >= 1)
  806.                                     {
  807.                                     giocatore[giveplayerid] = 0;
  808.                                     SetPlayerSkin(giveplayerid, skin[giveplayerid]);
  809.                                     GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  810.                                     format(string, sizeof(string), "Izbacen si %s", giveplayer);
  811.                                     SendClientMessage(playerid, COLOR_WHITE, string);
  812.                                     format(string, sizeof(string), "Dobio si crveni karton od sudije %s", sendername);
  813.                                     SendClientMessage(giveplayerid, COLOR_WHITE, string);
  814.                                     }
  815.                                 }
  816.                         }
  817.         }
  818.         if(dialogid == 5)
  819.         {
  820.                 if(listitem == 0)
  821.                 {
  822.                 goal1 ++;
  823.                 format(string, sizeof(string), "[Komentator]: Trenutno rezultat: %s %d - %d %s", squadra1, goal1, goal2, squadra2);
  824.                 ProxDetector(100.0, playerid, string, COLOR_GROVE,COLOR_GROVE,COLOR_GROVE,COLOR_GROVE,COLOR_GROVE);
  825.                 }
  826.                 if(listitem == 1)
  827.                 {
  828.                 goal2 ++;
  829.                 format(string, sizeof(string), "[Komentator]: Trenutno rezultat: %s %d - %d %s", squadra1, goal1, goal2, squadra2);
  830.                 ProxDetector(100.0, playerid, string, COLOR_GROVE,COLOR_GROVE,COLOR_GROVE,COLOR_GROVE,COLOR_GROVE);
  831.                 }
  832.         }
  833.         if(dialogid == 6)
  834.         {
  835.         if(strlen(inputtext))
  836.                     {
  837.                                 format(string, sizeof(string), "%s", inputtext);
  838.                                 strmid(squadra1, string, 0, strlen(string), 255);
  839.                                 format(string, sizeof(string), "Team1 name: %s", squadra1);
  840.                                 SendClientMessage(playerid, COLOR_WHITE, string);
  841.                         }
  842.         }
  843.         if(dialogid == 7)
  844.         {
  845.         if(strlen(inputtext))
  846.                     {
  847.                                 new giveplayerid;
  848.                                 giveplayerid = ReturnUser(inputtext);
  849.                                 if(IsPlayerConnected(giveplayerid))
  850.                                 {
  851.                                     if(giveplayerid != INVALID_PLAYER_ID)
  852.                                     {
  853.                                     giocatore[giveplayerid] = 1;
  854.                                     skin[giveplayerid] = GetPlayerSkin(giveplayerid);
  855.                                     SetPlayerSkin(giveplayerid, 96);
  856.                                     GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  857.                                     format(string, sizeof(string), "%s sada igra za %s", giveplayer, squadra1);
  858.                                     SendClientMessage(playerid, COLOR_WHITE, string);
  859.                                     format(string, sizeof(string), " Sudija  %s te postavio da igras", sendername);
  860.                                     SendClientMessage(giveplayerid, COLOR_WHITE, string);
  861.                                     }
  862.                                 }
  863.                         }
  864.         }
  865.         if(dialogid == 8)
  866.         {
  867.         if(strlen(inputtext))
  868.                     {
  869.                                 format(string, sizeof(string), "%s", inputtext);
  870.                                 strmid(squadra2, string, 0, strlen(string), 255);
  871.                                 format(string, sizeof(string), "Team2 name: %s", squadra2);
  872.                                 SendClientMessage(playerid, COLOR_WHITE, string);
  873.                         }
  874.         }
  875.         if(dialogid == 9)
  876.         {
  877.         if(strlen(inputtext))
  878.                     {
  879.                                 new giveplayerid;
  880.                                 giveplayerid = ReturnUser(inputtext);
  881.                                 if(IsPlayerConnected(giveplayerid))
  882.                                 {
  883.                                     if(giveplayerid != INVALID_PLAYER_ID)
  884.                                     {
  885.                                     giocatore[giveplayerid] = 2;
  886.                                     skin[giveplayerid] = GetPlayerSkin(giveplayerid);
  887.                                     SetPlayerSkin(giveplayerid, 23);
  888.                                     GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  889.                                     format(string, sizeof(string), "%s now plays for %s", giveplayer, squadra2);
  890.                                     SendClientMessage(playerid, COLOR_WHITE, string);
  891.                                     format(string, sizeof(string), " Sudija %s je olvastio igru", sendername);
  892.                                     SendClientMessage(giveplayerid, COLOR_WHITE, string);
  893.                                     }
  894.                                 }
  895.                         }
  896.         }
  897.         if(dialogid == 10)
  898.         {
  899.         if(listitem == 0)
  900.         {
  901.         ShowPlayerDialog(playerid, 11, DIALOG_STYLE_INPUT, "Add Stuart", "Ukucajte id igraca da dodate", "Odaberi", "Izadji");
  902.         }
  903.         if(listitem == 1)
  904.         {
  905.         ShowPlayerDialog(playerid, 12, DIALOG_STYLE_INPUT, "Fire Stuart", "Ukucajte id igraca za vatru", "Odaberi", "Izadji");
  906.         }
  907.         }
  908.         if(dialogid == 11)
  909.         {
  910.         if(strlen(inputtext))
  911.                     {
  912.                                 new giveplayerid;
  913.                                 giveplayerid = ReturnUser(inputtext);
  914.                                 if(IsPlayerConnected(giveplayerid))
  915.                                 {
  916.                                     if(giveplayerid != INVALID_PLAYER_ID)
  917.                                     {
  918.                                     stuart[giveplayerid] = 1;
  919.                                     skin[giveplayerid] = GetPlayerSkin(giveplayerid);
  920.                                     SetPlayerSkin(giveplayerid, 16);
  921.                                     GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  922.                                     format(string, sizeof(string), "%s now is a stuart", giveplayer);
  923.                                     SendClientMessage(playerid, COLOR_WHITE, string);
  924.                                     format(string, sizeof(string), " Referee %s authorized you as a stuart", sendername);
  925.                                     SendClientMessage(giveplayerid, COLOR_WHITE, string);
  926.                                     }
  927.                                 }
  928.                         }
  929.         }
  930.         if(dialogid == 12)
  931.         {
  932.         if(strlen(inputtext))
  933.                     {
  934.                                 new giveplayerid;
  935.                                 giveplayerid = ReturnUser(inputtext);
  936.                                 if(IsPlayerConnected(giveplayerid))
  937.                                 {
  938.                                     if(giveplayerid != INVALID_PLAYER_ID && stuart[giveplayerid] >= 1)
  939.                                     {
  940.                                     stuart[giveplayerid] = 0;
  941.                                     SetPlayerSkin(giveplayerid, skin[giveplayerid]);
  942.                                     GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  943.                                     format(string, sizeof(string), "You fired %s from", giveplayer);
  944.                                     SendClientMessage(playerid, COLOR_WHITE, string);
  945.                                     format(string, sizeof(string), "Referee %s has de-authorized you as stuart", sendername);
  946.                                     SendClientMessage(giveplayerid, COLOR_WHITE, string);
  947.                                     }
  948.                                 }
  949.                         }
  950.         }
  951.         if(dialogid == 13)
  952.         {
  953.         if(listitem == 0)
  954.         {
  955.         format(string, sizeof(string), "Tribina $6\nVIP Loza $5\nNavijaci %s $3\nNavijaci %s $3", squadra1, squadra2);
  956.         ShowPlayerDialog(playerid, 14, DIALOG_STYLE_LIST, "Ulaznice-kupi kartu", string, "Izaberi", "Izadji");
  957.         }
  958.         if(listitem == 1)
  959.         {
  960.         new money = GetPlayerMoney(playerid);
  961.         if(money < 30)
  962.         {
  963.         SendClientMessage(playerid, COLOR_WHITE, "Vi nemate $30!");
  964.         return 1;
  965.         }
  966.         else
  967.         {
  968.         if(fumogeno[playerid] == 1)
  969.         {
  970.         SendClientMessage(playerid, COLOR_WHITE, "Vec ste kupili jedan ne mozete vise za ovaj mec!");
  971.         return 1;
  972.         }
  973.         else
  974.         {
  975.         GivePlayerMoney(playerid, -30);
  976.         SendClientMessage(playerid, COLOR_WHITE, "Kupili ste dimnu bombu za $30!");
  977.         GivePlayerWeapon(playerid, 17, 1);
  978.         fumogeno[playerid] = 1;
  979.         }
  980.         }
  981.         }
  982.         }
  983.         if(dialogid == 14)
  984.         {
  985.         if(listitem == 0)
  986.         {
  987.         new money = GetPlayerMoney(playerid);
  988.         if(money < 6)
  989.         {
  990.         SendClientMessage(playerid, COLOR_WHITE, "Vi nemate $6!");
  991.         return 1;
  992.         }
  993.         else
  994.         {
  995.         GivePlayerMoney(playerid, -6);
  996.         biglietto[playerid] = 1;
  997.         SendClientMessage(playerid, COLOR_WHITE, "Kupili ste kartu i ne mozete da je koristite vise puta!");
  998.         SendClientMessage(playerid, COLOR_LIGHTBLUE, "[UPOZORENJE]: Procicete kroz detektor metala i sve stvari ce vam biti oduzete!");
  999.         }
  1000.         }
  1001.         if(listitem == 1)
  1002.         {
  1003.         new money = GetPlayerMoney(playerid);
  1004.         if(money < 5)
  1005.         {
  1006.         SendClientMessage(playerid, COLOR_WHITE, "Vi nemate $5!");
  1007.         return 1;
  1008.         }
  1009.         else
  1010.         {
  1011.         GivePlayerMoney(playerid, -5);
  1012.         biglietto[playerid] = 2;
  1013.         SendClientMessage(playerid, COLOR_WHITE, "Kupiliste kartu i ne mozete da je koristite vise puta!");
  1014.         SendClientMessage(playerid, COLOR_LIGHTBLUE, "[UPOZORENJE]: Procicete kroz detektor metala i sve stvari ce vam biti oduzete!");
  1015.         }
  1016.         }
  1017.         if(listitem == 2)
  1018.         {
  1019.         new money = GetPlayerMoney(playerid);
  1020.         if(money < 3)
  1021.         {
  1022.         SendClientMessage(playerid, COLOR_WHITE, "Vi nemate $3!");
  1023.         return 1;
  1024.         }
  1025.         else
  1026.         {
  1027.         GivePlayerMoney(playerid, -3);
  1028.         biglietto[playerid] = 3;
  1029.         SendClientMessage(playerid, COLOR_WHITE, "Kupiliste kartu i ne mozete da je koristite vise puta!");
  1030.         SendClientMessage(playerid, COLOR_LIGHTBLUE, "[UPOZORENJE]: Procicete kroz detektor metala i sve stvari ce vam biti oduzete!");
  1031.         }
  1032.         }
  1033.         if(listitem == 3)
  1034.         {
  1035.         new money = GetPlayerMoney(playerid);
  1036.         if(money < 5)
  1037.         {
  1038.         SendClientMessage(playerid, COLOR_WHITE, "Vi Nemate $3!");
  1039.         return 1;
  1040.         }
  1041.         else
  1042.         {
  1043.         GivePlayerMoney(playerid, -3);
  1044.         biglietto[playerid] = 4;
  1045.         SendClientMessage(playerid, COLOR_WHITE, "Kupiliste kartu i ne mozete da je koristite vise puta!");
  1046.         SendClientMessage(playerid, COLOR_LIGHTBLUE, "[UPOZORENJE]: Procicete kroz detektor metala i sve stvari ce vam biti oduzete!");
  1047.         }
  1048.         }
  1049.         }
  1050.         if(dialogid == 15)
  1051.         {
  1052.         if(listitem == 0)
  1053.                         {
  1054.                         SetPlayerPos(playerid, -211.9384,3.9319,7.9039);
  1055.                         SendClientMessage(playerid, COLOR_WHITE, "Idite dole da bi izasli sa stadiona");
  1056.                         GameTextForPlayer(playerid, "~g~Dobro Dosli", 5000, 1);
  1057.                         spettatore[playerid] = 1;
  1058.                         }
  1059.         if(listitem == 1)
  1060.                         {
  1061.                         SetPlayerPos(playerid, -147.5607,-19.1419,8.0165);
  1062.                         SendClientMessage(playerid, COLOR_WHITE, "Idite dole da bi izasli sa stadiona");
  1063.                         GameTextForPlayer(playerid, "~g~Dobro Dosli", 5000, 1);
  1064.                         spettatore[playerid] = 1;               }
  1065.         if(listitem == 2)
  1066.                         {
  1067.                 SetPlayerPos(playerid, -200.3670,-55.6259,9.6309);
  1068.                         SendClientMessage(playerid, COLOR_WHITE, "Idite dole da bi izasli sa stadiona");
  1069.                         GameTextForPlayer(playerid, "~g~Dobro Dosli", 5000, 1);
  1070.                         spettatore[playerid] = 1;               }
  1071.         if(listitem == 3)
  1072.                         {
  1073.                 SetPlayerPos(playerid, -160.0574,40.9410,8.3338);
  1074.                         SendClientMessage(playerid, COLOR_WHITE, "Idite dole da bi izasli sa stadiona");
  1075.                         GameTextForPlayer(playerid, "~g~Dobro Dosli", 5000, 1);
  1076.                         spettatore[playerid] = 1;
  1077.                 }
  1078.         }
  1079.  
  1080.  
  1081.         }//end response
  1082.         return 1;
  1083. }
Advertisement
Add Comment
Please, Sign In to add comment