[ Новые сообщения · Участники · Правила форума · Поиск · RSS ] |
|
|
Модератор форума: Gank |
Форум - Сообщество любителей игры GTA:MP » SA-MP Scripting » Скрипты [Filterscripts] » [FS] Грузовой отсек |
[FS] Грузовой отсек |
Дата: 24.03.2011, Четверг, 19:10:37 | Сообщение # $NUMBER
Автор: Tracker1
Описание: 2 вертолёта. Cargobob и Raindance Если к ним подьехать на машине и нажать ctrl попадаешь в грузовой отсек и вертолет тебя какбы перевозит. Если вертолет взрывается машина и вы тоже. Code // This is a comment // uncomment the line below if you want to write a filterscript #include <a_samp> #include <streamer> new carvnutri[MAX_VEHICLES]; new tachka[MAX_PLAYERS]; public OnFilterScriptInit() { CreateDynamicObject(8948,2608.84692400,-6270.33496100,232.34492500,0.00000000,90.24079544,0.00000000); //object(3) CreateDynamicObject(8948,2605.29248000,-6270.31298800,232.33830300,0.00000000,90.24079544,0.00000000); //object(4) CreateDynamicObject(8948,2612.39624000,-6270.34033200,232.34129300,0.00000000,90.24079544,0.00000000); //object(5) CreateDynamicObject(8948,2615.89526400,-6270.30517600,232.30754100,0.00000000,90.24079544,0.00000000); //object(6) CreateDynamicObject(8948,2615.89819300,-6263.17041000,232.32684300,0.00000000,90.24079544,0.00000000); //object(7) CreateDynamicObject(8948,2612.41601600,-6263.17285200,232.33305400,0.00000000,90.24079544,0.00000000); //object(8) CreateDynamicObject(8948,2608.88916000,-6263.17578100,232.33209200,0.00000000,90.24079544,0.00000000); //object(9) CreateDynamicObject(8948,2605.36401400,-6263.11132800,232.35678100,0.00000000,90.24079544,0.00000000); //object(10) CreateDynamicObject(8948,2619.36035200,-6270.31250000,232.30349700,0.00000000,90.24079544,0.00000000); //object(11) CreateDynamicObject(8948,2619.36669900,-6263.17968800,232.29461700,0.00000000,90.24079544,0.00000000); //object(12) CreateDynamicObject(8948,2621.00610400,-6270.25585900,234.11474600,0.00000000,0.00000000,0.00011459); //object(13) CreateDynamicObject(8948,2621.00048800,-6263.17089800,234.10623200,0.00000000,0.00000000,0.00000000); //object(14) CreateDynamicObject(8948,2617.21435500,-6259.58691400,234.08958400,0.00000000,0.00000000,89.99998128); //object(15) CreateDynamicObject(8948,2609.96704100,-6259.62695300,234.09573400,0.00000000,0.00000000,89.99998128); //object(16) CreateDynamicObject(8948,2617.32446300,-6273.89892600,234.11969000,0.00000000,0.00000000,270.00000112); //object(17) CreateDynamicObject(8948,2609.97778300,-6273.88134800,234.13334700,0.00000000,0.00000000,-89.99998128); //object(18) CreateDynamicObject(8948,2601.90063500,-6263.15087900,232.38008100,0.00000000,90.24079544,0.00000000); //object(20) CreateDynamicObject(8948,2601.94751000,-6270.41406300,232.33093300,0.00000000,90.24079544,0.00000000); //object(21) CreateDynamicObject(8948,2602.62402300,-6273.89111300,234.14625500,0.00000000,0.00000000,-89.99998128); //object(22) CreateDynamicObject(8948,2600.23632800,-6270.43652300,234.15628100,0.00000000,0.00000000,-180.00001985); //object(23) CreateDynamicObject(8948,2600.15991200,-6263.10058600,234.15556300,0.00000000,0.00000000,180.00001985); //object(24) CreateDynamicObject(8948,2602.71289100,-6259.59716800,234.09297200,0.00000000,0.00000000,89.99998128); //object(25) CreateDynamicObject(8948,2617.31665000,-6273.87255900,237.49726900,0.00000000,0.00000000,-89.99998128); //object(26) CreateDynamicObject(8948,2610.02587900,-6273.90478500,237.51092500,0.00000000,0.00000000,-89.99998128); //object(27) CreateDynamicObject(8948,2602.63793900,-6273.96191400,237.49884000,0.00000000,0.00000000,-89.99998128); //object(28) CreateDynamicObject(8948,2600.20849600,-6270.43554700,237.49057000,0.00000000,0.00000000,-180.00001985); //object(29) CreateDynamicObject(8948,2600.20581100,-6263.11084000,237.48315400,0.00000000,0.00000000,-180.00001985); //object(30) CreateDynamicObject(8948,2602.76269500,-6259.64306600,237.49554400,0.00000000,0.00000000,-270.00000112); //object(31) CreateDynamicObject(8948,2609.90161100,-6259.64111300,237.49830600,0.00000000,0.00000000,-269.99994383); //object(32) CreateDynamicObject(8948,2617.24536100,-6259.60400400,237.49215700,0.00000000,0.00000000,89.99998128); //object(33) CreateDynamicObject(8948,2620.95361300,-6263.18994100,237.51205400,0.00000000,0.00000000,0.00000000); //object(34) CreateDynamicObject(8948,2620.95922900,-6270.21435500,237.49856600,0.00000000,0.00000000,0.00000000); //object(35) CreateDynamicObject(8948,2601.99487300,-6270.33837900,239.17665100,0.00000000,-90.24079544,-180.00001985); //object(36) CreateDynamicObject(8948,2601.98925800,-6263.04638700,239.17401100,0.00000000,-90.24079544,-180.00001985); //object(37) CreateDynamicObject(8948,2605.49414100,-6262.99462900,239.07173200,0.00000000,-90.24079544,-180.00001985); //object(38) CreateDynamicObject(8948,2605.52978500,-6270.32031300,239.09507800,0.00000000,-90.24079544,-180.00001985); //object(39) CreateDynamicObject(8948,2608.86718800,-6270.22314500,239.09588600,0.00000000,-90.24079544,-180.00001985); //object(40) CreateDynamicObject(8948,2608.79663100,-6263.18017600,239.09959400,0.00000000,-90.24079544,-180.00001985); //object(37) CreateDynamicObject(8948,2612.31274400,-6263.18457000,239.04956100,0.00000000,-90.24079544,-180.00001985); //object(38) CreateDynamicObject(8948,2612.28271500,-6270.27099600,239.07066300,0.00000000,-90.24079544,-180.00001985); //object(39) CreateDynamicObject(8948,2615.76757800,-6270.21630900,239.09236100,0.00000000,-90.24079544,-180.00001985); //object(40) CreateDynamicObject(8948,2615.72192400,-6262.93750000,239.04582200,0.00000000,-90.24079544,-180.00001985); //object(41) CreateDynamicObject(8948,2619.07739300,-6270.27441400,239.06463600,0.00000000,-90.24079544,-180.00001985); //object(42) CreateDynamicObject(8948,2619.24877900,-6263.06445300,239.04460100,0.00000000,-90.24079544,-180.00001985); //object(43) print("\n--------------------------------------"); print("Машины в вертолете блеать запилены"); print("--------------------------------------\n"); return 1; } public OnFilterScriptExit() { print("\n--------------------------------------"); print("Машины в вертолете блеать выпилены"); print("--------------------------------------\n"); return 1; } public OnVehicleDeath(vehicleid, killerid) { for(new i = 0; i< MAX_PLAYERS;i++) { if(tachka[i] == vehicleid) { SendClientMessage(i,0x00FFF0FF,"Самолет в котором вы перевозились разбился. Вы погибли"); SetPlayerHealth(i, 0); return 1; } } for(new i = 0; i < MAX_VEHICLES;i++) { if(carvnutri[i] == vehicleid) SetVehicleToRespawn(i); } return 1; } public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if(newkeys ==1) { new l; if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER && !IsAPlane(GetPlayerVehicleID(playerid))) { if(!carvnutri[GetPlayerVehicleID(playerid)]) { for(new i = 0; i < MAX_VEHICLES;i++) { if(CVDTV(5.0,playerid,i)) { if(GetVehicleModel(i)==548 ||GetVehicleModel(i)==563) { l++; tachka[playerid] = i; } } } if(l > 1) { SendClientMessage(playerid,0x00FFF0FF,"Возле вас больше чем 1-но воздушное средство"); return 1; } if(l == 0) { SendClientMessage(playerid,0x00FFF0FF,"Возле вас нету воздушных средств"); return 1; } SetPlayerVirtualWorld(playerid,tachka[playerid]); for(new i = 0; i< MAX_PLAYERS;i++) { if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid) && GetPlayerState(i) == PLAYER_STATE_PASSENGER) { SetPlayerVirtualWorld(i,tachka[playerid]); SetPlayerInterior(i,tachka[playerid]); } } carvnutri[GetPlayerVehicleID(playerid)] = tachka[playerid]; SetVehicleVirtualWorld(GetPlayerVehicleID(playerid),tachka[playerid]); SendClientMessage(playerid,0x00FFF0FF,"Вы заехали в грузовой отсек самолета. Нажмите ctrl чтобы катапультироваться"); SetVehiclePos(GetPlayerVehicleID(playerid),2617.71875000,-6266.80566400,238.33062700); } else { SetPlayerInterior(playerid,0); SetPlayerVirtualWorld(playerid,0); new Float:kx, Float:ky,Float:kz; GetVehiclePos(carvnutri[GetPlayerVehicleID(playerid)],kx,ky,kz); carvnutri[GetPlayerVehicleID(playerid)] = 0; tachka[playerid] = 0; SetVehiclePos(GetPlayerVehicleID(playerid),kx+2,ky-5,kz); SetVehicleVirtualWorld(GetPlayerVehicleID(playerid),0); for(new i = 0; i< MAX_PLAYERS;i++) { if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid) && GetPlayerState(i) == PLAYER_STATE_PASSENGER) { SetPlayerVirtualWorld(i,0); SetPlayerInterior(i,0); } } } } } return 1; } stock CVDTV(Float:radi, playerid, vehicleid) { if(IsPlayerConnected(playerid) && IsPlayerInAnyVehicle(playerid)) { new Float:PX,Float:PY,Float:PZ,Float:X,Float:Y,Float:Z; GetVehiclePos(GetPlayerVehicleID(playerid),PX,PY,PZ); GetVehiclePos(vehicleid, X,Y,Z); new Float:Distance = (X-PX)*(X-PX)+(Y-PY)*(Y-PY)+(Z-PZ)*(Z-PZ); if(Distance <= radi*radi) { return 1; } } return 0; } stock IsAPlane(carid) { new AirVeh[] = { 592, 577, 511, 512, 593, 520, 553, 476, 519, 460, 513, 548, 425, 417, 487, 488, 497, 563, 447, 469 }; for(new i = 0; i < sizeof(AirVeh); i++) { if(GetVehicleModel(carid) == AirVeh[i]) return 1; } return 0; } |
| |||
| |||