Guest User

e_steam (By BlueFire_)

a guest
Oct 16th, 2012
214
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. Scripted By BlueFire_
  3. Gantzyo (For Object Functions) :)
  4.  
  5. native CreateStaticIcon(Float:x,Float:y,Float:z,markertype,color);
  6. native CreateStaticObject(model,Float:x,Float:y,Float:z,Float:rx,Float:ry,Float:rz);
  7. native CreateStaticCheckpoint(Float:x,Float:y,Float:z,Float:size);
  8. native DestroyStaticCheckpoint(checkpointid);
  9. native EnableCheckpointForPlayer(playerid,checkpointid);
  10. native DisableCheckpointForPlayer(playerid,checkpointid);
  11. native EnableCheckpointForAll(checkpointid);
  12. native DisableCheckpointForAll(checkpointid);
  13. native RotateObject(objectid,Float:rotX,Float:rotY,Float:rotZ,points,Float:speed);
  14. native SetObjectRotationSpeed(objectid,Float:speed);
  15. native StopRotatingObject(objectid);
  16. native GenerateBucle(objectid,Float:offX,Float:offY,Float:offZ,Float:speed)
  17. native StopBucle(objectid);
  18. native OnObjectRotated(objectid);
  19. native OnObjectStopRotate(objectid);
  20. native OnObjectStopBucle(objectid);
  21. native ReSpawn(playerid);
  22. native SetPlayerPosEx(playerid, Float:x ,Float:y,Float:z,Float:a,interior = 0,vw = 0);
  23. native CreateVehicleForPlayer(playerid, vehiclename[], color1, color2, Float:Health);
  24. native DeletePlayerVehicle(playerid);
  25. native RemoveBuilding(modelid, Float:oX, Float:oY, Float:oZ, Float:oRadius = 0.25, Float:orX = 0.0, Float:orY = 0.0, Float:orZ = 0.0);
  26. native RestoreBuilding(slotid);
  27. native RemoveSpecificBuilding(modelid);
  28. native CountRemovedObjects();
  29. */
  30. #include <a_samp>
  31. #if defined e_steam
  32. #endinput
  33. #endif
  34. #define e_steam
  35. #undef MAX_OBJECTS
  36. #define MAX_OBJECTS 200
  37. #define STEAM_ICONS 200
  38. #define STEAM_OBJECTS 2000
  39. #define STEAM_CHECKPOINTS 100
  40. #define DRAW_DISTANCE_ICONS 250.0
  41. #define DRAW_DISTANCE_OBJECTS 75.0
  42. #define SERVER_OBJECTS 1000
  43. #if !defined MAX_REMOVED_OBJECTS
  44. #define MAX_REMOVED_OBJECTS 100
  45. #endif
  46. enum RemovedObjectsENUM {_model, Float:_oX, Float:_oY, Float:_oZ, Float:_orX, Float:_orY, Float:_orZ, Float:_oRadius, restored}
  47. new RemovedObjects[MAX_REMOVED_OBJECTS][RemovedObjectsENUM];
  48. enum PV_User { vehicle };
  49. new P_DATA_VEH[ MAX_PLAYERS ][ PV_User ];
  50. new Float:newrotX[SERVER_OBJECTS]; new Float:newrotY[SERVER_OBJECTS];
  51. new Float:newrotZ[SERVER_OBJECTS]; new Float:odifX[SERVER_OBJECTS];
  52. new Float:odifY[SERVER_OBJECTS]; new Float:odifZ[SERVER_OBJECTS];
  53. new ospeed[SERVER_OBJECTS]; new oTimer[SERVER_OBJECTS];
  54. new oState[SERVER_OBJECTS]; new opoints[SERVER_OBJECTS];
  55. #pragma unused Icon,Object,Checkpoint,CheckpointsToShow
  56. forward CreateVehicleForPlayer(playerid, vehiclename[], color1, color2, Float:Health);
  57. forward DeletePlayerVehicle(playerid); forward ToggleSteamer(); forward CreateStaticIcon(Float:x,Float:y,Float:z,markertype,color);
  58. forward CreateStaticObject(model,Float:x,Float:y,Float:z,Float:rx,Float:ry,Float:rz);
  59. forward CreateStaticCheckpoint(Float:x,Float:y,Float:z,Float:size); forward DestroyStaticCheckpoint(checkpointid);
  60. forward EnableCheckpointForPlayer(playerid,checkpointid); forward DisableCheckpointForPlayer(playerid,checkpointid);
  61. forward EnableCheckpointForAll(checkpointid); forward DisableCheckpointForAll(checkpointid);
  62. forward OnObjectStopRotate(objectid); forward OnObjectStopBucle(objectid);
  63. stock ReSpawn(playerid) { SpawnPlayer(playerid); return 1; }
  64. stock RotateObject(objectid,Float:rotX,Float:rotY,Float:rotZ,points,Float:speed) {
  65. if(oState[objectid] == 1)KillTimer(oTimer[objectid]);
  66. ospeed[objectid] = floatround(floatdiv(1000,speed),floatround_round);
  67. oTimer[objectid] = SetTimerEx("RotateObj",ospeed[objectid],0,"dd",objectid,points);
  68. newrotX[objectid] = rotX; newrotY[objectid] = rotY; newrotZ[objectid] = rotZ;
  69. new Float:rot[3]; GetObjectRot(objectid,rot[0],rot[1],rot[2]);
  70. odifX[objectid] = (rotX-rot[0])/points; odifY[objectid] = (rotY-rot[1])/points;
  71. odifZ[objectid] = (rotZ-rot[2])/points; oState[objectid] = 1; opoints[objectid] = 0;
  72. return 1; }
  73. public CreateVehicleForPlayer(playerid, vehiclename[], color1, color2, Float:Health) {
  74. new pvmid;
  75. if(strfind("Landstalker", vehiclename,true,0) != -1) pvmid = 400;
  76. if(strfind("Bravura", vehiclename,true,0) != -1) pvmid = 401;
  77. if(strfind("Buffalo", vehiclename,true,0) != -1) pvmid = 402;
  78. if(strfind("Linerunner", vehiclename,true,0) != -1) pvmid = 403;
  79. if(strfind("Perenniel", vehiclename,true,0) != -1) pvmid = 404;
  80. if(strfind("Sentinel", vehiclename,true,0) != -1) pvmid = 405;
  81. if(strfind("Dumper", vehiclename,true,0) != -1) pvmid = 406;
  82. if(strfind("Firetuck", vehiclename,true,0) != -1) pvmid = 407;
  83. if(strfind("Trashmaster", vehiclename,true,0) != -1) pvmid = 408;
  84. if(strfind("Stretch", vehiclename,true,0) != -1) pvmid = 409;
  85. if(strfind("Manana", vehiclename,true,0) != -1) pvmid = 410;
  86. if(strfind("Infernus", vehiclename,true,0) != -1) pvmid = 411;
  87. if(strfind("Voodoo", vehiclename,true,0) != -1) pvmid = 412;
  88. if(strfind("Pony", vehiclename,true,0) != -1) pvmid = 413;
  89. if(strfind("Mule", vehiclename,true,0) != -1) pvmid = 414;
  90. if(strfind("Cheetah", vehiclename,true,0) != -1) pvmid = 415;
  91. if(strfind("Ambulance", vehiclename,true,0) != -1) pvmid = 416;
  92. if(strfind("Leviathan", vehiclename,true,0) != -1) pvmid = 417;
  93. if(strfind("Moonbeam", vehiclename,true,0) != -1) pvmid = 418;
  94. if(strfind("Esperanto", vehiclename,true,0) != -1) pvmid = 419;
  95. if(strfind("Taxi", vehiclename,true,0) != -1) pvmid = 420;
  96. if(strfind("Washington", vehiclename,true,0) != -1) pvmid = 421;
  97. if(strfind("Bobcat", vehiclename,true,0) != -1) pvmid = 422;
  98. if(strfind("Mr Whoopie", vehiclename,true,0) != -1) pvmid = 423;
  99. if(strfind("BF Injection", vehiclename,true,0) != -1) pvmid = 424;
  100. if(strfind("Hunter", vehiclename,true,0) != -1) pvmid = 425;
  101. if(strfind("Premier", vehiclename,true,0) != -1) pvmid = 426;
  102. if(strfind("Enforcer", vehiclename,true,0) != -1) pvmid = 427;
  103. if(strfind("Securicar", vehiclename,true,0) != -1) pvmid = 428;
  104. if(strfind("Banshee", vehiclename,true,0) != -1) pvmid = 429;
  105. if(strfind("Predator", vehiclename,true,0) != -1) pvmid = 430;
  106. if(strfind("Bus", vehiclename,true,0) != -1) pvmid = 431;
  107. if(strfind("Rhino", vehiclename,true,0) != -1) pvmid = 432;
  108. if(strfind("Barracks", vehiclename,true,0) != -1) pvmid = 433;
  109. if(strfind("Hotknife", vehiclename,true,0) != -1) pvmid = 434;
  110. if(strfind("ArticleTrailer", vehiclename,true,0) != -1) pvmid = 435;
  111. if(strfind("Previon", vehiclename,true,0) != -1) pvmid = 436;
  112. if(strfind("Coach", vehiclename,true,0) != -1) pvmid = 437;
  113. if(strfind("Cabbie", vehiclename,true,0) != -1) pvmid = 438;
  114. if(strfind("Stallion", vehiclename,true,0) != -1) pvmid = 439;
  115. if(strfind("Rumpo", vehiclename,true,0) != -1) pvmid = 440;
  116. if(strfind("RCBandit", vehiclename,true,0) != -1) pvmid = 441;
  117. if(strfind("Romero", vehiclename,true,0) != -1) pvmid = 442;
  118. if(strfind("Packer", vehiclename,true,0) != -1) pvmid = 443;
  119. if(strfind("Monster", vehiclename,true,0) != -1) pvmid = 444;
  120. if(strfind("Admiral", vehiclename,true,0) != -1) pvmid = 445;
  121. if(strfind("Squallo", vehiclename,true,0) != -1) pvmid = 446;
  122. if(strfind("Seasparrow", vehiclename,true,0) != -1) pvmid = 447;
  123. if(strfind("Pizzaboy", vehiclename,true,0) != -1) pvmid = 448;
  124. if(strfind("Tram", vehiclename,true,0) != -1) pvmid = 449;
  125. if(strfind("Article Trailer 2", vehiclename,true,0) != -1) pvmid = 450;
  126. if(strfind("Turismo", vehiclename,true,0) != -1) pvmid = 451;
  127. if(strfind("Speeder", vehiclename,true,0) != -1) pvmid = 452;
  128. if(strfind("Reefer", vehiclename,true,0) != -1) pvmid = 453;
  129. if(strfind("Tropic", vehiclename,true,0) != -1) pvmid = 454;
  130. if(strfind("Flatbed", vehiclename,true,0) != -1) pvmid = 455;
  131. if(strfind("Yankee", vehiclename,true,0) != -1) pvmid = 456;
  132. if(strfind("Caddy", vehiclename,true,0) != -1) pvmid = 457;
  133. if(strfind("Solair", vehiclename,true,0) != -1) pvmid = 458;
  134. if(strfind("Berkley's RC Van", vehiclename,true,0) != -1) pvmid = 459;
  135. if(strfind("Skimmer", vehiclename,true,0) != -1) pvmid = 460;
  136. if(strfind("PCJ600", vehiclename,true,0) != -1) pvmid = 461;
  137. if(strfind("Faggio", vehiclename,true,0) != -1) pvmid = 462;
  138. if(strfind("Freeway", vehiclename,true,0) != -1) pvmid = 463;
  139. if(strfind("RCBaron", vehiclename,true,0) != -1) pvmid = 464;
  140. if(strfind("RCRaider", vehiclename,true,0) != -1) pvmid = 465;
  141. if(strfind("Glendale", vehiclename,true,0) != -1) pvmid = 466;
  142. if(strfind("Oceanic", vehiclename,true,0) != -1) pvmid = 467;
  143. if(strfind("Sanchez", vehiclename,true,0) != -1) pvmid = 468;
  144. if(strfind("Sparrow", vehiclename,true,0) != -1) pvmid = 469;
  145. if(strfind("Patriot", vehiclename,true,0) != -1) pvmid = 470;
  146. if(strfind("Quad", vehiclename,true,0) != -1) pvmid = 471;
  147. if(strfind("Coastguard", vehiclename,true,0) != -1) pvmid = 472;
  148. if(strfind("Dinghy", vehiclename,true,0) != -1) pvmid = 473;
  149. if(strfind("Hermes", vehiclename,true,0) != -1) pvmid = 474;
  150. if(strfind("Sabre", vehiclename,true,0) != -1) pvmid = 475;
  151. if(strfind("Rustler", vehiclename,true,0) != -1) pvmid = 476;
  152. if(strfind("ZR350", vehiclename,true,0) != -1) pvmid = 477;
  153. if(strfind("Walton", vehiclename,true,0) != -1) pvmid = 478;
  154. if(strfind("Regina", vehiclename,true,0) != -1) pvmid = 479;
  155. if(strfind("Comet", vehiclename,true,0) != -1) pvmid = 480;
  156. if(strfind("BMX", vehiclename,true,0) != -1) pvmid = 481;
  157. if(strfind("Burrito", vehiclename,true,0) != -1) pvmid = 482;
  158. if(strfind("Camper", vehiclename,true,0) != -1) pvmid = 483;
  159. if(strfind("Marquis", vehiclename,true,0) != -1) pvmid = 484;
  160. if(strfind("Baggage", vehiclename,true,0) != -1) pvmid = 485;
  161. if(strfind("Dozer", vehiclename,true,0) != -1) pvmid = 486;
  162. if(strfind("Maverick", vehiclename,true,0) != -1) pvmid = 487;
  163. if(strfind("SAN News Maverick", vehiclename,true,0) != -1) pvmid = 488;
  164. if(strfind("Rancher", vehiclename,true,0) != -1) pvmid = 489;
  165. if(strfind("FBI Rancher", vehiclename,true,0) != -1) pvmid = 490;
  166. if(strfind("Virgo", vehiclename,true,0) != -1) pvmid = 491;
  167. if(strfind("Greenwood", vehiclename,true,0) != -1) pvmid = 492;
  168. if(strfind("Jetmax", vehiclename,true,0) != -1) pvmid = 493;
  169. if(strfind("Hotring Racer", vehiclename,true,0) != -1) pvmid = 494;
  170. if(strfind("Sandking", vehiclename,true,0) != -1) pvmid = 495;
  171. if(strfind("Blista Compact", vehiclename,true,0) != -1) pvmid = 496;
  172. if(strfind("Police Maverick", vehiclename,true,0) != -1) pvmid = 497;
  173. if(strfind("Boxville", vehiclename,true,0) != -1) pvmid = 498;
  174. if(strfind("Benson", vehiclename,true,0) != -1) pvmid = 499;
  175. if(strfind("Mesa", vehiclename,true,0) != -1) pvmid = 500;
  176. if(strfind("RC Goblin", vehiclename,true,0) != -1) pvmid = 501;
  177. if(strfind("Hotring Racer", vehiclename,true,0) != -1) pvmid = 502;
  178. if(strfind("Hotring Racer", vehiclename,true,0) != -1) pvmid = 503;
  179. if(strfind("Bloodring Banger", vehiclename,true,0) != -1) pvmid = 505;
  180. if(strfind("Rancher", vehiclename,true,0) != -1) pvmid = 505;
  181. if(strfind("Super GT", vehiclename,true,0) != -1) pvmid = 506;
  182. if(strfind("Elegant", vehiclename,true,0) != -1) pvmid = 507;
  183. if(strfind("Journey", vehiclename,true,0) != -1) pvmid = 508;
  184. if(strfind("Bike", vehiclename,true,0) != -1) pvmid = 509;
  185. if(strfind("Mountain Bike", vehiclename,true,0) != -1) pvmid = 510;
  186. if(strfind("Beagle", vehiclename,true,0) != -1) pvmid = 511;
  187. if(strfind("Cropduster", vehiclename,true,0) != -1) pvmid = 512;
  188. if(strfind("Stuntplane", vehiclename,true,0) != -1) pvmid = 513;
  189. if(strfind("Tanker", vehiclename,true,0) != -1) pvmid = 515;
  190. if(strfind("Roadtrain", vehiclename,true,0) != -1) pvmid = 515;
  191. if(strfind("Nebula", vehiclename,true,0) != -1) pvmid = 516;
  192. if(strfind("Majestic", vehiclename,true,0) != -1) pvmid = 517;
  193. if(strfind("Buccaneer", vehiclename,true,0) != -1) pvmid = 518;
  194. if(strfind("Shamal", vehiclename,true,0) != -1) pvmid = 519;
  195. if(strfind("Hydra", vehiclename,true,0) != -1) pvmid = 520;
  196. if(strfind("FCR900", vehiclename,true,0) != -1) pvmid = 521;
  197. if(strfind("NRG500", vehiclename,true,0) != -1) pvmid = 522;
  198. if(strfind("HPV1000", vehiclename,true,0) != -1) pvmid = 523;
  199. if(strfind("Cement Truck", vehiclename,true,0) != -1) pvmid = 525;
  200. if(strfind("Towtruck", vehiclename,true,0) != -1) pvmid = 525;
  201. if(strfind("Fortune", vehiclename,true,0) != -1) pvmid = 526;
  202. if(strfind("Cadrona", vehiclename,true,0) != -1) pvmid = 527;
  203. if(strfind("FBI Truck", vehiclename,true,0) != -1) pvmid = 528;
  204. if(strfind("Willard", vehiclename,true,0) != -1) pvmid = 529;
  205. if(strfind("Forklift", vehiclename,true,0) != -1) pvmid = 530;
  206. if(strfind("Tractor", vehiclename,true,0) != -1) pvmid = 531;
  207. if(strfind("Combine Harvester", vehiclename,true,0) != -1) pvmid = 532;
  208. if(strfind("Feltzer", vehiclename,true,0) != -1) pvmid = 533;
  209. if(strfind("Remington", vehiclename,true,0) != -1) pvmid = 535;
  210. if(strfind("Slamvan", vehiclename,true,0) != -1) pvmid = 535;
  211. if(strfind("Blade", vehiclename,true,0) != -1) pvmid = 536;
  212. if(strfind("Freight Train", vehiclename,true,0) != -1) pvmid = 537;
  213. if(strfind("Brownstreak Train", vehiclename,true,0) != -1) pvmid = 538;
  214. if(strfind("Vortex", vehiclename,true,0) != -1) pvmid = 539;
  215. if(strfind("Vincent", vehiclename,true,0) != -1) pvmid = 540;
  216. if(strfind("Bullet", vehiclename,true,0) != -1) pvmid = 541;
  217. if(strfind("Clover", vehiclename,true,0) != -1) pvmid = 542;
  218. if(strfind("Sadler", vehiclename,true,0) != -1) pvmid = 543;
  219. if(strfind("Firetruck LA", vehiclename,true,0) != -1) pvmid = 544;
  220. if(strfind("Hustler", vehiclename,true,0) != -1) pvmid = 545;
  221. if(strfind("Intruder", vehiclename,true,0) != -1) pvmid = 546;
  222. if(strfind("Primo", vehiclename,true,0) != -1) pvmid = 547;
  223. if(strfind("Cargobob", vehiclename,true,0) != -1) pvmid = 548;
  224. if(strfind("Tampa", vehiclename,true,0) != -1) pvmid = 549;
  225. if(strfind("Sunrise", vehiclename,true,0) != -1) pvmid = 550;
  226. if(strfind("Merit", vehiclename,true,0) != -1) pvmid = 551;
  227. if(strfind("Utility Van", vehiclename,true,0) != -1) pvmid = 552;
  228. if(strfind("Nevada", vehiclename,true,0) != -1) pvmid = 553;
  229. if(strfind("Yosemite", vehiclename,true,0) != -1) pvmid = 555;
  230. if(strfind("Windsor", vehiclename,true,0) != -1) pvmid = 555;
  231. if(strfind("MonsterA", vehiclename,true,0) != -1) pvmid = 556;
  232. if(strfind("MonsterB", vehiclename,true,0) != -1) pvmid = 557;
  233. if(strfind("Uranus", vehiclename,true,0) != -1) pvmid = 558;
  234. if(strfind("Jester", vehiclename,true,0) != -1) pvmid = 559;
  235. if(strfind("Sultan", vehiclename,true,0) != -1) pvmid = 560;
  236. if(strfind("Stratum", vehiclename,true,0) != -1) pvmid = 561;
  237. if(strfind("Elegy", vehiclename,true,0) != -1) pvmid = 562;
  238. if(strfind("Raindance", vehiclename,true,0) != -1) pvmid = 563;
  239. if(strfind("RC Tiger", vehiclename,true,0) != -1) pvmid = 564;
  240. if(strfind("Flash", vehiclename,true,0) != -1) pvmid = 565;
  241. if(strfind("Tahoma", vehiclename,true,0) != -1) pvmid = 566;
  242. if(strfind("Savanna", vehiclename,true,0) != -1) pvmid = 567;
  243. if(strfind("Bandito", vehiclename,true,0) != -1) pvmid = 568;
  244. if(strfind("Freight Flat Trailer", vehiclename,true,0) != -1) pvmid = 569;
  245. if(strfind("Streak Trailer", vehiclename,true,0) != -1) pvmid = 570;
  246. if(strfind("Kart", vehiclename,true,0) != -1) pvmid = 571;
  247. if(strfind("Mower", vehiclename,true,0) != -1) pvmid = 572;
  248. if(strfind("Dune", vehiclename,true,0) != -1) pvmid = 573;
  249. if(strfind("Sweeper", vehiclename,true,0) != -1) pvmid = 574;
  250. if(strfind("Broadway", vehiclename,true,0) != -1) pvmid = 575;
  251. if(strfind("Tornado", vehiclename,true,0) != -1) pvmid = 576;
  252. if(strfind("AT400", vehiclename,true,0) != -1) pvmid = 577;
  253. if(strfind("DFT30", vehiclename,true,0) != -1) pvmid = 578;
  254. if(strfind("Huntley", vehiclename,true,0) != -1) pvmid = 579;
  255. if(strfind("Stafford", vehiclename,true,0) != -1) pvmid = 580;
  256. if(strfind("BF400", vehiclename,true,0) != -1) pvmid = 581;
  257. if(strfind("Newsvan", vehiclename,true,0) != -1) pvmid = 582;
  258. if(strfind("Tug", vehiclename,true,0) != -1) pvmid = 583;
  259. if(strfind("Petrol Trailer", vehiclename,true,0) != -1) pvmid = 584;
  260. if(strfind("Emperor", vehiclename,true,0) != -1) pvmid = 585;
  261. if(strfind("Wayfarer", vehiclename,true,0) != -1) pvmid = 586;
  262. if(strfind("Euros", vehiclename,true,0) != -1) pvmid = 587;
  263. if(strfind("Hotdog", vehiclename,true,0) != -1) pvmid = 588;
  264. if(strfind("Club", vehiclename,true,0) != -1) pvmid = 589;
  265. if(strfind("Freight Box Trailer", vehiclename,true,0) != -1) pvmid = 590;
  266. if(strfind("Article Trailer 3", vehiclename,true,0) != -1) pvmid = 591;
  267. if(strfind("Andromada", vehiclename,true,0) != -1) pvmid = 592;
  268. if(strfind("Dodo", vehiclename,true,0) != -1) pvmid = 593;
  269. if(strfind("RCCam", vehiclename,true,0) != -1) pvmid = 595;
  270. if(strfind("Launch", vehiclename,true,0) != -1) pvmid = 595;
  271. if(strfind("Police Car LSPD", vehiclename,true,0) != -1) pvmid = 596;
  272. if(strfind("Police Car SFPP", vehiclename,true,0) != -1) pvmid = 597;
  273. if(strfind("Police Car LVPD", vehiclename,true,0) != -1) pvmid = 598;
  274. if(strfind("Police Ranger", vehiclename,true,0) != -1) pvmid = 599;
  275. if(strfind("S.W.A.T. SWAT", vehiclename,true,0) != -1) pvmid = 601;
  276. if(strfind("Alpha", vehiclename,true,0) != -1) pvmid = 602;
  277. if(strfind("Phoenix", vehiclename,true,0) != -1) pvmid = 603;
  278. if(strfind("Glendale Shit", vehiclename,true,0) != -1) pvmid = 604;
  279. if(strfind("Sadler Shit", vehiclename,true,0) != -1) pvmid = 605;
  280. if(strfind("Baggage Trailer A", vehiclename,true,0) != -1) pvmid = 606;
  281. if(strfind("Baggage Trailer B", vehiclename,true,0) != -1) pvmid = 607;
  282. if(strfind("Tug Stairs Trailer", vehiclename,true,0) != -1) pvmid = 608;
  283. if(strfind("Boxville", vehiclename,true,0) != -1) pvmid = 609;
  284. if(strfind("Farm Trailer", vehiclename,true,0) != -1) pvmid = 610;
  285. if(strfind("Utility Trailer", vehiclename,true,0) != -1) pvmid = 611;
  286. if(strlen(vehiclename) == 3 && strval(vehiclename) >= 400 && strval(vehiclename) <= 611) pvmid = strval(vehiclename);
  287. if(pvmid == 0) return SendClientMessage(playerid, 0xFF0000AA, "Incorrect Vehicle Name/Model ID");
  288. new Float:pVposX, Float:pVposY, Float:pVposZ, Float:pVposFA;
  289. GetPlayerPos(playerid, pVposX, pVposY, pVposZ); GetPlayerFacingAngle(playerid, pVposFA);
  290. if(IsPlayerInAnyVehicle(playerid)) {
  291. new VID; VID = GetPlayerVehicleID(playerid); GetVehicleZAngle(VID, pVposFA); }
  292. new CVID, pVW, pINT; pVW = GetPlayerVirtualWorld(playerid);
  293. pINT = GetPlayerInterior(playerid); DeletePlayerVehicle(playerid);
  294. CVID = CreateVehicle(pvmid, pVposX, pVposY, pVposZ+0.6, pVposFA,color1,color2,0);
  295. SetVehicleVirtualWorld(CVID, pVW); LinkVehicleToInterior(CVID, pINT);
  296. SetVehicleHealth(CVID, Health); PutPlayerInVehicle(playerid,CVID,0);
  297. P_DATA_VEH[playerid][vehicle] = CVID; new pmsg[64];
  298. format(pmsg,sizeof(pmsg),"Vehicle ID: %i Created (Model %i).",CVID,pvmid); print(pmsg);
  299. return CVID; }
  300. stock SetObjectRotationSpeed(objectid,Float:speed) {
  301. ospeed[objectid] = floatround(floatdiv(1000,speed),floatround_round);
  302. return 1; }
  303. stock StopRotatingObject(objectid) {
  304. if(oState[objectid] == 1)KillTimer(oTimer[objectid]); oState[objectid] = 0; OnObjectStopRotate(objectid);
  305. return 1; }
  306. stock GenerateBucle(objectid,Float:offX,Float:offY,Float:offZ,Float:speed) {
  307. if(oState[objectid] == 1)KillTimer(oTimer[objectid]);
  308. ospeed[objectid] = floatround(floatdiv(1000,speed),floatround_round);
  309. oTimer[objectid] = SetTimerEx("RotateObjBucle",ospeed[objectid],0,"d",objectid);
  310. odifX[objectid] = offX; odifY[objectid] = offY;
  311. odifZ[objectid] = offZ; oState[objectid] = 1;
  312. return 1; }
  313. stock StopBucle(objectid) {
  314. if(oState[objectid] == 1)KillTimer(oTimer[objectid]); oState[objectid] = 0; OnObjectStopBucle(objectid);
  315. return 1; }
  316. forward RotateObj(objectid,points);
  317. public RotateObj(objectid,points) {
  318. if(oState[objectid] == 0) return 1;
  319. new Float:rot[3];
  320. GetObjectRot(objectid,rot[0],rot[1],rot[2]);
  321. if(newrotX[objectid] != rot[0])rot[0]+=odifX[objectid]; if(newrotY[objectid] != rot[1])rot[1]+=odifY[objectid];
  322. if(newrotZ[objectid] != rot[2])rot[2]+=odifZ[objectid]; SetObjectRot(objectid,rot[0],rot[1],rot[2]); opoints[objectid]++;
  323. if((newrotX[objectid] != rot[0] || newrotY[objectid] != rot[1] || newrotZ[objectid] != rot[2]) && opoints[objectid] != points)oTimer[objectid] = SetTimerEx("RotateObj",ospeed[objectid],0,"dd",objectid,points);
  324. else {oState[objectid] = 0; }
  325. return 1; }
  326. forward RotateObjectBucle(objectid);
  327. public RotateObjectBucle(objectid) {
  328. if(oState[objectid] == 0) return 1; new Float:rot[3];
  329. GetObjectRot(objectid,rot[0],rot[1],rot[2]); SetObjectRot(objectid,rot[0]+odifX[objectid],rot[1]+odifY[objectid],rot[2]+odifZ[objectid]);
  330. oTimer[objectid] = SetTimerEx("RotateObjBucle",ospeed[objectid],0,"d",objectid);
  331. return 1; }
  332. public OnGameModeInit() { SetTimer("ToggleSteamer",1000,1); }
  333. enum CheckpointEnum { Float:checkpoint_x, Float:checkpoint_y, Float:checkpoint_z, Float:checkpoint_size }
  334. enum IconEnum { Float:icon_x, Float:icon_y, Float:icon_z, icon_markertype, icon_color };
  335. enum Materials { object_model, Float:object_x, Float:object_y, Float:object_z, Float:object_rx, Float:object_ry, Float:object_rz };
  336. new Icon[STEAM_ICONS][IconEnum]; new Object[STEAM_OBJECTS][Materials];
  337. new Checkpoint[STEAM_CHECKPOINTS][CheckpointEnum]; new CheckpointsToShow[MAX_PLAYERS][STEAM_CHECKPOINTS];
  338. public CreateStaticCheckpoint(Float:x,Float:y,Float:z,Float:size) {
  339. static checkpoint_checkpointid; checkpoint_checkpointid++;
  340. Checkpoint[checkpoint_checkpointid][checkpoint_x] = x; Checkpoint[checkpoint_checkpointid][checkpoint_y] = y;
  341. Checkpoint[checkpoint_checkpointid][checkpoint_z] = z; Checkpoint[checkpoint_checkpointid][checkpoint_size] = size;
  342. return checkpoint_checkpointid; }
  343. public DestroyStaticCheckpoint(checkpointid) {
  344. Checkpoint[checkpointid][checkpoint_x] = 0; Checkpoint[checkpointid][checkpoint_y] = 0;
  345. Checkpoint[checkpointid][checkpoint_z] = 0; Checkpoint[checkpointid][checkpoint_size] = 0; }
  346. public EnableCheckpointForPlayer(playerid,checkpointid) { CheckpointsToShow[playerid][checkpointid] = 1; }
  347. public DisableCheckpointForPlayer(playerid,checkpointid) { CheckpointsToShow[playerid][checkpointid] = 0; }
  348. public EnableCheckpointForAll(checkpointid) { for(new i = 0;i < MAX_PLAYERS;i++) CheckpointsToShow[i][checkpointid] = 1; }
  349. public DisableCheckpointForAll(checkpointid) { for(new i = 0;i < MAX_PLAYERS;i++) CheckpointsToShow[i][checkpointid] = 0; }
  350. stock Float:distance(Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2) { return Float:floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2)); }
  351. stock GetClosestCheckpoint(playerid,Float:x,Float:y,Float:z) {
  352. new Float:closest = 9999.9999; new j = -1;
  353. for(new i = 0;i < STEAM_CHECKPOINTS;i++) {
  354. if(CheckpointsToShow[playerid][i] == 1) {
  355. if(distance(x,y,z,Checkpoint[i][checkpoint_x],Checkpoint[i][checkpoint_y],Checkpoint[i][checkpoint_z]) < closest) {
  356. closest = distance(x,y,z,Checkpoint[i][checkpoint_x],Checkpoint[i][checkpoint_y],Checkpoint[i][checkpoint_z]); j = i;
  357. } } } return j; }
  358. stock DeletePlayerVehicle(playerid) {
  359. new CVID, pvmid, pmsg[64]; CVID = P_DATA_VEH[playerid][vehicle];
  360. pvmid = GetVehicleModel(CVID); SetVehicleToRespawn(GetPlayerVehicleID(playerid)); DestroyVehicle(CVID);
  361. format(pmsg,sizeof(pmsg),"Vehicle ID: %i Destroyed. (Model %i)",CVID,pvmid); print(pmsg);
  362. return true; }
  363. public CreateStaticObject(model,Float:x,Float:y,Float:z,Float:rx,Float:ry,Float:rz) {
  364. static object_objectid;
  365. if(object_objectid < STEAM_OBJECTS) {
  366. object_objectid++; Object[object_objectid][object_model] = model;
  367. Object[object_objectid][object_x] = x; Object[object_objectid][object_y] = y;
  368. Object[object_objectid][object_z] = z; Object[object_objectid][object_rx] = rx;
  369. Object[object_objectid][object_ry] = ry; Object[object_objectid][object_rz] = rz; } }
  370. public CreateStaticIcon(Float:x,Float:y,Float:z,markertype,color) {
  371. static icon_iconid; icon_iconid++;
  372. Icon[icon_iconid][icon_x] = x; Icon[icon_iconid][icon_y] = y;
  373. Icon[icon_iconid][icon_z] = z; Icon[icon_iconid][icon_markertype] = markertype;
  374. Icon[icon_iconid][icon_color] = color; }
  375. new ObjectID[MAX_OBJECTS]; new ShownObjects[MAX_PLAYERS] = 0;
  376. public ToggleSteamer() {
  377. for(new i = 0;i < MAX_PLAYERS;i++) {
  378. if(IsPlayerConnected(i)) {
  379. new Float:x,Float:y,Float:z; GetPlayerPos(i,x,y,z);
  380. for(new j = 0; j < sizeof(Object);j++) {
  381. if(j < STEAM_OBJECTS) {
  382. if(distance(x,y,z,Object[j][object_x],Object[j][object_y],Object[j][object_z])<DRAW_DISTANCE_OBJECTS) {
  383. if(ShownObjects[i] < MAX_OBJECTS) {
  384. if(!IsValidPlayerObject(i,ObjectID[j])) {
  385. ShownObjects[i]+=1; ObjectID[j] = CreatePlayerObject(i,Object[j][object_model],Object[j][object_x],Object[j][object_y],Object[j][object_z],Object[j][object_rx],Object[j][object_ry],Object[j][object_rz]);
  386. } } } else {
  387. if(IsValidPlayerObject(i,ObjectID[j])) {
  388. DestroyPlayerObject(i,ObjectID[j]); ObjectID[j] = 0; ShownObjects[i]-=1;
  389. } } } }
  390. for(new k = 0;k < 32;k++)RemovePlayerMapIcon(i,k);
  391. new iid;
  392. for(new j = 0; j < sizeof(Icon);j++) {
  393. if(j < STEAM_ICONS) {
  394. if(distance(x,y,z,Icon[j][icon_x],Icon[j][icon_y],Icon[j][icon_z])<DRAW_DISTANCE_ICONS) SetPlayerMapIcon(i,iid++,Icon[j][icon_x],Icon[j][icon_y],Icon[j][icon_x],Icon[j][icon_markertype],0);
  395. } }
  396. new checkpoint = GetClosestCheckpoint(i,x,y,z);
  397. if(checkpoint != -1) SetPlayerCheckpoint(i,Checkpoint[checkpoint][checkpoint_x],Checkpoint[checkpoint][checkpoint_y],Checkpoint[checkpoint][checkpoint_z],Checkpoint[checkpoint][checkpoint_size]);
  398. } } }
  399. stock SetPlayerPosEx(playerid, Float:x ,Float:y,Float:z,Float:a,interior = 0,vw = 0) {
  400. SetPlayerPos(playerid , x , y ,z); SetPlayerFacingAngle(playerid, a);
  401. SetPlayerInterior(playerid, interior); SetPlayerVirtualWorld(playerid, vw);
  402. return 1; }
  403. stock RemoveBuilding(modelid, Float:oX, Float:oY, Float:oZ, Float:oRadius = 0.25, Float:orX = 0.0, Float:orY = 0.0, Float:orZ = 0.0) {
  404. for(new i; i < MAX_REMOVED_OBJECTS; i++) {
  405. if(RemovedObjects[i][_model] != modelid) continue;
  406. if(RemovedObjects[i][restored] != 0) {
  407. if((RemovedObjects[i][_oX] == oX) && (RemovedObjects[i][_oY] == oY) && (RemovedObjects[i][_oZ] == oZ)) {
  408. DestroyObject(RemovedObjects[i][restored]); RemovedObjects[i][restored] = 0; RemovedObjects[i][_model] = 0;
  409. return i; } } }
  410. new slot = GetObjectFreeSlot();
  411. if(slot == -1) return printf("\tCannot remove any more objects.\nIncrease MAX_REMOVED_OBJECTS in your script.\nIt is currently: %i", MAX_REMOVED_OBJECTS);
  412. RemovedObjects[slot][_model] = modelid; RemovedObjects[slot][_oX] = oX; RemovedObjects[slot][_oY] = oY;
  413. RemovedObjects[slot][_oZ] = oZ; RemovedObjects[slot][_oRadius] = oRadius;
  414. RemovedObjects[slot][_orX] = orX; RemovedObjects[slot][_orY] = orY; RemovedObjects[slot][_orZ] = orZ;
  415. for(new i; i < MAX_PLAYERS; i++) {
  416. if(!IsPlayerConnected(i)) continue;
  417. RemoveBuildingForPlayer(i, modelid, oX, oY, oZ, oRadius); }
  418. return slot; }
  419. stock RestoreBuilding(slot) {
  420. if(slot < 0 || slot > MAX_REMOVED_OBJECTS) return 0;
  421. if(RemovedObjects[slot][_model] == 0) return 0;
  422. RemovedObjects[slot][restored] = CreateObject(RemovedObjects[slot][_model], RemovedObjects[slot][_oX], RemovedObjects[slot][_oY], RemovedObjects[slot][_oZ], RemovedObjects[slot][_orX], RemovedObjects[slot][_orY], RemovedObjects[slot][_orZ]);
  423. return 1; }
  424. stock RemoveSpecificBuilding(modelid) {
  425. return RemoveBuilding(modelid, 0.0, 0.0, 0.0, 10000.0); }
  426. stock RemoveBuildingInit(playerid) {
  427. for(new i; i < MAX_REMOVED_OBJECTS; i++) {
  428. if(RemovedObjects[i][_model] != 0) RemoveBuildingForPlayer(playerid, RemovedObjects[i][_model], RemovedObjects[i][_oX], RemovedObjects[i][_oY], RemovedObjects[i][_oZ], RemovedObjects[i][_oRadius]); }
  429. return 1; }
  430. stock GetObjectFreeSlot() {
  431. for(new i; i < MAX_REMOVED_OBJECTS; i++) {
  432. if(RemovedObjects[i][_model] == 0) return i; }
  433. return -1; }
  434. stock CountRemovedObjects() {
  435. new count = 0; for(new i; i < MAX_REMOVED_OBJECTS; i++) {
  436. if(RemovedObjects[i][_model] != 0) count++; }
  437. return count; }
RAW Paste Data