Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define GREEN 0x21DD00FF
- #define RED 0xE60000FF
- #define ADMIN_RED 0xFB0000FF
- #define YELLOW 0xFFFF00FF
- #define ORANGE 0xF97804FF
- #define LIGHTRED 0xFF8080FF
- #define LIGHTBLUE 0x00C2ECFF
- #define PURPLE 0xB360FDFF
- #define PLAYER_COLOR 0xFFFFFFFF
- #define BLUE 0x1229FAFF
- #define LIGHTGREEN 0x38FF06FF
- #define DARKPINK 0xE100E1FF
- #define DARKGREEN 0x008040FF
- #define ANNOUNCEMENT 0x6AF7E1FF
- #define COLOR_SYSTEM 0xEFEFF7AA
- #define GREY 0xCECECEFF
- #define PINK 0xD52DFFFF
- #define DARKGREY 0x626262FF
- #define AQUAGREEN 0x03D687FF
- #define NICESKY 0x99FFFFAA
- #define WHITE 0xFFFFFFFF
- new bool:IsInHydra[MAX_PLAYERS];
- new PlayerHydra[MAX_PLAYERS];
- new ThePartyHydra;
- public OnFilterScriptInit()
- {
- for(new i; i < MAX_PLAYERS; i++) IsInHydra[i] = false;
- ThePartyHydra = AddStaticVehicle(520,-185.8596,1886.2292,116.3302,262.6290,0,0); // hydra
- return 1;
- }
- public OnFilterScriptExit()
- {
- DestroyVehicle(ThePartyHydra);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- IsInHydra[playerid] = false;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- IsInHydra[playerid] = false;
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- IsInHydra[playerid] = false;
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- if (GetVehicleModel(vehicleid) == 520)
- {
- for(new i; i < GetMaxPlayers(); i++)
- {
- if (IsPlayerConnected(i))
- {
- if (IsInHydra[i] == true)
- {
- if (PlayerHydra[i] == vehicleid)
- {
- TogglePlayerSpectating(i, false);
- new Float:X,Float:Y,Float:Z,Float:A;
- GetVehiclePos(vehicleid, X, Y, Z);
- GetVehicleZAngle(vehicleid, A);
- X += (2 * floatsin(-A, degrees));
- Y += (2 * floatcos(-A, degrees));
- SetPlayerPos(i, X, Y, Z);
- X += (2 * floatsin(-(A-45.0), degrees));
- Y += (2 * floatcos(-(A-45.0), degrees));
- SetPlayerPos(i, X, Y, Z);
- SetPlayerPos(i, X, Y, Z);
- SetPlayerFacingAngle(i, A+90);
- SetCameraBehindPlayer(i);
- IsInHydra[i] = false;
- PlayerHydra[i] = 0;
- SetPlayerHealth(i, 0.0);
- }
- }
- }
- }
- }
- IsInHydra[killerid] = false;
- PlayerHydra[killerid] = 0;
- return 1;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- /*
- if (vehicleid == ThePartyHydra)
- {
- if(GetPlayerScore(playerid) < 2000)
- {
- SendClientMessage(playerid, 0xFF0000FF, "you dont have enuff points to pilot this vehicle, use [ g ] for passenger.");
- new Float:phx,Float:phy,Float:phz;
- GetVehiclePos(ThePartyHydra,phx,phy,phz);
- SetPlayerPos(playerid,phx,phy,phz + 2.0);
- return true;
- }
- }
- */
- if (GetVehicleModel(vehicleid) == 520)
- {
- if (ispassenger)
- {
- if (IsInHydra[playerid] == false)
- {
- TogglePlayerSpectating(playerid, true);
- PlayerSpectateVehicle(playerid, vehicleid);
- IsInHydra[playerid] = true;
- PlayerHydra[playerid] = vehicleid;
- }
- }
- }
- return 1;
- }
- /*
- else if (vehicleid == ThePartyHydra)
- {
- if(GetPlayerScore(playerid) < 2000)
- {
- SendClientMessage(playerid, 0xFF0000FF, "you dont have enuff points to pilot this vehicle, use [ g ] for passenger.");
- new Float:phx,Float:phy,Float:phz;
- GetVehiclePos(ThePartyHydra,phx,phy,phz);
- SetPlayerPos(playerid,phx,phy,phz + 2.0);
- return true;
- }
- }
- */
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if (GetVehicleModel(PlayerHydra[playerid]) == 520)
- {
- new vehicleid = PlayerHydra[playerid];
- if (IsInHydra[playerid] == true)
- {
- if (newkeys & KEY_SECONDARY_ATTACK)
- {
- TogglePlayerSpectating(playerid, false);
- new Float:A = GetVehicleZAngle(vehicleid,A);
- new Float:phx,Float:phy,Float:phz;
- GetVehiclePos(ThePartyHydra,phx,phy,phz);
- SetPlayerPos(playerid,phx,phy,phz + 2.0);
- SetPlayerFacingAngle(playerid, A);
- SetCameraBehindPlayer(playerid);
- IsInHydra[playerid] = false;
- PlayerHydra[playerid] = 0;
- SetPlayerInterior(playerid,0);
- SetTimerEx("TherzSomthOnThWing",500,false,"i",playerid);
- }
- }
- }
- return 1;
- }
- forward TherzSomthOnThWing(playerid);
- public TherzSomthOnThWing(playerid)
- {
- new Float:A = GetVehicleZAngle(ThePartyHydra,A);
- new Float:phx,Float:phy,Float:phz;
- GetVehiclePos(ThePartyHydra,phx,phy,phz);
- SetPlayerPos(playerid,phx,phy,phz + 2.0);
- SetPlayerFacingAngle(playerid, A);
- SetCameraBehindPlayer(playerid);
- GivePlayerWeapon(playerid,46,1);
- SetPlayerInterior(playerid,0);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement