Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // FilterScript Criado por [S]trong, obrigado a LucifeR pelo SetObjectToFaceCords
- // Agradecimentos a [iPs] TeaM
- // Mapa do tubarão feito por Vinicius e Papai_Smurf!
- // teleporte feito por vinicius e tubarões adicionado por vinicius!
- // Não retire os creditos!
- #include <a_samp>
- #define MIN_RANGE_ATTACK 4.0
- #define MIN_SHARK_RANGE 40.0
- new
- Float:SharkPlaces[][] =
- {
- {688.4228, -2163.0522, -0.7187},
- {3971.0630,-2135.6909,-1.0000,185.7436},
- {3967.5725,-2139.8162,-0.0947,68.6186},
- {3966.7112,-2139.4788,-1.0000,68.6186},
- {3963.0762,-2136.5352,-0.9089,48.2935},
- {3961.8062,-2138.9031,0.2535,155.9140},
- {3959.3738,-2141.8362,-0.8218,129.0089},
- {3955.9329,-2140.7336,-1.0000,48.5859},
- {3954.4128,-2138.0510,-0.2787,39.8125},
- {3951.9861,-2137.4463,0.2818,85.1418},
- {3949.3225,-2139.6624,-0.9912,148.1642},
- {3945.3098,-2141.0381,-1.0000,101.2264},
- {3944.7185,-2139.5669,0.0983,14.3696},
- {3941.9624,-2137.3093,0.0119,70.3732},
- {3939.1084,-2139.1599,-1.0000,133.2494},
- {3935.2412,-2142.7988,-0.6166,133.2494},
- {3933.4861,-2141.0671,0.3489,32.3551},
- {3932.7402,-2139.8938,-0.0396,32.3551},
- {3931.9661,-2138.6719,-1.0000,32.3551},
- {3930.9316,-2137.0386,-1.0000,32.3551},
- {3930.8362,-2136.8879,-0.3928,32.3551},
- {3930.0271,-2135.6108,0.1781,32.3551},
- {3928.3220,-2136.1113,-0.5454,151.3811},
- {3928.0623,-2136.5813,-1.0000,151.3811},
- {3928.0623,-2136.5813,-1.0000,151.3811},
- {3925.9822,-2140.4084,0.3040,151.5273},
- {3924.3433,-2140.7703,-0.1933,38.9352},
- {3922.7427,-2138.8071,-0.9143,38.9352},
- {3922.2639,-2138.2141,-1.0000,38.9352},
- {3919.0552,-2138.8503,-0.4501,113.6554},
- {3918.9719,-2138.8870,0.0673,113.6554},
- {3917.7012,-2140.6907,-0.2004,144.9473},
- {3915.5920,-2142.3196,-1.0000,114.6790},
- {3914.1799,-2140.5054,-0.2285,20.3648},
- {3913.0483,-2139.2590,0.2244,43.7606},
- {3910.4092,-2138.7168,-0.6811,101.3726},
- {3908.0701,-2139.6267,-1.0000,119.0657},
- {3906.0962,-2140.5940,-0.1483,100.7878},
- {3903.7070,-2139.5791,-0.3901,64.6705},
- {3901.9453,-2138.7449,-1.0000,64.6705},
- {3901.9453,-2138.7449,-1.0000,64.6705},
- {3898.9299,-2138.1150,-0.0763,87.1890},
- {3897.7295,-2138.0864,0.0272,145.3859},
- {3895.7380,-2138.8293,-0.8908,109.5612},
- {3893.7148,-2141.0625,-0.8452,145.9708},
- {3892.6980,-2140.9282,0.2811,82.5098},
- {3891.4446,-2140.7610,-0.0837,82.0711},
- {3890.1812,-2140.5847,-0.8918,82.0711},
- {3890.8518,-2138.6194,-1.0000,330.3563},
- {3889.0334,-2137.8364,0.0244,69.4959},
- {3888.1350,-2138.0356,-0.2119,178.5787},
- {3887.4448,-2137.5913,-1.0000,55.1660},
- {3885.2266,-2137.9751,-0.8625,100.1660},
- {3885.2266,-2137.9751,-0.0408,55.1660},
- {3883.8542,-2138.7854,-0.1790,123.7449},
- {3881.9385,-2139.7813,-1.0000,109.8536},
- {3878.9766,-2140.8518,-1.0000,109.8536},
- {3878.9766,-2140.8518,-1.0000,78.5618},
- {3877.8333,-2140.6204,-0.9166,78.5618},
- {3875.9006,-2139.6914,0.1551,64.0857},
- {3875.0967,-2138.5242,-0.7204,7.4971},
- {3873.2004,-2137.0647,-0.9001,51.9491},
- {3871.5562,-2136.5913,0.1058,173.3147},
- {3871.4910,-2137.1533,-0.7093,173.3147},
- {837.7982,-2123.5688,-0.8022,315.1072},
- {859.9446,-2111.3884,0.1280,299.7538},
- {867.0594,-2082.5313,-0.0458,343.0361},
- {639.5123, -2155.1782, -0.6878}
- },
- Shark[sizeof SharkPlaces],
- Hunting[sizeof SharkPlaces]
- ;
- ToFace(playerid, id);
- public OnFilterScriptInit() {
- for (new ii = 0; ii != sizeof SharkPlaces; ++ii) {
- Shark[ii] = CreateObject(1608, SharkPlaces[ii][0], SharkPlaces[ii][1], SharkPlaces[ii][2], 0.0, 0.0, 80.0, 300.0);
- }
- return 1;
- }
- public ToFace(playerid, id) {
- new
- Float: h,
- Float: x,
- Float: y,
- Float: z,
- anim = GetPlayerAnimationIndex(playerid);
- if (!(anim == 1543 || anim == 1538 || anim == 1539)) {
- goto Finish;
- }
- GetPlayerHealth(playerid, h);
- if (h <= 0.0) {
- goto Finish;
- }
- GetObjectPos(Shark[id], x, y, z);
- if (IsPlayerInRangeOfPoint(playerid, MIN_RANGE_ATTACK, x, y, z)) {
- SetPlayerHealth(playerid, h - 10);
- GetPlayerPos(playerid, x, y, z);
- SetObjectToFaceCords(Shark[id], x, y, z);
- Hunting[id] = gettime() + 5;
- SetTimerEx("ToFace", 1500, 0, "ii", playerid, id);
- return SendClientMessage(playerid, 0xFF0000FF, "| AVISO | Você foi mordido por um tubarão, fuja rápido!");
- }
- if (!IsPlayerInRangeOfPoint(playerid, MIN_SHARK_RANGE, SharkPlaces[id][0], SharkPlaces[id][1], SharkPlaces[id][2])) {
- Finish:
- Hunting[id] = 0;
- MoveObject(Shark[id], SharkPlaces[id][0], SharkPlaces[id][1], SharkPlaces[id][2], 2.5);
- }
- else {
- new
- time;
- GetPlayerPos(playerid, x, y, z);
- time = MoveObject(Shark[id], x, y, z, 2.5);
- SetTimerEx("ToFace", time + 10, 0, "ii", playerid, id);
- Hunting[id] = gettime() + time + 5;
- }
- return 1;
- }
- public OnPlayerUpdate(playerid) {
- new
- anim = GetPlayerAnimationIndex(playerid);
- if ((anim == 1543 || anim == 1538 || anim == 1539)) {
- for (new ii = 0; ii != sizeof SharkPlaces; ++ii) {
- if (gettime() > Hunting[ii] && IsPlayerInRangeOfPoint(playerid, MIN_SHARK_RANGE, SharkPlaces[ii][0], SharkPlaces[ii][1], SharkPlaces[ii][2])) {
- new
- time,
- Float: x,
- Float: y,
- Float: z;
- GetPlayerPos(playerid, x, y, z);
- time = MoveObject(Shark[ii], x, y, z, 2.5);
- Hunting[ii] = gettime() + time + 5;
- SetTimerEx("ToFace", time + 10, 0, "ii", playerid, ii);
- }
- }
- }
- return 1;
- }
- SetObjectToFaceCords(objectid, Float:x1,Float:y1,Float:z1) {
- // SetObjectToFaceCords() By LucifeR //
- // LucifeR@vgames.co.il //
- // setting the objects cords
- new Float:x2,Float:y2,Float:z2;
- GetObjectPos(objectid, x2,y2,z2);
- // setting the distance values
- new Float:DX = floatabs(x2-x1);
- new Float:DY = floatabs(y2-y1);
- new Float:DZ = floatabs(z2-z1);
- // defining the angles and setting them to 0
- new Float:yaw = 0;
- new Float:pitch = 0;
- // check that there isnt any 0 in one of the distances,
- // if there is any use the given parameters:
- if(DY == 0 || DX == 0) {
- if(DY == 0 && DX > 0) {
- yaw = 00;
- pitch = 0;
- }
- else if(DY == 0 && DX < 0) {
- yaw = 180;
- pitch = 180;
- }
- else if(DY > 0 && DX == 0) {
- yaw = 90;
- pitch = 90;
- }
- else if(DY < 0 && DX == 0) {
- yaw = 270;
- pitch = 270;
- }
- else if(DY == 0 && DX == 0) {
- yaw = 0;
- pitch = 0;
- }
- }
- // calculating the angale using atan
- else { // non of the distances is 0.
- // calculatin the angles
- yaw = atan(DX/DY);
- pitch = atan(floatsqroot(DX*DX + DZ*DZ) / DY);
- // there are three quarters in a circle, now i will
- // check wich circle this is and change the angles
- // according to it.
- if(x1 > x2 && y1 <= y2) {
- yaw = yaw + 90;
- pitch = pitch - 45;
- }
- else if(x1 <= x2 && y1 < y2) {
- yaw = 90 - yaw;
- pitch = pitch - 45;
- }
- else if(x1 < x2 && y1 >= y2) {
- yaw = yaw - 90;
- pitch = pitch - 45;
- }
- else if(x1 >= x2 && y1 > y2) {
- yaw = 270 - yaw;
- pitch = pitch + 315;
- }
- // the pitch could be only in two quarters, lets see wich one:
- if(z1 < z2)
- pitch = 360-pitch;
- }
- // setting the object rotation (should be twice cuz of lame GTA rotation system)
- SetObjectRot(objectid, 0, 0, yaw);
- SetObjectRot(objectid, 0, pitch, yaw+90);
- }
- public OnGameModeInit()
- {
- // Mapa de Tubarões feito por Papai_Smurf e Arthenry
- CreateObject(8150,3930.50097656,-2130.20434570,0.00000000,0.00000000,0.00000000,0.00000000); //object(vgsselecfence04) (1)
- CreateObject(8150,3932.21801758,-2148.92822266,0.00000000,0.00000000,0.00000000,0.00000000); //object(vgsselecfence04) (2)
- CreateObject(4867,3982.54931641,-2148.65087891,-2.00000000,0.00000000,0.00000000,0.00000000); //object(lasrnway3_las) (1)
- CreateObject(3524,3867.69799805,-2129.78442383,3.13534021,0.00000000,0.00000000,268.00000000); //object(skullpillar01_lvs) (1)
- CreateObject(3524,3869.26489258,-2148.62402344,3.13534021,0.00000000,0.00000000,267.99499512); //object(skullpillar01_lvs) (2)
- CreateObject(9131,3886.02758789,-2118.49829102,0.00000000,0.00000000,0.00000000,0.00000000); //object(shbbyhswall13_lvs) (1)
- CreateObject(3816,3839.82055664,-2136.84716797,8.75000000,0.00000000,0.00000000,86.00000000); //object(bighangar1_sfx) (1)
- CreateObject(10282,3864.93017578,-2117.37768555,1.38542843,0.00000000,0.00000000,0.00000000); //object(mich_int_sfe) (1)
- CreateObject(11391,3814.38378906,-2132.32177734,1.66879320,0.00000000,0.00000000,0.00000000); //object(hubprops6_sfse) (1)
- CreateObject(14826,3815.38232422,-2160.23413086,1.13769269,0.00000000,0.00000000,0.00000000); //object(int_kbsgarage2) (1)
- CreateObject(14826,3815.26928711,-2155.33813477,0.99667382,0.00000000,0.00000000,0.00000000); //object(int_kbsgarage2) (2)
- CreateObject(14826,3815.39916992,-2150.08618164,0.99667382,0.00000000,0.00000000,0.00000000); //object(int_kbsgarage2) (3)
- CreateObject(3066,3863.67260742,-2161.15527344,1.28083873,0.00000000,0.00000000,0.00000000); //object(ammotrn_obj) (1)
- CreateObject(3066,3859.64916992,-2160.91625977,1.28083873,0.00000000,0.00000000,0.00000000); //object(ammotrn_obj) (2)
- CreateObject(3066,3855.06860352,-2160.71582031,1.28083873,0.00000000,0.00000000,0.00000000); //object(ammotrn_obj) (3)
- CreateObject(18257,3849.90380859,-2160.25122070,0.23229599,0.00000000,0.00000000,0.00000000); //object(crates) (1)
- CreateObject(925,3838.65454102,-2161.82617188,1.28846753,0.00000000,0.00000000,0.00000000); //object(rack2) (1)
- CreateObject(925,3833.72265625,-2162.63793945,1.28846753,0.00000000,0.00000000,0.00000000); //object(rack2) (2)
- CreateObject(930,3830.78881836,-2161.82836914,0.70243800,0.00000000,0.00000000,358.00000000); //object(o2_bottles) (1)
- CreateObject(930,3829.18432617,-2163.15869141,0.70243800,0.00000000,0.00000000,357.99499512); //object(o2_bottles) (2)
- CreateObject(930,3826.96679688,-2162.21850586,0.70243800,0.00000000,0.00000000,357.99499512); //object(o2_bottles) (3)
- CreateObject(2669,3815.95800781,-2143.95336914,1.57256794,0.00000000,0.00000000,84.00000000); //object(cj_chris_crate) (1)
- CreateObject(2678,3860.51171875,-2145.32543945,1.31078768,0.00000000,0.00000000,0.00000000); //object(cj_chris_crate_ld) (1)
- CreateObject(10814,3814.07153320,-2249.39965820,0.00000000,0.00000000,0.00000000,0.00000000); //object(apfuel2_sfse) (1)
- CreateObject(2933,3884.49218750,-2144.55566406,-0.75000000,0.00000000,0.00000000,265.99548340); //object(pol_comp_gate) (3)
- CreateObject(2933,3868.92773438,-2125.75341797,1.46782756,0.00000000,0.00000000,268.00000000); //object(pol_comp_gate) (4)
- CreateObject(2933,3869.00610352,-2152.36840820,1.50000000,0.00000000,0.00000000,52.00000000); //object(pol_comp_gate) (5)
- CreateObject(2933,3903.41308594,-2134.54980469,0.00000000,0.00000000,0.00000000,270.00000000); //object(pol_comp_gate) (6)
- CreateObject(1337,3812.19067383,-2093.92797852,12.71217251,0.00000000,0.00000000,0.00000000); //object(binnt07_la) (1)
- CreateObject(2933,3920.80004883,-2144.19995117,0.00000000,0.00000000,0.00000000,270.00000000); //object(pol_comp_gate) (10)
- CreateObject(2933,3940.31030273,-2144.28613281,0.06815720,0.00000000,0.00000000,273.99902344); //object(pol_comp_gate) (14)
- CreateObject(2933,3957.51171875,-2134.74023438,0.00000000,0.00000000,0.00000000,270.00000000); //object(pol_comp_gate) (15)
- CreateObject(2933,3975.05371094,-2143.58496094,0.00000000,0.00000000,0.00000000,267.99499512); //object(pol_comp_gate) (19)
- CreateObject(8171,3995.40649414,-2143.91894531,1.25000000,0.00000000,0.00000000,0.00000000); //object(vgssairportland06) (1)
- CreateObject(993,4002.08032227,-2131.96777344,0.00000000,0.00000000,0.00000000,0.00000000); //object(bar_barrier10) (1)
- CreateObject(2098,4079.61669922,-2126.43408203,23.87342453,0.00000000,0.00000000,0.00000000); //object(cj_slotcover1) (1)
- CreateObject(3550,4114.07812500,-2054.04199219,61.90873337,0.00000000,0.00000000,0.00000000); //object(vgsn_fncelec_msh) (1)
- CreateObject(16782,3838.12768555,-2109.60742188,1.41971159,0.00000000,0.00000000,268.00000000); //object(a51_radar_scan) (1)
- CreateObject(2933,3968.30004883,-2134.10009766,0.00000000,0.00000000,0.00000000,270.00000000); //object(pol_comp_gate) (15)
- CreateObject(2933,3963.60009766,-2143.30004883,0.00000000,0.00000000,0.00000000,270.00000000); //object(pol_comp_gate) (15)
- CreateObject(2933,3952.00000000,-2143.80004883,0.00000000,0.00000000,0.00000000,270.00000000); //object(pol_comp_gate) (15)
- CreateObject(2933,3946.50000000,-2134.80004883,0.00000000,0.00000000,0.00000000,270.00000000); //object(pol_comp_gate) (15)
- CreateObject(2933,3934.19995117,-2134.39990234,0.00000000,0.00000000,0.00000000,270.00000000); //object(pol_comp_gate) (15)
- CreateObject(2933,3928.50000000,-2142.30004883,0.00000000,0.00000000,0.00000000,270.00000000); //object(pol_comp_gate) (10)
- CreateObject(2933,3924.39990234,-2135.39990234,0.00000000,0.00000000,0.00000000,270.00000000); //object(pol_comp_gate) (10)
- CreateObject(2933,3915.89990234,-2135.30004883,0.00000000,0.00000000,0.00000000,270.00000000); //object(pol_comp_gate) (10)
- CreateObject(2933,3910.10009766,-2143.60009766,0.00000000,0.00000000,0.00000000,270.00000000); //object(pol_comp_gate) (10)
- CreateObject(2933,3897.69995117,-2143.00000000,0.00000000,0.00000000,0.00000000,270.00000000); //object(pol_comp_gate) (10)
- CreateObject(2933,3893.30004883,-2134.50000000,0.00000000,0.00000000,0.00000000,270.00000000); //object(pol_comp_gate) (10)
- CreateObject(2933,3879.60009766,-2135.10009766,0.00000000,0.00000000,0.00000000,270.00000000); //object(pol_comp_gate) (10)
- CreateObject(2933,3873.10009766,-2141.89990234,0.00000000,0.00000000,0.00000000,270.00000000); //object(pol_comp_gate) (10)
- CreateObject(2933,3868.00000000,-2135.60009766,0.00000000,0.00000000,0.00000000,270.00000000); //object(pol_comp_gate) (10)
- }
- public OnPlayerCommandText(playerid,cmdtext[])
- {
- if (strcmp("/tubarao", cmdtext, true, 10) == 0)
- {
- SetPlayerPos(playerid,3971.0630,-2135.6909,-1.0000,185.7436);
- GameTextForPlayer(playerid,"~b~Fuja dos Tubaroes",4000,0);
- return 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement