Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Scripted By BlueFire_
- Gantzyo (For Object Functions) :)
- native CreateStaticIcon(Float:x,Float:y,Float:z,markertype,color);
- native CreateStaticObject(model,Float:x,Float:y,Float:z,Float:rx,Float:ry,Float:rz);
- native CreateStaticCheckpoint(Float:x,Float:y,Float:z,Float:size);
- native DestroyStaticCheckpoint(checkpointid);
- native EnableCheckpointForPlayer(playerid,checkpointid);
- native DisableCheckpointForPlayer(playerid,checkpointid);
- native EnableCheckpointForAll(checkpointid);
- native DisableCheckpointForAll(checkpointid);
- native RotateObject(objectid,Float:rotX,Float:rotY,Float:rotZ,points,Float:speed);
- native SetObjectRotationSpeed(objectid,Float:speed);
- native StopRotatingObject(objectid);
- native GenerateBucle(objectid,Float:offX,Float:offY,Float:offZ,Float:speed)
- native StopBucle(objectid);
- native OnObjectRotated(objectid);
- native OnObjectStopRotate(objectid);
- native OnObjectStopBucle(objectid);
- native ReSpawn(playerid);
- native SetPlayerPosEx(playerid, Float:x ,Float:y,Float:z,Float:a,interior = 0,vw = 0);
- native CreateVehicleForPlayer(playerid, vehiclename[], color1, color2, Float:Health);
- native DeletePlayerVehicle(playerid);
- 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);
- native RestoreBuilding(slotid);
- native RemoveSpecificBuilding(modelid);
- native CountRemovedObjects();
- */
- #include <a_samp>
- #if defined e_steam
- #endinput
- #endif
- #define e_steam
- #undef MAX_OBJECTS
- #define MAX_OBJECTS 200
- #define STEAM_ICONS 200
- #define STEAM_OBJECTS 2000
- #define STEAM_CHECKPOINTS 100
- #define DRAW_DISTANCE_ICONS 250.0
- #define DRAW_DISTANCE_OBJECTS 75.0
- #define SERVER_OBJECTS 1000
- #if !defined MAX_REMOVED_OBJECTS
- #define MAX_REMOVED_OBJECTS 100
- #endif
- enum RemovedObjectsENUM {_model, Float:_oX, Float:_oY, Float:_oZ, Float:_orX, Float:_orY, Float:_orZ, Float:_oRadius, restored}
- new RemovedObjects[MAX_REMOVED_OBJECTS][RemovedObjectsENUM];
- enum PV_User { vehicle };
- new P_DATA_VEH[ MAX_PLAYERS ][ PV_User ];
- new Float:newrotX[SERVER_OBJECTS]; new Float:newrotY[SERVER_OBJECTS];
- new Float:newrotZ[SERVER_OBJECTS]; new Float:odifX[SERVER_OBJECTS];
- new Float:odifY[SERVER_OBJECTS]; new Float:odifZ[SERVER_OBJECTS];
- new ospeed[SERVER_OBJECTS]; new oTimer[SERVER_OBJECTS];
- new oState[SERVER_OBJECTS]; new opoints[SERVER_OBJECTS];
- #pragma unused Icon,Object,Checkpoint,CheckpointsToShow
- forward CreateVehicleForPlayer(playerid, vehiclename[], color1, color2, Float:Health);
- forward DeletePlayerVehicle(playerid); forward ToggleSteamer(); forward CreateStaticIcon(Float:x,Float:y,Float:z,markertype,color);
- forward CreateStaticObject(model,Float:x,Float:y,Float:z,Float:rx,Float:ry,Float:rz);
- forward CreateStaticCheckpoint(Float:x,Float:y,Float:z,Float:size); forward DestroyStaticCheckpoint(checkpointid);
- forward EnableCheckpointForPlayer(playerid,checkpointid); forward DisableCheckpointForPlayer(playerid,checkpointid);
- forward EnableCheckpointForAll(checkpointid); forward DisableCheckpointForAll(checkpointid);
- forward OnObjectStopRotate(objectid); forward OnObjectStopBucle(objectid);
- stock ReSpawn(playerid) { SpawnPlayer(playerid); return 1; }
- stock RotateObject(objectid,Float:rotX,Float:rotY,Float:rotZ,points,Float:speed) {
- if(oState[objectid] == 1)KillTimer(oTimer[objectid]);
- ospeed[objectid] = floatround(floatdiv(1000,speed),floatround_round);
- oTimer[objectid] = SetTimerEx("RotateObj",ospeed[objectid],0,"dd",objectid,points);
- newrotX[objectid] = rotX; newrotY[objectid] = rotY; newrotZ[objectid] = rotZ;
- new Float:rot[3]; GetObjectRot(objectid,rot[0],rot[1],rot[2]);
- odifX[objectid] = (rotX-rot[0])/points; odifY[objectid] = (rotY-rot[1])/points;
- odifZ[objectid] = (rotZ-rot[2])/points; oState[objectid] = 1; opoints[objectid] = 0;
- return 1; }
- public CreateVehicleForPlayer(playerid, vehiclename[], color1, color2, Float:Health) {
- new pvmid;
- if(strfind("Landstalker", vehiclename,true,0) != -1) pvmid = 400;
- if(strfind("Bravura", vehiclename,true,0) != -1) pvmid = 401;
- if(strfind("Buffalo", vehiclename,true,0) != -1) pvmid = 402;
- if(strfind("Linerunner", vehiclename,true,0) != -1) pvmid = 403;
- if(strfind("Perenniel", vehiclename,true,0) != -1) pvmid = 404;
- if(strfind("Sentinel", vehiclename,true,0) != -1) pvmid = 405;
- if(strfind("Dumper", vehiclename,true,0) != -1) pvmid = 406;
- if(strfind("Firetuck", vehiclename,true,0) != -1) pvmid = 407;
- if(strfind("Trashmaster", vehiclename,true,0) != -1) pvmid = 408;
- if(strfind("Stretch", vehiclename,true,0) != -1) pvmid = 409;
- if(strfind("Manana", vehiclename,true,0) != -1) pvmid = 410;
- if(strfind("Infernus", vehiclename,true,0) != -1) pvmid = 411;
- if(strfind("Voodoo", vehiclename,true,0) != -1) pvmid = 412;
- if(strfind("Pony", vehiclename,true,0) != -1) pvmid = 413;
- if(strfind("Mule", vehiclename,true,0) != -1) pvmid = 414;
- if(strfind("Cheetah", vehiclename,true,0) != -1) pvmid = 415;
- if(strfind("Ambulance", vehiclename,true,0) != -1) pvmid = 416;
- if(strfind("Leviathan", vehiclename,true,0) != -1) pvmid = 417;
- if(strfind("Moonbeam", vehiclename,true,0) != -1) pvmid = 418;
- if(strfind("Esperanto", vehiclename,true,0) != -1) pvmid = 419;
- if(strfind("Taxi", vehiclename,true,0) != -1) pvmid = 420;
- if(strfind("Washington", vehiclename,true,0) != -1) pvmid = 421;
- if(strfind("Bobcat", vehiclename,true,0) != -1) pvmid = 422;
- if(strfind("Mr Whoopie", vehiclename,true,0) != -1) pvmid = 423;
- if(strfind("BF Injection", vehiclename,true,0) != -1) pvmid = 424;
- if(strfind("Hunter", vehiclename,true,0) != -1) pvmid = 425;
- if(strfind("Premier", vehiclename,true,0) != -1) pvmid = 426;
- if(strfind("Enforcer", vehiclename,true,0) != -1) pvmid = 427;
- if(strfind("Securicar", vehiclename,true,0) != -1) pvmid = 428;
- if(strfind("Banshee", vehiclename,true,0) != -1) pvmid = 429;
- if(strfind("Predator", vehiclename,true,0) != -1) pvmid = 430;
- if(strfind("Bus", vehiclename,true,0) != -1) pvmid = 431;
- if(strfind("Rhino", vehiclename,true,0) != -1) pvmid = 432;
- if(strfind("Barracks", vehiclename,true,0) != -1) pvmid = 433;
- if(strfind("Hotknife", vehiclename,true,0) != -1) pvmid = 434;
- if(strfind("ArticleTrailer", vehiclename,true,0) != -1) pvmid = 435;
- if(strfind("Previon", vehiclename,true,0) != -1) pvmid = 436;
- if(strfind("Coach", vehiclename,true,0) != -1) pvmid = 437;
- if(strfind("Cabbie", vehiclename,true,0) != -1) pvmid = 438;
- if(strfind("Stallion", vehiclename,true,0) != -1) pvmid = 439;
- if(strfind("Rumpo", vehiclename,true,0) != -1) pvmid = 440;
- if(strfind("RCBandit", vehiclename,true,0) != -1) pvmid = 441;
- if(strfind("Romero", vehiclename,true,0) != -1) pvmid = 442;
- if(strfind("Packer", vehiclename,true,0) != -1) pvmid = 443;
- if(strfind("Monster", vehiclename,true,0) != -1) pvmid = 444;
- if(strfind("Admiral", vehiclename,true,0) != -1) pvmid = 445;
- if(strfind("Squallo", vehiclename,true,0) != -1) pvmid = 446;
- if(strfind("Seasparrow", vehiclename,true,0) != -1) pvmid = 447;
- if(strfind("Pizzaboy", vehiclename,true,0) != -1) pvmid = 448;
- if(strfind("Tram", vehiclename,true,0) != -1) pvmid = 449;
- if(strfind("Article Trailer 2", vehiclename,true,0) != -1) pvmid = 450;
- if(strfind("Turismo", vehiclename,true,0) != -1) pvmid = 451;
- if(strfind("Speeder", vehiclename,true,0) != -1) pvmid = 452;
- if(strfind("Reefer", vehiclename,true,0) != -1) pvmid = 453;
- if(strfind("Tropic", vehiclename,true,0) != -1) pvmid = 454;
- if(strfind("Flatbed", vehiclename,true,0) != -1) pvmid = 455;
- if(strfind("Yankee", vehiclename,true,0) != -1) pvmid = 456;
- if(strfind("Caddy", vehiclename,true,0) != -1) pvmid = 457;
- if(strfind("Solair", vehiclename,true,0) != -1) pvmid = 458;
- if(strfind("Berkley's RC Van", vehiclename,true,0) != -1) pvmid = 459;
- if(strfind("Skimmer", vehiclename,true,0) != -1) pvmid = 460;
- if(strfind("PCJ600", vehiclename,true,0) != -1) pvmid = 461;
- if(strfind("Faggio", vehiclename,true,0) != -1) pvmid = 462;
- if(strfind("Freeway", vehiclename,true,0) != -1) pvmid = 463;
- if(strfind("RCBaron", vehiclename,true,0) != -1) pvmid = 464;
- if(strfind("RCRaider", vehiclename,true,0) != -1) pvmid = 465;
- if(strfind("Glendale", vehiclename,true,0) != -1) pvmid = 466;
- if(strfind("Oceanic", vehiclename,true,0) != -1) pvmid = 467;
- if(strfind("Sanchez", vehiclename,true,0) != -1) pvmid = 468;
- if(strfind("Sparrow", vehiclename,true,0) != -1) pvmid = 469;
- if(strfind("Patriot", vehiclename,true,0) != -1) pvmid = 470;
- if(strfind("Quad", vehiclename,true,0) != -1) pvmid = 471;
- if(strfind("Coastguard", vehiclename,true,0) != -1) pvmid = 472;
- if(strfind("Dinghy", vehiclename,true,0) != -1) pvmid = 473;
- if(strfind("Hermes", vehiclename,true,0) != -1) pvmid = 474;
- if(strfind("Sabre", vehiclename,true,0) != -1) pvmid = 475;
- if(strfind("Rustler", vehiclename,true,0) != -1) pvmid = 476;
- if(strfind("ZR350", vehiclename,true,0) != -1) pvmid = 477;
- if(strfind("Walton", vehiclename,true,0) != -1) pvmid = 478;
- if(strfind("Regina", vehiclename,true,0) != -1) pvmid = 479;
- if(strfind("Comet", vehiclename,true,0) != -1) pvmid = 480;
- if(strfind("BMX", vehiclename,true,0) != -1) pvmid = 481;
- if(strfind("Burrito", vehiclename,true,0) != -1) pvmid = 482;
- if(strfind("Camper", vehiclename,true,0) != -1) pvmid = 483;
- if(strfind("Marquis", vehiclename,true,0) != -1) pvmid = 484;
- if(strfind("Baggage", vehiclename,true,0) != -1) pvmid = 485;
- if(strfind("Dozer", vehiclename,true,0) != -1) pvmid = 486;
- if(strfind("Maverick", vehiclename,true,0) != -1) pvmid = 487;
- if(strfind("SAN News Maverick", vehiclename,true,0) != -1) pvmid = 488;
- if(strfind("Rancher", vehiclename,true,0) != -1) pvmid = 489;
- if(strfind("FBI Rancher", vehiclename,true,0) != -1) pvmid = 490;
- if(strfind("Virgo", vehiclename,true,0) != -1) pvmid = 491;
- if(strfind("Greenwood", vehiclename,true,0) != -1) pvmid = 492;
- if(strfind("Jetmax", vehiclename,true,0) != -1) pvmid = 493;
- if(strfind("Hotring Racer", vehiclename,true,0) != -1) pvmid = 494;
- if(strfind("Sandking", vehiclename,true,0) != -1) pvmid = 495;
- if(strfind("Blista Compact", vehiclename,true,0) != -1) pvmid = 496;
- if(strfind("Police Maverick", vehiclename,true,0) != -1) pvmid = 497;
- if(strfind("Boxville", vehiclename,true,0) != -1) pvmid = 498;
- if(strfind("Benson", vehiclename,true,0) != -1) pvmid = 499;
- if(strfind("Mesa", vehiclename,true,0) != -1) pvmid = 500;
- if(strfind("RC Goblin", vehiclename,true,0) != -1) pvmid = 501;
- if(strfind("Hotring Racer", vehiclename,true,0) != -1) pvmid = 502;
- if(strfind("Hotring Racer", vehiclename,true,0) != -1) pvmid = 503;
- if(strfind("Bloodring Banger", vehiclename,true,0) != -1) pvmid = 505;
- if(strfind("Rancher", vehiclename,true,0) != -1) pvmid = 505;
- if(strfind("Super GT", vehiclename,true,0) != -1) pvmid = 506;
- if(strfind("Elegant", vehiclename,true,0) != -1) pvmid = 507;
- if(strfind("Journey", vehiclename,true,0) != -1) pvmid = 508;
- if(strfind("Bike", vehiclename,true,0) != -1) pvmid = 509;
- if(strfind("Mountain Bike", vehiclename,true,0) != -1) pvmid = 510;
- if(strfind("Beagle", vehiclename,true,0) != -1) pvmid = 511;
- if(strfind("Cropduster", vehiclename,true,0) != -1) pvmid = 512;
- if(strfind("Stuntplane", vehiclename,true,0) != -1) pvmid = 513;
- if(strfind("Tanker", vehiclename,true,0) != -1) pvmid = 515;
- if(strfind("Roadtrain", vehiclename,true,0) != -1) pvmid = 515;
- if(strfind("Nebula", vehiclename,true,0) != -1) pvmid = 516;
- if(strfind("Majestic", vehiclename,true,0) != -1) pvmid = 517;
- if(strfind("Buccaneer", vehiclename,true,0) != -1) pvmid = 518;
- if(strfind("Shamal", vehiclename,true,0) != -1) pvmid = 519;
- if(strfind("Hydra", vehiclename,true,0) != -1) pvmid = 520;
- if(strfind("FCR900", vehiclename,true,0) != -1) pvmid = 521;
- if(strfind("NRG500", vehiclename,true,0) != -1) pvmid = 522;
- if(strfind("HPV1000", vehiclename,true,0) != -1) pvmid = 523;
- if(strfind("Cement Truck", vehiclename,true,0) != -1) pvmid = 525;
- if(strfind("Towtruck", vehiclename,true,0) != -1) pvmid = 525;
- if(strfind("Fortune", vehiclename,true,0) != -1) pvmid = 526;
- if(strfind("Cadrona", vehiclename,true,0) != -1) pvmid = 527;
- if(strfind("FBI Truck", vehiclename,true,0) != -1) pvmid = 528;
- if(strfind("Willard", vehiclename,true,0) != -1) pvmid = 529;
- if(strfind("Forklift", vehiclename,true,0) != -1) pvmid = 530;
- if(strfind("Tractor", vehiclename,true,0) != -1) pvmid = 531;
- if(strfind("Combine Harvester", vehiclename,true,0) != -1) pvmid = 532;
- if(strfind("Feltzer", vehiclename,true,0) != -1) pvmid = 533;
- if(strfind("Remington", vehiclename,true,0) != -1) pvmid = 535;
- if(strfind("Slamvan", vehiclename,true,0) != -1) pvmid = 535;
- if(strfind("Blade", vehiclename,true,0) != -1) pvmid = 536;
- if(strfind("Freight Train", vehiclename,true,0) != -1) pvmid = 537;
- if(strfind("Brownstreak Train", vehiclename,true,0) != -1) pvmid = 538;
- if(strfind("Vortex", vehiclename,true,0) != -1) pvmid = 539;
- if(strfind("Vincent", vehiclename,true,0) != -1) pvmid = 540;
- if(strfind("Bullet", vehiclename,true,0) != -1) pvmid = 541;
- if(strfind("Clover", vehiclename,true,0) != -1) pvmid = 542;
- if(strfind("Sadler", vehiclename,true,0) != -1) pvmid = 543;
- if(strfind("Firetruck LA", vehiclename,true,0) != -1) pvmid = 544;
- if(strfind("Hustler", vehiclename,true,0) != -1) pvmid = 545;
- if(strfind("Intruder", vehiclename,true,0) != -1) pvmid = 546;
- if(strfind("Primo", vehiclename,true,0) != -1) pvmid = 547;
- if(strfind("Cargobob", vehiclename,true,0) != -1) pvmid = 548;
- if(strfind("Tampa", vehiclename,true,0) != -1) pvmid = 549;
- if(strfind("Sunrise", vehiclename,true,0) != -1) pvmid = 550;
- if(strfind("Merit", vehiclename,true,0) != -1) pvmid = 551;
- if(strfind("Utility Van", vehiclename,true,0) != -1) pvmid = 552;
- if(strfind("Nevada", vehiclename,true,0) != -1) pvmid = 553;
- if(strfind("Yosemite", vehiclename,true,0) != -1) pvmid = 555;
- if(strfind("Windsor", vehiclename,true,0) != -1) pvmid = 555;
- if(strfind("MonsterA", vehiclename,true,0) != -1) pvmid = 556;
- if(strfind("MonsterB", vehiclename,true,0) != -1) pvmid = 557;
- if(strfind("Uranus", vehiclename,true,0) != -1) pvmid = 558;
- if(strfind("Jester", vehiclename,true,0) != -1) pvmid = 559;
- if(strfind("Sultan", vehiclename,true,0) != -1) pvmid = 560;
- if(strfind("Stratum", vehiclename,true,0) != -1) pvmid = 561;
- if(strfind("Elegy", vehiclename,true,0) != -1) pvmid = 562;
- if(strfind("Raindance", vehiclename,true,0) != -1) pvmid = 563;
- if(strfind("RC Tiger", vehiclename,true,0) != -1) pvmid = 564;
- if(strfind("Flash", vehiclename,true,0) != -1) pvmid = 565;
- if(strfind("Tahoma", vehiclename,true,0) != -1) pvmid = 566;
- if(strfind("Savanna", vehiclename,true,0) != -1) pvmid = 567;
- if(strfind("Bandito", vehiclename,true,0) != -1) pvmid = 568;
- if(strfind("Freight Flat Trailer", vehiclename,true,0) != -1) pvmid = 569;
- if(strfind("Streak Trailer", vehiclename,true,0) != -1) pvmid = 570;
- if(strfind("Kart", vehiclename,true,0) != -1) pvmid = 571;
- if(strfind("Mower", vehiclename,true,0) != -1) pvmid = 572;
- if(strfind("Dune", vehiclename,true,0) != -1) pvmid = 573;
- if(strfind("Sweeper", vehiclename,true,0) != -1) pvmid = 574;
- if(strfind("Broadway", vehiclename,true,0) != -1) pvmid = 575;
- if(strfind("Tornado", vehiclename,true,0) != -1) pvmid = 576;
- if(strfind("AT400", vehiclename,true,0) != -1) pvmid = 577;
- if(strfind("DFT30", vehiclename,true,0) != -1) pvmid = 578;
- if(strfind("Huntley", vehiclename,true,0) != -1) pvmid = 579;
- if(strfind("Stafford", vehiclename,true,0) != -1) pvmid = 580;
- if(strfind("BF400", vehiclename,true,0) != -1) pvmid = 581;
- if(strfind("Newsvan", vehiclename,true,0) != -1) pvmid = 582;
- if(strfind("Tug", vehiclename,true,0) != -1) pvmid = 583;
- if(strfind("Petrol Trailer", vehiclename,true,0) != -1) pvmid = 584;
- if(strfind("Emperor", vehiclename,true,0) != -1) pvmid = 585;
- if(strfind("Wayfarer", vehiclename,true,0) != -1) pvmid = 586;
- if(strfind("Euros", vehiclename,true,0) != -1) pvmid = 587;
- if(strfind("Hotdog", vehiclename,true,0) != -1) pvmid = 588;
- if(strfind("Club", vehiclename,true,0) != -1) pvmid = 589;
- if(strfind("Freight Box Trailer", vehiclename,true,0) != -1) pvmid = 590;
- if(strfind("Article Trailer 3", vehiclename,true,0) != -1) pvmid = 591;
- if(strfind("Andromada", vehiclename,true,0) != -1) pvmid = 592;
- if(strfind("Dodo", vehiclename,true,0) != -1) pvmid = 593;
- if(strfind("RCCam", vehiclename,true,0) != -1) pvmid = 595;
- if(strfind("Launch", vehiclename,true,0) != -1) pvmid = 595;
- if(strfind("Police Car LSPD", vehiclename,true,0) != -1) pvmid = 596;
- if(strfind("Police Car SFPP", vehiclename,true,0) != -1) pvmid = 597;
- if(strfind("Police Car LVPD", vehiclename,true,0) != -1) pvmid = 598;
- if(strfind("Police Ranger", vehiclename,true,0) != -1) pvmid = 599;
- if(strfind("S.W.A.T. SWAT", vehiclename,true,0) != -1) pvmid = 601;
- if(strfind("Alpha", vehiclename,true,0) != -1) pvmid = 602;
- if(strfind("Phoenix", vehiclename,true,0) != -1) pvmid = 603;
- if(strfind("Glendale Shit", vehiclename,true,0) != -1) pvmid = 604;
- if(strfind("Sadler Shit", vehiclename,true,0) != -1) pvmid = 605;
- if(strfind("Baggage Trailer A", vehiclename,true,0) != -1) pvmid = 606;
- if(strfind("Baggage Trailer B", vehiclename,true,0) != -1) pvmid = 607;
- if(strfind("Tug Stairs Trailer", vehiclename,true,0) != -1) pvmid = 608;
- if(strfind("Boxville", vehiclename,true,0) != -1) pvmid = 609;
- if(strfind("Farm Trailer", vehiclename,true,0) != -1) pvmid = 610;
- if(strfind("Utility Trailer", vehiclename,true,0) != -1) pvmid = 611;
- if(strlen(vehiclename) == 3 && strval(vehiclename) >= 400 && strval(vehiclename) <= 611) pvmid = strval(vehiclename);
- if(pvmid == 0) return SendClientMessage(playerid, 0xFF0000AA, "Incorrect Vehicle Name/Model ID");
- new Float:pVposX, Float:pVposY, Float:pVposZ, Float:pVposFA;
- GetPlayerPos(playerid, pVposX, pVposY, pVposZ); GetPlayerFacingAngle(playerid, pVposFA);
- if(IsPlayerInAnyVehicle(playerid)) {
- new VID; VID = GetPlayerVehicleID(playerid); GetVehicleZAngle(VID, pVposFA); }
- new CVID, pVW, pINT; pVW = GetPlayerVirtualWorld(playerid);
- pINT = GetPlayerInterior(playerid); DeletePlayerVehicle(playerid);
- CVID = CreateVehicle(pvmid, pVposX, pVposY, pVposZ+0.6, pVposFA,color1,color2,0);
- SetVehicleVirtualWorld(CVID, pVW); LinkVehicleToInterior(CVID, pINT);
- SetVehicleHealth(CVID, Health); PutPlayerInVehicle(playerid,CVID,0);
- P_DATA_VEH[playerid][vehicle] = CVID; new pmsg[64];
- format(pmsg,sizeof(pmsg),"Vehicle ID: %i Created (Model %i).",CVID,pvmid); print(pmsg);
- return CVID; }
- stock SetObjectRotationSpeed(objectid,Float:speed) {
- ospeed[objectid] = floatround(floatdiv(1000,speed),floatround_round);
- return 1; }
- stock StopRotatingObject(objectid) {
- if(oState[objectid] == 1)KillTimer(oTimer[objectid]); oState[objectid] = 0; OnObjectStopRotate(objectid);
- return 1; }
- stock GenerateBucle(objectid,Float:offX,Float:offY,Float:offZ,Float:speed) {
- if(oState[objectid] == 1)KillTimer(oTimer[objectid]);
- ospeed[objectid] = floatround(floatdiv(1000,speed),floatround_round);
- oTimer[objectid] = SetTimerEx("RotateObjBucle",ospeed[objectid],0,"d",objectid);
- odifX[objectid] = offX; odifY[objectid] = offY;
- odifZ[objectid] = offZ; oState[objectid] = 1;
- return 1; }
- stock StopBucle(objectid) {
- if(oState[objectid] == 1)KillTimer(oTimer[objectid]); oState[objectid] = 0; OnObjectStopBucle(objectid);
- return 1; }
- forward RotateObj(objectid,points);
- public RotateObj(objectid,points) {
- if(oState[objectid] == 0) return 1;
- new Float:rot[3];
- GetObjectRot(objectid,rot[0],rot[1],rot[2]);
- if(newrotX[objectid] != rot[0])rot[0]+=odifX[objectid]; if(newrotY[objectid] != rot[1])rot[1]+=odifY[objectid];
- if(newrotZ[objectid] != rot[2])rot[2]+=odifZ[objectid]; SetObjectRot(objectid,rot[0],rot[1],rot[2]); opoints[objectid]++;
- 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);
- else {oState[objectid] = 0; }
- return 1; }
- forward RotateObjectBucle(objectid);
- public RotateObjectBucle(objectid) {
- if(oState[objectid] == 0) return 1; new Float:rot[3];
- GetObjectRot(objectid,rot[0],rot[1],rot[2]); SetObjectRot(objectid,rot[0]+odifX[objectid],rot[1]+odifY[objectid],rot[2]+odifZ[objectid]);
- oTimer[objectid] = SetTimerEx("RotateObjBucle",ospeed[objectid],0,"d",objectid);
- return 1; }
- public OnGameModeInit() { SetTimer("ToggleSteamer",1000,1); }
- enum CheckpointEnum { Float:checkpoint_x, Float:checkpoint_y, Float:checkpoint_z, Float:checkpoint_size }
- enum IconEnum { Float:icon_x, Float:icon_y, Float:icon_z, icon_markertype, icon_color };
- enum Materials { object_model, Float:object_x, Float:object_y, Float:object_z, Float:object_rx, Float:object_ry, Float:object_rz };
- new Icon[STEAM_ICONS][IconEnum]; new Object[STEAM_OBJECTS][Materials];
- new Checkpoint[STEAM_CHECKPOINTS][CheckpointEnum]; new CheckpointsToShow[MAX_PLAYERS][STEAM_CHECKPOINTS];
- public CreateStaticCheckpoint(Float:x,Float:y,Float:z,Float:size) {
- static checkpoint_checkpointid; checkpoint_checkpointid++;
- Checkpoint[checkpoint_checkpointid][checkpoint_x] = x; Checkpoint[checkpoint_checkpointid][checkpoint_y] = y;
- Checkpoint[checkpoint_checkpointid][checkpoint_z] = z; Checkpoint[checkpoint_checkpointid][checkpoint_size] = size;
- return checkpoint_checkpointid; }
- public DestroyStaticCheckpoint(checkpointid) {
- Checkpoint[checkpointid][checkpoint_x] = 0; Checkpoint[checkpointid][checkpoint_y] = 0;
- Checkpoint[checkpointid][checkpoint_z] = 0; Checkpoint[checkpointid][checkpoint_size] = 0; }
- public EnableCheckpointForPlayer(playerid,checkpointid) { CheckpointsToShow[playerid][checkpointid] = 1; }
- public DisableCheckpointForPlayer(playerid,checkpointid) { CheckpointsToShow[playerid][checkpointid] = 0; }
- public EnableCheckpointForAll(checkpointid) { for(new i = 0;i < MAX_PLAYERS;i++) CheckpointsToShow[i][checkpointid] = 1; }
- public DisableCheckpointForAll(checkpointid) { for(new i = 0;i < MAX_PLAYERS;i++) CheckpointsToShow[i][checkpointid] = 0; }
- 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)); }
- stock GetClosestCheckpoint(playerid,Float:x,Float:y,Float:z) {
- new Float:closest = 9999.9999; new j = -1;
- for(new i = 0;i < STEAM_CHECKPOINTS;i++) {
- if(CheckpointsToShow[playerid][i] == 1) {
- if(distance(x,y,z,Checkpoint[i][checkpoint_x],Checkpoint[i][checkpoint_y],Checkpoint[i][checkpoint_z]) < closest) {
- closest = distance(x,y,z,Checkpoint[i][checkpoint_x],Checkpoint[i][checkpoint_y],Checkpoint[i][checkpoint_z]); j = i;
- } } } return j; }
- stock DeletePlayerVehicle(playerid) {
- new CVID, pvmid, pmsg[64]; CVID = P_DATA_VEH[playerid][vehicle];
- pvmid = GetVehicleModel(CVID); SetVehicleToRespawn(GetPlayerVehicleID(playerid)); DestroyVehicle(CVID);
- format(pmsg,sizeof(pmsg),"Vehicle ID: %i Destroyed. (Model %i)",CVID,pvmid); print(pmsg);
- return true; }
- public CreateStaticObject(model,Float:x,Float:y,Float:z,Float:rx,Float:ry,Float:rz) {
- static object_objectid;
- if(object_objectid < STEAM_OBJECTS) {
- object_objectid++; Object[object_objectid][object_model] = model;
- Object[object_objectid][object_x] = x; Object[object_objectid][object_y] = y;
- Object[object_objectid][object_z] = z; Object[object_objectid][object_rx] = rx;
- Object[object_objectid][object_ry] = ry; Object[object_objectid][object_rz] = rz; } }
- public CreateStaticIcon(Float:x,Float:y,Float:z,markertype,color) {
- static icon_iconid; icon_iconid++;
- Icon[icon_iconid][icon_x] = x; Icon[icon_iconid][icon_y] = y;
- Icon[icon_iconid][icon_z] = z; Icon[icon_iconid][icon_markertype] = markertype;
- Icon[icon_iconid][icon_color] = color; }
- new ObjectID[MAX_OBJECTS]; new ShownObjects[MAX_PLAYERS] = 0;
- public ToggleSteamer() {
- for(new i = 0;i < MAX_PLAYERS;i++) {
- if(IsPlayerConnected(i)) {
- new Float:x,Float:y,Float:z; GetPlayerPos(i,x,y,z);
- for(new j = 0; j < sizeof(Object);j++) {
- if(j < STEAM_OBJECTS) {
- if(distance(x,y,z,Object[j][object_x],Object[j][object_y],Object[j][object_z])<DRAW_DISTANCE_OBJECTS) {
- if(ShownObjects[i] < MAX_OBJECTS) {
- if(!IsValidPlayerObject(i,ObjectID[j])) {
- 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]);
- } } } else {
- if(IsValidPlayerObject(i,ObjectID[j])) {
- DestroyPlayerObject(i,ObjectID[j]); ObjectID[j] = 0; ShownObjects[i]-=1;
- } } } }
- for(new k = 0;k < 32;k++)RemovePlayerMapIcon(i,k);
- new iid;
- for(new j = 0; j < sizeof(Icon);j++) {
- if(j < STEAM_ICONS) {
- 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);
- } }
- new checkpoint = GetClosestCheckpoint(i,x,y,z);
- if(checkpoint != -1) SetPlayerCheckpoint(i,Checkpoint[checkpoint][checkpoint_x],Checkpoint[checkpoint][checkpoint_y],Checkpoint[checkpoint][checkpoint_z],Checkpoint[checkpoint][checkpoint_size]);
- } } }
- stock SetPlayerPosEx(playerid, Float:x ,Float:y,Float:z,Float:a,interior = 0,vw = 0) {
- SetPlayerPos(playerid , x , y ,z); SetPlayerFacingAngle(playerid, a);
- SetPlayerInterior(playerid, interior); SetPlayerVirtualWorld(playerid, vw);
- return 1; }
- 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) {
- for(new i; i < MAX_REMOVED_OBJECTS; i++) {
- if(RemovedObjects[i][_model] != modelid) continue;
- if(RemovedObjects[i][restored] != 0) {
- if((RemovedObjects[i][_oX] == oX) && (RemovedObjects[i][_oY] == oY) && (RemovedObjects[i][_oZ] == oZ)) {
- DestroyObject(RemovedObjects[i][restored]); RemovedObjects[i][restored] = 0; RemovedObjects[i][_model] = 0;
- return i; } } }
- new slot = GetObjectFreeSlot();
- if(slot == -1) return printf("\tCannot remove any more objects.\nIncrease MAX_REMOVED_OBJECTS in your script.\nIt is currently: %i", MAX_REMOVED_OBJECTS);
- RemovedObjects[slot][_model] = modelid; RemovedObjects[slot][_oX] = oX; RemovedObjects[slot][_oY] = oY;
- RemovedObjects[slot][_oZ] = oZ; RemovedObjects[slot][_oRadius] = oRadius;
- RemovedObjects[slot][_orX] = orX; RemovedObjects[slot][_orY] = orY; RemovedObjects[slot][_orZ] = orZ;
- for(new i; i < MAX_PLAYERS; i++) {
- if(!IsPlayerConnected(i)) continue;
- RemoveBuildingForPlayer(i, modelid, oX, oY, oZ, oRadius); }
- return slot; }
- stock RestoreBuilding(slot) {
- if(slot < 0 || slot > MAX_REMOVED_OBJECTS) return 0;
- if(RemovedObjects[slot][_model] == 0) return 0;
- 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]);
- return 1; }
- stock RemoveSpecificBuilding(modelid) {
- return RemoveBuilding(modelid, 0.0, 0.0, 0.0, 10000.0); }
- stock RemoveBuildingInit(playerid) {
- for(new i; i < MAX_REMOVED_OBJECTS; i++) {
- if(RemovedObjects[i][_model] != 0) RemoveBuildingForPlayer(playerid, RemovedObjects[i][_model], RemovedObjects[i][_oX], RemovedObjects[i][_oY], RemovedObjects[i][_oZ], RemovedObjects[i][_oRadius]); }
- return 1; }
- stock GetObjectFreeSlot() {
- for(new i; i < MAX_REMOVED_OBJECTS; i++) {
- if(RemovedObjects[i][_model] == 0) return i; }
- return -1; }
- stock CountRemovedObjects() {
- new count = 0; for(new i; i < MAX_REMOVED_OBJECTS; i++) {
- if(RemovedObjects[i][_model] != 0) count++; }
- return count; }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement