Advertisement
Guest User

Untitled

a guest
Jul 27th, 2010
1,346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.99 KB | None | 0 0
  1. #include <a_samp>
  2. #define COLOR_LIGHTBLUE 0x33CCFFAA
  3. #define COLOR_YELLOW 0xFFFF00AA
  4. #define COLOR_BLUE 0x2641FEAA
  5. #define COLOR_1GREEN 0x6BD700FF
  6. #define COLOR_WHITE 0xFFFFFFAA
  7. #define COLOR_1BLUE 0x0080FFFF
  8. #define PTP PlayerToPoint
  9. forward CustomPickups();
  10. forward vamaClose(playerid);
  11. forward vama1Close(playerid);
  12. forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
  13. enum pInfo
  14. {
  15. pKey[128],
  16. pPassport,
  17. };
  18. new PlayerInfo[MAX_PLAYERS][pInfo];
  19. new vama;
  20. new vama1;
  21. new pickupvama;
  22. new pickupvama1;
  23. public OnGameModeInit()
  24. {
  25. pickupvama = CreatePickup(1239, 23, 600.9317,-1184.7410,20.7388);
  26. pickupvama1 = CreatePickup(1239, 23, 628.9692,-1188.7152,18.5387);
  27.  
  28. CreateObject(3749, 625.39691162109, -1182.8270263672, 23.350332260132, 0, 0, 30.304809570313);
  29. CreateObject(3749, 605.58813476563, -1192.4547119141, 23.322856903076, 0, 0, 26.226318359375);
  30. CreateObject(1251, 633.84332275391, -1191.6301269531, 17.214059829712, 0, 0, 295.41516113281);
  31. CreateObject(1251, 595.78009033203, -1182.0657958984, 20.57836151123, 0, 0, 298.44250488281);
  32. CreateObject(1251, 600.64013671875, -1179.4423828125, 20.578256607056, 0, 0, 298.19091796875);
  33. CreateObject(1251, 628.77862548828, -1194.052734375, 17.221609115601, 0, 0, 295.41137695313);
  34. CreateObject(3877, 632.08703613281, -1183.1007080078, 19.817638397217, 0, 0, 31.759765625);
  35. CreateObject(3877, 638.46960449219, -1191.9929199219, 19.071990966797, 0, 0, 55.575805664063);
  36. CreateObject(3877, 622.25555419922, -1188.4450683594, 19.840782165527, 0, 0, 27.786010742188);
  37. CreateObject(3877, 626.23864746094, -1198.5509033203, 19.071990966797, 0, 0, 69.469177246094);
  38. CreateObject(3877, 617.78784179688, -1201.5134277344, 19.071990966797, 0, 0, 47.635864257813);
  39. CreateObject(3877, 611.90734863281, -1192.7907714844, 19.952568054199, 0, 0, 27.781311035156);
  40. CreateObject(3877, 605.58874511719, -1206.1070556641, 19.071990966797, 0, 0, 61.523742675781);
  41. CreateObject(3877, 602.46435546875, -1197.4226074219, 19.908348083496, 0, 0, 31.744995117188);
  42. CreateObject(3472, 622.81066894531, -1200.9226074219, 17.40625, 0, 0, 294.22521972656);
  43. CreateObject(9833, 622.28393554688, -1200.8806152344, 14.233810424805, 0, 0, 348);
  44. CreateObject(715, 642.90087890625, -1191.4497070313, 25.738817214966, 0, 0, 342.13513183594);
  45. CreateObject(715, 601.88415527344, -1208.41015625, 25.698572158813, 0, 0, 0);
  46. CreateObject(705, 661.59259033203, -1213.5278320313, 16.449003219604, 0, 0, 0);
  47. CreateObject(669, 621.9755859375, -1198.6732177734, 17.40625, 0, 0, 13.894958496094);
  48. CreateObject(3660, 625.66278076172, -1171.4774169922, 22.183000564575, 0.25, 353.75, 121.03497314453);
  49. CreateObject(3660, 615.08734130859, -1158.0017089844, 24.124618530273, 0.2471923828125, 353.74877929688, 135.94079589844);
  50. CreateObject(3660, 614.35662841797, -1177.5161132813, 22.422786712646, 0.2471923828125, 353.74877929688, 123.77941894531);
  51. CreateObject(3660, 602.18145751953, -1163.2585449219, 24.498796463013, 0.2471923828125, 353.74877929688, 137.67242431641);
  52. CreateObject(3660, 605.02807617188, -1180.7502441406, 22.793039321899, 0.2471923828125, 351.74877929688, 125.54443359375);
  53. CreateObject(3660, 594.56042480469, -1168.9376220703, 24.864562988281, 0.2471923828125, 352.74877929688, 135.46594238281);
  54. CreateObject(3660, 593.62567138672, -1187.4162597656, 22.898826599121, 0.2471923828125, 351.24877929688, 129.49139404297);
  55. CreateObject(3660, 580.80096435547, -1173.4898681641, 25.832664489746, 0.2471923828125, 351.24877929688, 136.16540527344);
  56. CreateObject(1215, 588.16790771484, -1163.3665771484, 25.106649398804, 0, 0, 0);
  57. CreateObject(1294, 623.37347412109, -1170.8477783203, 22.762279510498, 0, 0, 13.894897460938);
  58. CreateObject(1294, 617.38708496094, -1177.6828613281, 23.197828292847, 0, 0, 214.2822265625);
  59. CreateObject(3877, 558.70397949219, -1157.3256835938, 28.377729415894, 0, 0, 67.478454589844);
  60. CreateObject(3877, 562.17388916016, -1146.572265625, 28.589426040649, 0, 0, 63.508056640625);
  61. CreateObject(3877, 572.15643310547, -1164.1782226563, 26.610498428345, 0, 0, 49.611572265625);
  62. CreateObject(3877, 580.95910644531, -1156.5821533203, 26.273616790771, 0, 0, 45.638763427734);
  63. CreateObject(1215, 595.11358642578, -1170.3778076172, 23.851566314697, 0, 0, 0);
  64. CreateObject(1215, 602.19396972656, -1178.3306884766, 21.036600112915, 0, 0, 0);
  65. CreateObject(1215, 593.15588378906, -1183.0465087891, 21.296489715576, 0, 0, 0);
  66. CreateObject(1215, 586.88494873047, -1177.9224853516, 23.837886810303, 0, 0, 0);
  67. CreateObject(1215, 579.375, -1170.6208496094, 25.44997215271, 0, 0, 0);
  68. CreateObject(3877, 581.26165771484, -1130.7436523438, 26.819944381714, 0, 0, 67.47802734375);
  69. CreateObject(3877, 574.80950927734, -1140.1143798828, 26.867233276367, 0, 0, 67.47802734375);
  70. CreateObject(3877, 595.82586669922, -1140.07421875, 25.711242675781, 0, 0, 45.643188476563);
  71. CreateObject(3877, 588.06848144531, -1148.4344482422, 25.758623123169, 0, 0, 45.642700195313);
  72. CreateObject(1294, 605.47338867188, -1184.0454101563, 23.163106918335, 0, 0, 13.892211914063);
  73. CreateObject(1294, 598.26538085938, -1189.2760009766, 23.133031845093, 0, 0, 208.37231445313);
  74. CreateObject(1215, 626.38201904297, -1194.978515625, 17.970573425293, 0, 0, 0);
  75. CreateObject(1215, 636.06402587891, -1190.5051269531, 17.970573425293, 0, 0, 0);
  76. CreateObject(1215, 617.54077148438, -1161.0480957031, 22.867336273193, 0, 0, 0);
  77. CreateObject(1215, 609.90087890625, -1169.1381835938, 22.618650436401, 0, 0, 0);
  78. CreateObject(1215, 610.99615478516, -1154.5511474609, 23.876905441284, 0, 0, 0);
  79. CreateObject(1215, 603.10455322266, -1162.9630126953, 23.60803604126, 0, 0, 0);
  80. CreateObject(1215, 595.66571044922, -1155.9907226563, 24.724115371704, 0, 0, 0);
  81. CreateObject(1215, 606.59753417969, -1149.5048828125, 23.240802764893, 0, 0, 0);
  82. vama = CreateObject(980, 625.47351074219, -1182.7917480469, 20.525373458862, 0, 0, 209.08020019531);
  83. vama1 = CreateObject(980, 604.86401367188, -1191.7984619141, 20.784515380859, 0, 0, 28.615447998047);
  84.  
  85. return 1;
  86. }
  87.  
  88. public OnFilterScriptInit()
  89. {
  90. return 1;
  91. }
  92. public vamaClose()
  93. {
  94. MoveObject(vama, 625.47351074219, -1182.7917480469, 20.525373458862, 3.5);
  95. return 1;
  96. }
  97. public vama1Close()
  98. {
  99. MoveObject(vama1, 604.86401367188, -1191.7984619141, 20.784515380859, 3.5);
  100. return 1;
  101. }
  102. public OnPlayerCommandText(playerid, cmdtext[])
  103. {
  104. //------------------------------------Barrier--------------------------------------
  105. if(strcmp(cmdtext, "/barriera", true) == 0)
  106. {
  107. if(PlayerToPoint(3.0, playerid, 600.9317,-1184.7410,20.7388))
  108. {
  109. if(PlayerInfo[playerid][pPassport] == 1)
  110. {
  111. MoveObject(vama1, 604.86401367188, -1191.7984619141, 25.759492874146, 5.5);
  112. SetTimer("vama1Close", 3000, 0);
  113. SendClientMessage(playerid, COLOR_1GREEN, "Ai platit vamei 100$ pentru a putea trece..Vama se va inchide in 3 secunde");
  114. GivePlayerMoney(playerid,-100);
  115. return 1;
  116. }
  117. else
  118. {
  119. SendClientMessage(playerid, COLOR_WHITE, "* You don't have an Passport, go in the City Hall and buy one.");
  120. return 1;
  121. }
  122. }
  123. else if(PlayerToPoint(5.0, playerid, 628.9692,-1188.7152,18.5387))
  124. {
  125. if(PlayerInfo[playerid][pPassport] == 1)
  126. {
  127. MoveObject(vama, 625.47351074219, -1182.7917480469, 25.80029296875, 5.5);
  128. SetTimer("vamaClose", 3000, 0);
  129. SendClientMessage(playerid, COLOR_1GREEN, "Ai platit vamei 100$ pentru a putea trece..Vama se va inchide in 3 secunde");
  130. GivePlayerMoney(playerid,-100);
  131. return 1;
  132. }
  133. else
  134. {
  135. SendClientMessage(playerid, COLOR_WHITE, "* You don't have an Passport, go in the City Hall and buy one.");
  136. return 1;
  137. }
  138. }
  139. else
  140. {
  141. SendClientMessage(playerid, COLOR_WHITE, "You are not at Barrier.");
  142. return 1;
  143. }
  144. }
  145. return 0;
  146. }
  147. public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
  148. {
  149. if(IsPlayerConnected(playerid))
  150. {
  151. new Float:oldposx, Float:oldposy, Float:oldposz;
  152. new Float:tempposx, Float:tempposy, Float:tempposz;
  153. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  154. tempposx = (oldposx -x);
  155. tempposy = (oldposy -y);
  156. tempposz = (oldposz -z);
  157. //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
  158. if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  159. {
  160. return 1;
  161. }
  162. }
  163. return 0;
  164. }
  165. public OnPlayerConnect(playerid)
  166. {
  167. PlayerInfo[playerid][pPassport] = 1;
  168. return 1;
  169. }
  170. public OnPlayerPickUpPickup(playerid, pickupid)
  171. {
  172. if(pickupid == pickupvama)
  173. {
  174. GameTextForPlayer(playerid,"~w~Scrie ~r~/barriera ~w~pentru a deskide barriera",3000,5);
  175. }
  176. if(pickupid == pickupvama1)
  177. {
  178. GameTextForPlayer(playerid,"~w~Scrie ~r~/barriera ~w~pentru a deskide barriera",3000,5);
  179. }
  180. return 1;
  181. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement