Advertisement
Guest User

e_steam[READABLE CODE]

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