[Include] iParachute v0.1 (Skydiving/Parachuting information, functions)
#1

Skydive v0.1

Info:
I'm a skydiving lover, yes...
This include brings you some information while you're skydiving, and currently just one new callback.

Video:
[ame]http://www.youtube.com/watch?v=TALFHMJU76c[/ame]

As you could see, it's quite simple, but it can be useful for a base jump mini game, a parachuting school in a RP, etc.

Download:
Include Download
MapAndreas Include by RyDeR` <-- NECESSARY!

Functions:
pawn Код:
IsPlayerSkyDiving(playerid);
/*
    Returns: -false --> Not parachuting.
             -true  --> Parachuting.
*/


GetPlayerParachuteState(playerid);
/*
    Returns: -  0 --> Closed
             -  1 --> Opened
             -  2 --> Opening
*/


GetPlayerAltitude(playerid);
/*
    Returns the distance in meters from you to the ground.
*/
Callbacks:
pawn Код:
native OnPlayerOpenParachute(playerid, altitude);
/*
    You're able to know when a player opens his parachute, and his altitude too. :D
*/
Example:
Here is the code which I used in the video:
pawn Код:
#include <a_samp>
#include <skydive>

public OnPlayerOpenParachute(playerid, altitude)
{
    new cade[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    format(cade,128,"* %s opened his parachute at %d meters from the ground!",name,altitude);
    SendClientMessageToAll(-1,cade);
    return 1;
}

public OnPlayerUpdate(playerid)
{
    if(IsPlayerSkyDiving(playerid))
        {
            new cad[70], estado[15];
        switch(GetPlayerParachuteState(playerid))
        {
            case 0: estado = "Closed";
            case 1: estado = "Opened";
            case 2: estado = "Opening";
        }
        format(cad,70,"~n~~n~~n~~n~~n~~n~Altitude: ~p~%d~w~m~n~~w~State: ~p~%s",GetPlayerAltitude(playerid),estado);
        GameTextForPlayer(playerid,cad,1000,5);
    }
    return 1;
}
Credits:
[DOG]irinel1996
RyDeR` (Map Andreas include)


Bugs:
I didn't find anyone, make me know if you find one!

I hope you like it!
I'm still working in this include, making new callbacks to know when a players lands, etc.

Best regards!
Reply
#2

Not bad, not bad at all actually.
Should make it detect the attitude of the location where the player equips the parachute aswell.
Reply
#3

Oh that's why you made me the question? It seems good.
Reply
#4

....
Reply
#5

good job
Reply
#6

Pretty nice include, i'd prefer to use the plugin map andreas since its more faster. (Also works with the updated by mauzen using NO_BUFFER mode).
Reply
#7

Pretty nice, good job.
Reply
#8

Very nice job!
Reply
#9

Really nice include dude !
Reply
#10

Nice to hear that from all you guys, thank you!
_____________________________________________
Quote:
Originally Posted by GTXcube
Посмотреть сообщение
This is the best include for my server. Is there gonna be some updates with new stuff ?

Edit: I found a bug. When you open your parachute and don't click any key, it always says "opening"
I just checked and yes, you're right.
I'm going to fix it. Thank you for reporting it.

I'd add new stuff, but right now I'm running out of ideas, any one?
_____________________________________________
EDIT: it says always "opening" because the player need an update in someway, when we don't press any key it "isn't updating".
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)