Advertisement
Guest User

Untitled

a guest
Nov 2nd, 2012
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 31.17 KB | None | 0 0
  1. if(PlayerInfo[giveplayerid][pConnectTime] < 1 || PlayerInfo[giveplayerid][pWRestricted] > 0 || PlayerInfo[giveplayerid][pDonateRank] > 2) return GiftPlayer(playerid, giveplayerid);
  2. #define GivePlayerValidWeapon
  3. GivePlayerValidWeapon(giveplayerid, 27, 60000);
  4. GivePlayerValidWeapon(giveplayerid, 24, 60000);
  5. GivePlayerValidWeapon(giveplayerid, 31, 60000);
  6. GivePlayerValidWeapon(giveplayerid, 34, 60000);
  7. #define GetPlayerNameEx
  8. GivePlayerValidWeapon(giveplayerid, 29, 60000);
  9. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won a full weapon set!");
  10. format(string, sizeof(string), "* %s was just gifted a full weapon set, enjoy!", GetPlayerNameEx(giveplayerid));
  11. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  12. }
  13. else if(gift == 2)
  14. {
  15. #define GetPlayerNameEx
  16. if(PlayerInfo[giveplayerid][pDonateRank] > 2) return GiftPlayer(playerid, giveplayerid);
  17. PlayerInfo[giveplayerid][pFirstaid]++;
  18. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won a first aid kit!");
  19. format(string, sizeof(string), "* %s was just gifted a first aid kit, enjoy!", GetPlayerNameEx(giveplayerid));
  20. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  21. }
  22. #define GetPlayerNameEx
  23. else if(gift == 3)
  24. {
  25. PlayerInfo[giveplayerid][pMats] += 2000;
  26. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 2,000 materials!");
  27. format(string, sizeof(string), "* %s was just gifted 2,000 materials, enjoy!", GetPlayerNameEx(giveplayerid));
  28. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  29. }
  30. else if(gift == 4)
  31. {
  32. if(PlayerInfo[giveplayerid][pWarns] != 0)
  33. {
  34. PlayerInfo[giveplayerid][pWarns]--;
  35. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won a single warning removal!");
  36. format(string, sizeof(string), "* %s was just gifted a single warning removal, enjoy!", GetPlayerNameEx(giveplayerid));
  37. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  38. }
  39. else
  40. {
  41. SendClientMessageEx(giveplayerid, COLOR_GRAD2, "Random gift ended up in a removal of one warning - let's try again!");
  42. GiftPlayer(playerid, giveplayerid);
  43. return 1;
  44. }
  45. }
  46. else if(gift == 5)
  47. {
  48. PlayerInfo[giveplayerid][pPot] += 50;
  49. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 50 grams of pot!");
  50. format(string, sizeof(string), "* %s was just gifted 50 grams of pot, enjoy!", GetPlayerNameEx(giveplayerid));
  51. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  52. }
  53. else if(gift == 6)
  54. {
  55. PlayerInfo[giveplayerid][pCrack] += 25;
  56. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 25 grams of crack!");
  57. format(string, sizeof(string), "* %s was just gifted 25 grams of crack, enjoy!", GetPlayerNameEx(giveplayerid));
  58. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  59. }
  60. else if(gift == 7)
  61. {
  62. GivePlayerCash(giveplayerid, 20000);
  63. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won $20,000!");
  64. format(string, sizeof(string), "* %s was just gifted $20,000, enjoy!", GetPlayerNameEx(giveplayerid));
  65. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  66. }
  67. else if(gift == 8)
  68. {
  69. PlayerInfo[giveplayerid][pPaintTokens] += 10;
  70. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 10 paintball tokens!");
  71. format(string, sizeof(string), "* %s was just gifted 10 paintball tokens, enjoy!", GetPlayerNameEx(giveplayerid));
  72. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  73. }
  74. else if(gift == 9)
  75. {
  76. if(PlayerInfo[giveplayerid][pDonateRank] < 1) return GiftPlayer(playerid, giveplayerid);
  77. PlayerInfo[giveplayerid][pTokens] += 5;
  78. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 5 VIP tokens!");
  79. format(string, sizeof(string), "* %s was just gifted 5 VIP tokens, enjoy!", GetPlayerNameEx(giveplayerid));
  80. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  81. }
  82. else if(gift == 10)
  83. {
  84. PlayerInfo[giveplayerid][pFirework] += 2;
  85. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 2 Fireworks!");
  86. format(string, sizeof(string), "* %s was just gifted 2 Fireworks, enjoy!", GetPlayerNameEx(giveplayerid));
  87. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  88. }
  89. else if(gift == 11)
  90. {
  91. PlayerInfo[giveplayerid][pExp] += 5;
  92. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 5 Respect Points!");
  93. format(string, sizeof(string), "* %s was just gifted 5 Respect Points, enjoy!", GetPlayerNameEx(giveplayerid));
  94. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  95. }
  96. }
  97. else if(randgift > 83 && randgift <= 98)
  98. {
  99. new gift = Random(1, 9);
  100. if(gift == 1)
  101. {
  102. GivePlayerCash(giveplayerid, 150000);
  103. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won $150,000!");
  104. format(string, sizeof(string), "* %s was just gifted $150,000, enjoy!", GetPlayerNameEx(giveplayerid));
  105. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  106. }
  107. else if(gift == 2)
  108. {
  109. PlayerInfo[giveplayerid][pMats] += 15000;
  110. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 15,000 materials!");
  111. format(string, sizeof(string), "* %s was just gifted 15,000 materials, enjoy!", GetPlayerNameEx(giveplayerid));
  112. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  113. }
  114. else if(gift == 3)
  115. {
  116. PlayerInfo[giveplayerid][pExp] += 10;
  117. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 10 respect points!");
  118. format(string, sizeof(string), "* %s was just gifted 10 respect points, enjoy!", GetPlayerNameEx(giveplayerid));
  119. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  120. }
  121. else if(gift == 4)
  122. {
  123. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won a free car!");
  124. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Note: This rare reward may take up to 48 hours to be rewarded, contact Shop Techs.");
  125. format(PlayerInfo[giveplayerid][pFlag], 128, "Free Car (Gift)");
  126. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has just gifted %s and he won a free car.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  127. ABroadCast(COLOR_YELLOW, string, 4);
  128. if(playerid != MAX_PLAYERS)
  129. {
  130. new year,month,day,log[128];
  131. getdate(year, month, day);
  132. format(log, sizeof(log), "AdmCmd: %s has just gifted %s and he won a free car(%d-%d-%d)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), month, day, year);
  133. Log("logs/gifts.log", log);
  134. } else {
  135. new year,month,day,log[128];
  136. getdate(year, month, day);
  137. format(log, sizeof(log), "AdmCmd: %s was just gifted by the system and he won a free car(%d-%d-%d)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), month, day, year);
  138. Log("logs/gifts.log", log);
  139. }
  140. format(string, sizeof(string), "* %s was just gifted a free car, enjoy!", GetPlayerNameEx(giveplayerid));
  141. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  142. }
  143. else if(gift == 5)
  144. {
  145. if(PlayerInfo[giveplayerid][pDonateRank] > 0)
  146. {
  147. PlayerInfo[giveplayerid][pTokens] += 15;
  148. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 15 VIP tokens!");
  149. format(string, sizeof(string), "* %s was just gifted 15 VIP tokens, enjoy!", GetPlayerNameEx(giveplayerid));
  150. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  151. }
  152. else
  153. {
  154. PlayerInfo[giveplayerid][pDonateRank] = 1;
  155. PlayerInfo[giveplayerid][pTempVIP] = 10800;
  156. PlayerInfo[giveplayerid][pBuddyInvited] = 1;
  157. format(string, sizeof(string), "You have been invited to become a Level 1 VIP for 3 hours. Enjoy!", GetPlayerNameEx(giveplayerid));
  158. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  159. format(string, sizeof(string), "BUDDY INVITE: %s has won a buddyinvite.", GetPlayerNameEx(giveplayerid));
  160. Log("logs/setvip.log", string);
  161. format(string, sizeof(string), "* %s was just gifted 3 hours of VIP, enjoy!", GetPlayerNameEx(giveplayerid));
  162. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  163. }
  164. }
  165. else if(gift == 6)
  166. {
  167. PlayerToyInfo[giveplayerid][4][ptModelID] = 18643;
  168. PlayerToyInfo[giveplayerid][4][ptBone] = 6;
  169. PlayerToyInfo[giveplayerid][4][ptPosX] = 0.0;
  170. PlayerToyInfo[giveplayerid][4][ptPosY] = 0.0;
  171. PlayerToyInfo[giveplayerid][4][ptPosZ] = 0.0;
  172. PlayerToyInfo[giveplayerid][4][ptRotX] = 0.0;
  173. PlayerToyInfo[giveplayerid][4][ptRotY] = 0.0;
  174. PlayerToyInfo[giveplayerid][4][ptRotZ] = 0.0;
  175. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won a Free Laser Pointer!");
  176. format(string, sizeof(string), "* %s was just gifted a Free Laser Pointer, enjoy!", GetPlayerNameEx(giveplayerid));
  177. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  178. }
  179. else if(gift == 7)
  180. {
  181. if(PlayerInfo[giveplayerid][pADMuteTotal] < 1) return GiftPlayer(playerid, giveplayerid);
  182. PlayerInfo[giveplayerid][pADMuteTotal] = 0;
  183. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won a Free Admute Reset!");
  184. format(string, sizeof(string), "* %s was just gifted a Free Admute Reset, enjoy!", GetPlayerNameEx(giveplayerid));
  185. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  186. }
  187. else if(gift == 8)
  188. {
  189. if(PlayerInfo[giveplayerid][pNMuteTotal] < 1) return GiftPlayer(playerid, giveplayerid);
  190. PlayerInfo[giveplayerid][pNMuteTotal] = 0;
  191. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won a Free Nmute Reset!");
  192. format(string, sizeof(string), "* %s was just gifted a Free Nmute Reset, enjoy!", GetPlayerNameEx(giveplayerid));
  193. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  194. }
  195. }
  196. else if(randgift > 98 && randgift <= 100)
  197. {
  198. new gift = Random(1, 6);
  199. if(gift == 1 && PlayerInfo[giveplayerid][pDonateRank] <= 2) // Silver VIP can get it extended, I suppose
  200. {
  201. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won one month of Silver VIP!");
  202. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Note: This rare reward may take up to 48 hours to be rewarded.");
  203. format(PlayerInfo[giveplayerid][pFlag], 128, "Free Silver VIP (Gift)");
  204. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has just gifted %s and he won one month of Silver VIP.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  205. ABroadCast(COLOR_YELLOW, string, 2);
  206. new year,month,day,log[128];
  207. getdate(year, month, day);
  208. format(log, sizeof(log), "AdmCmd: %s has just gifted %s and he won one month of Silver VIP(%d-%d-%d)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), month, day, year);
  209. Log("logs/gifts.log", log);
  210. format(string, sizeof(string), "* %s was just gifted one month of Silver VIP, enjoy!", GetPlayerNameEx(giveplayerid));
  211. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  212. }
  213. else if(gift == 2)
  214. {
  215. if(playerid != MAX_PLAYERS)
  216. {
  217. new year,month,day,log[128];
  218. getdate(year, month, day);
  219. format(log, sizeof(log), "AdmCmd: %s has just gifted %s and he won a free house(%d-%d-%d)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), month, day, year);
  220. Log("logs/gifts.log", log);
  221. } else {
  222. new year,month,day,log[128];
  223. getdate(year, month, day);
  224. format(log, sizeof(log), "AdmCmd: %s was just gifted by the system and he won a free house(%d-%d-%d)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), month, day, year);
  225. Log("logs/gifts.log", log);
  226. }
  227. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won a free house!");
  228. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Note: This rare reward may take up to 48 hours to be rewarded.");
  229. format(PlayerInfo[giveplayerid][pFlag], 128, "Free House (Gift)");
  230. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has just gifted %s and he won a free house.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  231. ABroadCast(COLOR_YELLOW, string, 2);
  232. format(string, sizeof(string), "* %s was just gifted a free house, enjoy!", GetPlayerNameEx(giveplayerid));
  233. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  234. }
  235. else if(gift == 3)
  236. {
  237. if(PlayerInfo[giveplayerid][pDonateRank] < 1) return GiftPlayer(playerid, giveplayerid);
  238. PlayerInfo[giveplayerid][pTokens] += 50;
  239. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 50 VIP tokens!");
  240. format(string, sizeof(string), "* %s was just gifted 50 VIP tokens, enjoy!", GetPlayerNameEx(giveplayerid));
  241. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  242. }
  243. else if(gift == 4)
  244. {
  245. new year,month,day,log[128];
  246. getdate(year, month, day);
  247. format(log, sizeof(log), "AdmCmd: %s has just gifted %s and he won $500,000. (%d-%d-%d)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), month, day, year);
  248. Log("logs/gifts.log", log);
  249. GivePlayerCash(giveplayerid, 500000);
  250. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won $500,000!");
  251. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has just gifted %s and he won $500,000.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  252. ABroadCast(COLOR_YELLOW, string, 2);
  253. format(string, sizeof(string), "* %s was just gifted $500,000, enjoy!", GetPlayerNameEx(giveplayerid));
  254. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  255. }
  256. else if(gift == 5)
  257. {
  258. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won one month of Gold VIP!");
  259. SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Note: This rare reward may take up to 48 hours to be rewarded.");
  260. format(PlayerInfo[giveplayerid][pFlag], 128, "Free Gold VIP (Gift)");
  261. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has just gifted %s and he won one month of Gold VIP.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  262. ABroadCast(COLOR_YELLOW, string, 2);
  263. new year,month,day,log[128];
  264. getdate(year, month, day);
  265. format(log, sizeof(log), "AdmCmd: %s has just gifted %s and he won one month of Gold VIP(%d-%d-%d)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), month, day, year);
  266. Log("logs/gifts.log", log);
  267. format(string, sizeof(string), "* %s was just gifted one month of Gold VIP, enjoy!", GetPlayerNameEx(giveplayerid));
  268. ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  269. }
  270. }
  271. PlayerInfo[giveplayerid][pGiftTime] = 300;
  272. }
  273. return 1;
  274. }
  275.  
  276. WeedLogin(playerid)
  277. {
  278. if(PlayerInfo[playerid][pWExists])
  279. {
  280. PlayerInfo[playerid][pWObject] = CreateDynamicObject(3409, PlayerInfo[playerid][pWX], PlayerInfo[playerid][pWY], PlayerInfo[playerid][pWZ], 0.0, 0.0, 0.0, PlayerInfo[playerid][pWVW], PlayerInfo[playerid][pWInt]);
  281. PlayerInfo[playerid][pWTimer] = SetTimerEx("WeedGrowth", 60000, 1, "i", playerid);
  282. return 1;
  283. }
  284. return 1;
  285. }
  286.  
  287. WeedLogout(WeedID)
  288. {
  289. if(PlayerInfo[WeedID][pWExists])
  290. {
  291. KillTimer(PlayerInfo[WeedID][pWTimer]);
  292. DestroyDynamicObject(PlayerInfo[WeedID][pWObject]);
  293. return 1;
  294. }
  295. return 1;
  296. }
  297.  
  298. ClearWeed(WeedID)
  299. {
  300. KillTimer(PlayerInfo[WeedID][pWTimer]);
  301. DestroyDynamicObject(PlayerInfo[WeedID][pWObject]);
  302. //Delete3DTextLabel(PlayerInfo[WeedID][pW3DText]);
  303. PlayerInfo[WeedID][pWX] = 0.0;
  304. PlayerInfo[WeedID][pWY] = 0.0;
  305. PlayerInfo[WeedID][pWZ] = 0.0;
  306. PlayerInfo[WeedID][pWValue] = 0;
  307. PlayerInfo[WeedID][pWExists] = 0;
  308. return 1;
  309. }
  310.  
  311. Float:GetDistance( Float: x1, Float: y1, Float: z1, Float: x2, Float: y2, Float: z2 )
  312. {
  313. new Float:d;
  314. d += floatpower(x1-x2, 2.0 );
  315. d += floatpower(y1-y2, 2.0 );
  316. d += floatpower(z1-z2, 2.0 );
  317. d = floatsqroot(d);
  318. return d;
  319. }
  320.  
  321. SurfingCheck(vehicleid)
  322. {
  323. foreach(Player, p)
  324. {
  325. if(GetPlayerSurfingVehicleID(p) == vehicleid)
  326. {
  327. new Float:x, Float:y, Float:z;
  328. GetPlayerPos(p, x, y, z);
  329. SetPVarFloat(p, "tempPosX", x);
  330. SetPVarFloat(p, "tempPosY", x);
  331. SetPVarFloat(p, "tempPosZ", x);
  332.  
  333. SetTimerEx("SurfingFix", 2000, 0, "i", p);
  334. }
  335. }
  336. }
  337.  
  338. forward SurfingFix(playerid);
  339. public SurfingFix(playerid)
  340. {
  341. SetPlayerPos(playerid, GetPVarFloat(playerid, "tmpPosX"), GetPVarFloat(playerid, "tmpPosY"), GetPVarFloat(playerid, "tmpPosZ"));
  342. DeletePVar(playerid, "tmpPosX");
  343. DeletePVar(playerid, "tmpPosY");
  344. DeletePVar(playerid, "tmpPosZ");
  345.  
  346. return 1;
  347. }
  348.  
  349. forward IsAtTruckDeliveryPoint(playerid);
  350. IsAtTruckDeliveryPoint(playerid)
  351. {
  352. if(IsPlayerInRangeOfPoint(playerid, 6, 920.421142, -1361.637084, 13.003659) || IsPlayerInRangeOfPoint(playerid, 6, 1197.744384, -886.373901, 42.819854) ||
  353. IsPlayerInRangeOfPoint(playerid, 6, 2111.115722, -1783.749877, 13.188007) || IsPlayerInRangeOfPoint(playerid, 6, 2236.051757, -1690.114990, 13.744861) ||
  354. IsPlayerInRangeOfPoint(playerid, 6, 454.168640, -1501.456909, 30.757781) || IsPlayerInRangeOfPoint(playerid, 6, 2111.877929, -1218.093139, 23.604995) ||
  355. IsPlayerInRangeOfPoint(playerid, 6, 2197.721923, -1975.567260, 13.359717) || IsPlayerInRangeOfPoint(playerid, 6, 1339.484497, -1763.289916, 13.332603) ||
  356. IsPlayerInRangeOfPoint(playerid, 6, 1003.885925, -906.400634, 41.986915) || IsPlayerInRangeOfPoint(playerid, 6, 1837.636108, -1832.414062, 13.385854) ||
  357. IsPlayerInRangeOfPoint(playerid, 6, 2781.596435, -2494.261230, 13.457942) || IsPlayerInRangeOfPoint(playerid, 6, 2443.682373, -1426.901489, 23.796508) ||
  358. IsPlayerInRangeOfPoint(playerid, 6, 2166.486083, -2273.158935, 13.166786))
  359. { return true; }
  360. return false;
  361. }
  362.  
  363. forward CancelTruckDelivery(playerid);
  364. CancelTruckDelivery(playerid)
  365. {
  366. new vehicleid = GetPlayerVehicleID(playerid);
  367. if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  368. {
  369. if(IsATruckerCar(vehicleid)) SetVehicleToRespawn(vehicleid);
  370. }
  371. DestroyProgressBar(LoadTruckBar[playerid]);
  372. LoadTruckBar[playerid] = INVALID_BAR_ID;
  373. LoadTruckTime[playerid] = 0;
  374. DeletePVar(playerid, "TruckDeliver");
  375. TruckContents[TruckUsed[playerid]] = 0;
  376. TruckUsed[playerid] = INVALID_VEHICLE_ID;
  377. gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
  378. DisablePlayerCheckpoint(playerid);
  379. return 1;
  380. }
  381.  
  382. InvalidModCheck(model, partid) {
  383. switch(model) {
  384. case 430, 446, 452, 453, 454, 472, 473, 484, 493, 595, 573, 556, 557, 539, 471, 432, 406, 444,
  385. 448, 461, 462, 463, 468, 481, 509, 510, 521, 522, 581, 586, 417, 425, 447, 460, 469, 476, 487,
  386. 488, 511, 512, 513, 519, 520, 548, 553, 563, 577, 592, 593: return 0;
  387. default: switch(GetVehicleComponentType(partid)) {
  388. case 5: switch(partid) {
  389. case 1008, 1009, 1010: return 1;
  390. default: return 0;
  391. }
  392. case 7: switch(partid) {
  393. case 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1096, 1097, 1098, 1025: return 1;
  394. default: return 0;
  395. }
  396. case 8: switch(partid) {
  397. case 1086: return 1;
  398. default: return 0;
  399. }
  400. case 9: switch(partid) {
  401. case 1087: return 1;
  402. default: return 0;
  403. }
  404. default: for(new i; i < 4; i++) if(partid == vehicleMods[model - 400][GetVehicleComponentType(partid)][i]) {
  405. return 1;
  406. }
  407. }
  408. }
  409. return 0;
  410. }
  411.  
  412. JudgeOnlineCheck()
  413. {
  414. new count;
  415. foreach(Player, i)
  416. {
  417. if(PlayerInfo[i][pMember] == 5 || PlayerInfo[i][pLeader] == 5)
  418. {
  419. count++;
  420. }
  421. }
  422. return count;
  423. }
  424.  
  425. stock StopRefueling(playerid)
  426. {
  427. GivePlayerCash(playerid, -RefuelingVehiclePrice[playerid]);
  428. SendFormattedMessage(playerid, COLOR_WHITE,"Your vehicle's tank has been refilled for $%d.", RefuelingVehiclePrice[playerid]);
  429.  
  430. new mypoint = -1;
  431. for (new i=0; i<MAX_POINTS; i++)
  432. {
  433. if(strcmp(Points[i][Name], "Fossil Fuel Company", true) == 0)
  434. {
  435. mypoint = i;
  436. }
  437. }
  438. for(new i = 0; i < sizeof(FamilyInfo); i++)
  439. {
  440. if(strcmp(Points[mypoint][Owner], FamilyInfo[i][FamilyName], true) == 0)
  441. {
  442. FamilyInfo[i][FamilyBank] = FamilyInfo[i][FamilyBank]+(RefuelingVehiclePrice[playerid]/10);
  443. }
  444. }
  445.  
  446. RefuelingVehicle[playerid] = 0; RefuelingVehiclePrice[playerid] = 0; KillTimer(RefuelingVehicleTimer[playerid]);
  447. return true;
  448. }
  449.  
  450. IsAtFuelStation(playerid)
  451. {
  452. new Float:X, Float:Y, Float:Z;
  453. GetObjectPos(Carrier[0], X, Y, Z);
  454. if(IsPlayerInRangeOfPoint(playerid,10,1595.5406, 2198.0520, 10.3863) || IsPlayerInRangeOfPoint(playerid,10,2202.0649, 2472.6697, 10.5677) ||
  455. IsPlayerInRangeOfPoint(playerid,10,2115.1929, 919.9908, 10.5266) || IsPlayerInRangeOfPoint(playerid,10,2640.7209, 1105.9565, 10.5274) ||
  456. IsPlayerInRangeOfPoint(playerid,10,608.5971, 1699.6238, 6.9922) || IsPlayerInRangeOfPoint(playerid,10,618.4878, 1684.5792, 6.9922) ||
  457. IsPlayerInRangeOfPoint(playerid,10,2146.3467, 2748.2893, 10.5245) || IsPlayerInRangeOfPoint(playerid,10,-1679.4595, 412.5129, 6.9973) ||
  458. IsPlayerInRangeOfPoint(playerid,10,-1327.5607, 2677.4316, 49.8093) || IsPlayerInRangeOfPoint(playerid,10,-1470.0050, 1863.2375, 32.3521) ||
  459. IsPlayerInRangeOfPoint(playerid,10,-2409.2200, 976.2798, 45.2969) || IsPlayerInRangeOfPoint(playerid,10,-2244.1396, -2560.5833, 31.9219) ||
  460. IsPlayerInRangeOfPoint(playerid,10,-1606.0544, -2714.3083, 48.5335) || IsPlayerInRangeOfPoint(playerid,10,1937.4293, -1773.1865, 13.3828) ||
  461. IsPlayerInRangeOfPoint(playerid,10,-91.3854, -1169.9175, 2.4213) || IsPlayerInRangeOfPoint(playerid,10,1383.4221, 462.5385, 20.1506) ||
  462. IsPlayerInRangeOfPoint(playerid,10,660.4590, -565.0394, 16.3359) || IsPlayerInRangeOfPoint(playerid,10,1381.7206, 459.1907, 20.3452) ||
  463. IsPlayerInRangeOfPoint(playerid,10,-1605.7156, -2714.4573, 48.5335) || IsPlayerInRangeOfPoint(playerid,20,1882.2546,-2393.9824,16.5144) ||
  464. IsPlayerInRangeOfPoint(playerid,10,1386.5360,-271.5511,-0.4857) || IsPlayerInRangeOfPoint(playerid,10,2017.3016,-229.9219,-0.2183) ||
  465. IsPlayerInRangeOfPoint(playerid,10,279.1325,1940.4025,17.6406) || IsPlayerInRangeOfPoint(playerid,250,X, Y, Z))
  466. { return true; }
  467. return false;
  468. }
  469.  
  470. forward ReFill(playerid);
  471. public ReFill(playerid)
  472. {
  473. if(!IsAtFuelStation(playerid) || !IsPlayerInAnyVehicle(playerid) || VehicleFuel[GetPlayerVehicleID(playerid)] >= 100.0 || GetPlayerCash(playerid) < 1)
  474. {
  475. StopRefueling(playerid);
  476. }
  477. else
  478. {
  479. new engine,lights,alarm,doors,bonnet,boot,objective;
  480. GetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,objective);
  481. if(engine == VEHICLE_PARAMS_ON) return StopRefueling(playerid);
  482. VehicleFuel[GetPlayerVehicleID(playerid)] += 1.0; RefuelingVehiclePrice[playerid] += 30;
  483. if(VehicleFuel[GetPlayerVehicleID(playerid)] >= 100.0) VehicleFuel[GetPlayerVehicleID(playerid)] = 100.0;
  484. }
  485. return true;
  486. }
  487.  
  488. public Audio_OnClientConnect(playerid)
  489. {
  490. new string[128];
  491. format(string,sizeof(string),"(Audio Plugin) %s(%d) has connected to the audio server.",GetPlayerNameEx(playerid),playerid);
  492. SendClientMessageEx(playerid, 0xA9C4E4FF, string);
  493. SendClientMessageEx(playerid, 0xA9C4E4FF, "(Audio Plugin) Checking and downloading audio files, Please wait...");
  494. Audio_TransferPack(playerid);
  495. return 1;
  496. }
  497.  
  498. public Audio_OnPlay(playerid, handleid)
  499. {
  500. //new string[128];
  501. //format(string, sizeof(string), "(Audio Plugin) Debug: Audio playback started for handle ID %d.", handleid);
  502. //SendClientMessage(playerid, 0xA9C4E4FF, string);
  503. }
  504.  
  505. public Audio_OnStop(playerid, handleid)
  506. {
  507. //new string[128];
  508. //format(string, sizeof(string), "(Audio Plugin) Debug: Audio playback stopped for handle ID %d.", handleid);
  509. //SendClientMessage(playerid, 0xA9C4E4FF, string);
  510. }
  511.  
  512. public Audio_OnTransferFile(playerid, file[], current, total, result)
  513. {
  514. if (current == total)
  515. {
  516. SendClientMessageEx(playerid, 0xA9C4E4FF, "(Audio Plugin) All audio files have been downloaded and processed, Thank you!");
  517. SendAudioToPlayer(playerid, 1183, 100, 0);
  518. }
  519. return 1;
  520. }
  521.  
  522. public Audio_OnSetPack(audiopack[])
  523. {
  524. foreach(Player, i)
  525. {
  526. Audio_TransferPack(i);
  527. }
  528. return 1;
  529. }
  530.  
  531. public Audio_OnClientDisconnect(playerid)
  532. {
  533. new string[128];
  534. format(string,sizeof(string),"(Audio Plugin) %s(%d) has disconnected from the audio server.",GetPlayerNameEx(playerid),playerid);
  535. SendClientMessageEx(playerid, 0xA9C4E4FF, string);
  536. return 1;
  537. }
  538.  
  539. public Audio_OnTrackChange(playerid, handleid, track[])
  540. {
  541. new string[128];
  542. //format(string, sizeof(string), "(Audio Plugin) Debug: Now playing \"%s\" for handle ID %d.", track, handleid);
  543. //SendClientMessage(playerid, 0xA9C4E4FF, string);
  544. format(string, sizeof(string), "* Now Playing: %s.",track);
  545. SendClientMessageEx(playerid, COLOR_PURPLE, string);
  546. return 1;
  547. }
  548.  
  549. SendBlankAudioTick(playerid)
  550. {
  551. if(IsPlayerConnected(playerid))
  552. {
  553. if(Audio_IsClientConnected(playerid))
  554. {
  555. new handleid = Audio_Play(playerid, 1, false, false, false);
  556. Audio_SetVolume(playerid, handleid, 0);
  557. }
  558. else
  559. {
  560. return 0;
  561. }
  562. }
  563. return 1;
  564. }
  565.  
  566. forward SendAudioToPlayer(playerid, audioid, volume, seek);
  567. public SendAudioToPlayer(playerid, audioid, volume, seek)
  568. {
  569. if(IsPlayerConnected(playerid))
  570. {
  571. if(Audio_IsClientConnected(playerid))
  572. {
  573. new localhandle = Audio_Play(playerid,audioid,false,false,false);
  574. Audio_SetVolume(playerid, localhandle, volume);
  575. Audio_Seek(playerid, localhandle, seek);
  576. }
  577. else
  578. {
  579. return 0;
  580. }
  581. }
  582. return 1;
  583. }
  584.  
  585. SendAudioToRange(audioid, volume, seek, Float:x, Float:y, Float:z, Float:range)
  586. {
  587. if(audiohandleglobal >= 99)
  588. {
  589. audiohandleglobal = 0;
  590. }
  591. forward Audio_OnSetPack(audiopack[]);
  592. public Audio_OnSetPack(audiopack[])
  593. {
  594. foreach(Player, i)
  595. {
  596. Audio_TransferPack(i);
  597. }
  598. return 1;
  599. }
  600.  
  601. SendAudioToRange(audioid, volume, seek, Float:x, Float:y, Float:z, Float:range)
  602. {
  603. #pragma unused seek
  604. if(audiohandleglobal >= 99)
  605. {
  606. audiohandleglobal = 0;
  607. }
  608. else
  609. {
  610. audiohandleglobal++;
  611. }
  612.  
  613. foreach(Player, i)
  614. {
  615. if(IsPlayerConnected(i))
  616. {
  617. if(Audio_IsClientConnected(i))
  618. {
  619. if(IsPlayerInRangeOfPoint(i,range,x,y,z))
  620. {
  621. new localhandle = Audio_Play(i,audioid,false,false,false);
  622. Audio_Set3DPosition(i, localhandle, x, y, z, range);
  623. Audio_SetVolume(i, localhandle, volume);
  624. //Audio_SetPosition(i, localhandle, seek);
  625. audiohandle[i][audiohandleglobal] = localhandle;
  626. }
  627. }
  628. }
  629. }
  630. return audiohandleglobal;
  631. }
  632.  
  633. stock SendAudioURLToRange(url[], volume, seek, Float:x, Float:y, Float:z, Float:range)
  634. {
  635. #pragma unused seek
  636. if(audiohandleglobal >= 99)
  637. {
  638. audiohandleglobal = 0;
  639. }
  640. else
  641. {
  642. audiohandleglobal++;
  643. }
  644. foreach(Player, i)
  645. {
  646. if(IsPlayerConnected(i))
  647. {
  648. if(Audio_IsClientConnected(i))
  649. {
  650. if(IsPlayerInRangeOfPoint(i,range,x,y,z))
  651. {
  652. new localhandle = Audio_PlayStreamed(i,url,false,false,false);
  653. Audio_Set3DPosition(i, localhandle, x, y, z, range);
  654. Audio_SetVolume(i, localhandle, volume);
  655. //Audio_SetPosition(i, localhandle, seek);
  656. audiohandle[i][audiohandleglobal] = localhandle;
  657. }
  658. }
  659. }
  660. }
  661. return audiohandleglobal;
  662. }
  663.  
  664. if(PlayerInfo[playerid][pCarLic] == 0) return SendClientMessageEx(playerid, COLOR_RED, "You're driving without a drivers license. Obtain one from City Hall!");
  665.  
  666. new rand = random(2); //DELETE THIS LINE!!
  667.  
  668. if(PlayerInfo[playerid][pModel] == 299) {
  669.  
  670. new IsAtNameChange; //DELETE THIS LINE!!
  671.  
  672. forward SetVehicleEngine(vehicleid, playerid);
  673. public SetVehicleEngine(vehicleid, playerid)
  674. {
  675. new string[128];
  676. new engine,lights,alarm,doors,bonnet,boot,objective;
  677. GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
  678. if(engine == VEHICLE_PARAMS_ON)
  679. {
  680. SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
  681. SendClientMessageEx(playerid, COLOR_WHITE, "Vehicle engine stopped successfully.");
  682. DeletePVar(playerid, "fuelonoff");
  683. DestroyProgressBar(FuelBar[playerid]);
  684. textdrawscount--;
  685. FuelBar[playerid] = INVALID_BAR_ID;
  686. arr_Engine{vehicleid} = 0;
  687. }
  688. else if(engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET)
  689. {
  690. new
  691. Float: f_vHealth;
  692.  
  693. GetVehicleHealth(vehicleid, f_vHealth);
  694. if(f_vHealth < 350.0) return SendClientMessageEx(playerid, COLOR_RED, "The car won't start - it's totalled!");
  695. if(VehicleFuel[vehicleid] <= 0.0) return SendClientMessageEx(playerid, COLOR_RED, "The car won't start - there's no fuel in the tank!");
  696. SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
  697. SendClientMessageEx(playerid, COLOR_WHITE, "Vehicle engine started successfully (/car engine to turn the engine off).");
  698. if(PlayerInfo[playerid][pCarLic] = 0) return SendClientMessageEx(playerid, COLOR_RED, "You're driving without a drivers license. Obtain one from City Hall!");
  699. arr_Engine{vehicleid} = 1;
  700. if(GetChased[playerid] < 999 && VehicleBomb[vehicleid] == 1)
  701. {
  702. if(PlayerInfo[playerid][pHeadValue] >= 1)
  703. {
  704. if(PlayerInfo[GetChased[playerid]][pMember] == 8 || PlayerInfo[GetChased[playerid]][pLeader] == 8)
  705. {
  706. new Float:boomx, Float:boomy, Float:boomz;
  707. GetPlayerPos(playerid,boomx, boomy, boomz);
  708. CreateExplosion(boomx, boomy , boomz, 7, 1);
  709. VehicleBomb[vehicleid] = 0;
  710. PlacedVehicleBomb[GetChased[playerid]] = INVALID_VEHICLE_ID;
  711. new takemoney = PlayerInfo[playerid][pHeadValue] / 4 * 2;
  712. GivePlayerCash(GetChased[playerid], takemoney);
  713. GivePlayerCash(playerid, -takemoney);
  714. format(string,sizeof(string),"Hitman %s has fulfilled the contract on %s and collected $%d.",GetPlayerNameEx(GetChased[playerid]),GetPlayerNameEx(playerid),PlayerInfo[playerid][pHeadValue] / 4 * 2);
  715. SendFamilyMessage(8, COLOR_YELLOW, string);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement