[Accepted] Emergency Ejection Seat for the Hydra

Have you got something in mind that you'd like to suggest for S.A. Army? Post your suggestions & improvements for S.A. Army here.

Moderator: S.A. Army Generals

18 posts Page 2 of 2

iBig.

User avatar
iBig
Posts: 6786
Joined: April 28, 2011, 1:24 pm
Location: Winland

Post by iBig. » May 15, 2016, 2:40 pm
[Lsrcr]Robin wrote:
[Lsrcr]Big wrote:
Spinel wrote:
this will be abused way too much if you ask me, so -1 to that one, stop trying to make everything easier.
How do you abuse it tho?
You will be shot up to a certain height that you can deploy your parachute, it's not high enough that you can glide to a building.
Landing on a building wouldn't be abusing anyway? You ca just land your whole plane on top of.. anything really.
Image
Kill the weebs

e.e

e.e
Posts: 1717
Joined: February 12, 2015, 7:44 pm
Location: Germany

Post by e.e » May 15, 2016, 3:15 pm
Lol, just add that you can use /eject when ur Hydra has like 25-30hp? ez, and where should this be abused lmao... its just real.

Robin

User avatar
Robin
Donator
Posts: 12368
Joined: October 27, 2014, 11:08 am

Post by Robin » May 15, 2016, 3:33 pm
It can be with both a button press and a health detection.

And I really don't see how this can be abused.
Retired community player 2013-2020
★ Retired LSPD United Chief of Police ★
★ Retired S.A. Army General ★

Spoiler: show
Spoiler: show

Spinel

User avatar
SpineL
Posts: 751
Joined: September 30, 2011, 9:20 am

Post by Spinel » May 17, 2016, 9:40 pm
[Lsrcr]Robin wrote:
It can be with both a button press and a health detection.

And I really don't see how this can be abused.

few guys are chasing you and you jump into hydra and eject yourself in to the middle of the air and just fly away.
Image

e.e

e.e
Posts: 1717
Joined: February 12, 2015, 7:44 pm
Location: Germany

Post by e.e » May 17, 2016, 9:47 pm
Spinel wrote:
[Lsrcr]Robin wrote:
It can be with both a button press and a health detection.

And I really don't see how this can be abused.

few guys are chasing you and you jump into hydra and eject yourself in to the middle of the air and just fly away.
That makes no sense.. " in to the middle of the air and just fly away " what u think how high u fly? 50000 meters? And 2nd there exist something called " sniper "

Hawk

User avatar
Hawk
Posts: 529
Joined: December 19, 2010, 2:27 pm

Post by Hawk » June 23, 2016, 2:31 pm
Hey guys, since I've been mentioned by Robin, I am posting this comment. :flush: (I was army when I posted this, since I left for a break)

It is probably one of the easiest thing to do, so if you do not have any idea on how scripting works you can never say that such thing cannot be created.

I have scripted the main logic of the emergency eject as shown in the code below.
Variables could be changed (to be launched higher and so on).
This thing only took me 20 minutes to create (including downloading SA:MP server and research code) because it is only just a couple of lines!

In addition, I've put comments to explain my code.

To understand more clearly I uploaded a video of how this code works.

Video: https://www.youtube.com/watch?v=FEVJf1GFsTA

Code:
Code: Select all
public OnPlayerCommandText(playerid, cmdtext[])
{
	//below function is not needed in LSRCR as hydra is spawned by server
    if(!strcmp(cmdtext, "/hydra", true)) //Spawns hydra for TEST
    {
        new Float:X, Float:Y, Float:Z;
		//new hydra; object defined on top
        GetPlayerPos(playerid, Float: X, Float: Y , Float: Z);
		hydra = CreateVehicle(520, X, Y, Z + 2.0, 0, -1, -1, 5000);
		PutPlayerInVehicle(playerid, hydra, 0);
    	SendClientMessage(playerid, -1, "Hydra Spawned");
    	return 1;
    }
	//eject function
    if(!strcmp(cmdtext, "/emg", true))
	//emergency exit command could be changed with just a numpad button
	//for easier/faster access
    {
	    //(Pseudo code)if playerIsInHydra
        
        new Float:X, Float:Y, Float:Z;
        new Float:hydraX, Float:hydraY, Float:hydraZ;
        
        GivePlayerWeapon(playerid, 46, 1); //give parachute
        GetPlayerPos(playerid, Float: X, Float: Y , Float: Z); //get playerPos
    	SetPlayerPos(playerid, X, Y, Z + 15); //set player pos to current X, Y. However add +15 to Z axis
    	//ApplyAnimation(playerid, "PED", "SEAT_IDLE", 4.0, 1, 0, 0, 2, 0);
     	GetVehiclePos(hydra, hydraX, hydraY, hydraZ); //hydra object initialized on top
		CreateExplosion(hydraX, hydraY, hydraZ, 12, 10.0); //creates an explosion effect on the hydra, after being ejected
		//if player!InHydra
		//Display Error: "You cannot use this command with this vehicle"
    	return 1;
    }
    return 0;
}
Obviously, there can be lots of ways how this can be applied for example: animations applied (sitting) and objects attached to player.
I just wanted to show you that it is possible lol :flush:
Image

Robin

User avatar
Robin
Donator
Posts: 12368
Joined: October 27, 2014, 11:08 am

Post by Robin » June 23, 2016, 6:09 pm
Hawk wrote:
Hey guys, since I've been mentioned by Robin, I am posting this comment. :flush: (I was army when I posted this, since I left for a break)

It is probably one of the easiest thing to do, so if you do not have any idea on how scripting works you can never say that such thing cannot be created.

I have scripted the main logic of the emergency eject as shown in the code below.
Variables could be changed (to be launched higher and so on).
This thing only took me 20 minutes to create (including downloading SA:MP server and research code) because it is only just a couple of lines!

In addition, I've put comments to explain my code.

To understand more clearly I uploaded a video of how this code works.

Video: https://www.youtube.com/watch?v=FEVJf1GFsTA

Code:
Code: Select all
public OnPlayerCommandText(playerid, cmdtext[])
{
	//below function is not needed in LSRCR as hydra is spawned by server
    if(!strcmp(cmdtext, "/hydra", true)) //Spawns hydra for TEST
    {
        new Float:X, Float:Y, Float:Z;
		//new hydra; object defined on top
        GetPlayerPos(playerid, Float: X, Float: Y , Float: Z);
		hydra = CreateVehicle(520, X, Y, Z + 2.0, 0, -1, -1, 5000);
		PutPlayerInVehicle(playerid, hydra, 0);
    	SendClientMessage(playerid, -1, "Hydra Spawned");
    	return 1;
    }
	//eject function
    if(!strcmp(cmdtext, "/emg", true))
	//emergency exit command could be changed with just a numpad button
	//for easier/faster access
    {
	    //(Pseudo code)if playerIsInHydra
        
        new Float:X, Float:Y, Float:Z;
        new Float:hydraX, Float:hydraY, Float:hydraZ;
        
        GivePlayerWeapon(playerid, 46, 1); //give parachute
        GetPlayerPos(playerid, Float: X, Float: Y , Float: Z); //get playerPos
    	SetPlayerPos(playerid, X, Y, Z + 15); //set player pos to current X, Y. However add +15 to Z axis
    	//ApplyAnimation(playerid, "PED", "SEAT_IDLE", 4.0, 1, 0, 0, 2, 0);
     	GetVehiclePos(hydra, hydraX, hydraY, hydraZ); //hydra object initialized on top
		CreateExplosion(hydraX, hydraY, hydraZ, 12, 10.0); //creates an explosion effect on the hydra, after being ejected
		//if player!InHydra
		//Display Error: "You cannot use this command with this vehicle"
    	return 1;
    }
    return 0;
}
Obviously, there can be lots of ways how this can be applied for example: animations applied (sitting) and objects attached to player.
I just wanted to show you that it is possible lol :flush:
Glad that you made this!
However, I'd rather see SetPlayerVelocity being used instead of SetPlayerPos :wink:.
But, that's up to Tamer.
Retired community player 2013-2020
★ Retired LSPD United Chief of Police ★
★ Retired S.A. Army General ★

Spoiler: show
Spoiler: show

JohnCarer

Guest
Community Manager
Posts: 6380
Joined: February 26, 2013, 8:13 pm
Location: Europe

Post by JohnCarer » August 23, 2016, 1:44 pm
Accepted and will soon be in developing phase
18 posts Page 2 of 2
Return to “S.A. Army [★] Suggestions”

Who is online

Users browsing this forum: No registered users and 1 guest