Szerző Téma: hõlégballon [0.3D]  (Megtekintve 2063 alkalommal)

hõlégballon [0.3D]
« Dátum: 2011. December 16. - 12:55:03 »
0 Show voters
szaisztok, megint csak egy más munkáját hoznám ide nem sztem jó :D :)
mivel nem scriptelek már csak olvasgatok stb :D
na a videó a scriptrõl:

letöltési link: http://pastebin.com/h3MuATqu
[pawn]// Hot air balloon filterscript by Srdjan
// Date is 01/11/2011
#include <a_samp>
#include <mapandreas>
#define KEY_AIM 128
#define MAX_BALLOONS 10
new BalloonID[MAX_BALLOONS];
new PlayerInBalloon[MAX_PLAYERS];
new Float: BalloonSpeed[MAX_BALLOONS];
new Float: Radius[MAX_BALLOONS];
new Float: Diametar[MAX_BALLOONS];
new ResetTimer[MAX_BALLOONS];
new ContinueTimer[MAX_BALLOONS];
new Text:commands;
forward ResetSpeed (objectid);
forward Continue (objectid);
public OnFilterScriptInit ()
{
CreateBalloons ();
commands = TextDrawCreate (30.0, 270.0,\"~w~Commands:~n~Sprint key - speed up~n~Jump key - speed down~n~Key \'Y\' - Tilt down~n~Key \'N\' - Tilt up~n~LMB - Angle of heading - left~n~RMB - Angle of heading - right\");
TextDrawFont (commands, 2);
TextDrawLetterSize (commands, 0.3, 0.8);
MapAndreas_Init (MAP_ANDREAS_MODE_FULL);
for (new i = 0; i < MAX_PLAYERS; i++) PlayerInBalloon = -1;

printf (\"\\nHot Air Balloon by Srdjan loaded.\\n\");


return 1;


}


CreateBalloons ()


{


BalloonID[0] = CreateObject (19334, 198.9927, -1832.8091, 3.0, 0.0, 0.0, 0.0, 300.0);


BalloonID[1] = CreateObject (19335, 241.3257, -1834.1189, 3.0, 0.0, 0.0, 0.0, 300.0);


BalloonID[2] = CreateObject (19336, 284.8625, -1830.8752, 3.0, 0.0, 0.0, 0.0, 300.0);


for (new i = 0; i < 3; i++)


{


    new id = CreateObject (18699, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 300.0);


    AttachObjectToObject (id, BalloonID
, 0.0, 0.0, 5.5, 0.0, 180.0, 0.0, 1);

}


}


public OnPlayerCommandText (playerid, cmdtext[])


{


if (!strcmp (cmdtext, \"/operate\"))


{


    if (PlayerInBalloon[playerid] != -1)


    {


        ClearAnimations (playerid);


        TextDrawHideForPlayer (playerid, commands);


        PlayerInBalloon[playerid] = -1;


    }


    else


    {


        if (GetPlayerBalloonID (playerid, 0) > -1)


        {


            ApplyAnimation (playerid, \"GANGS\", \"leanIDLE\", 4.1, 1, 1, 1, 1, 0, 1);


            TextDrawShowForPlayer (playerid, commands);


           PlayerInBalloon[playerid] = GetPlayerBalloonID (playerid, 0);


      }


        else if (GetPlayerBalloonID (playerid, 1) > -1)


            {


                new objectid = BalloonID[GetPlayerBalloonID (playerid, 1)];


          if (IsObjectMoving (objectid))


           {


            ApplyAnimation (playerid, \"GANGS\", \"leanIDLE\", 4.1, 1, 1, 1, 1, 0, 1);


               TextDrawShowForPlayer (playerid, commands);


              PlayerInBalloon[playerid] = GetPlayerBalloonID (playerid, 1);


         }


        }


    }


    return 1;


}


return 0;


}


GetPlayerBalloonID (playerid, b)


{


new Float: x, Float: y, Float: z;


for (new i = 0; i < sizeof (BalloonID); i++)


{


   GetObjectPos (BalloonID
, x, y, z);

   if (!b)


   {


      if (!IsPlayerInRangeOfPoint (playerid, 1.5, x, y, z)) continue;


      else return i;


   }


   else if (b)


   {


       if (!IsPlayerInRangeOfPoint (playerid, 5.0, x, y, z)) continue;


      else return i;


   }


}


return -1;


}


public OnPlayerKeyStateChange (playerid, newkeys, oldkeys)


{


if (PlayerInBalloon[playerid] > -1)


{


    new objectid = BalloonID[PlayerInBalloon[playerid]];


   if ((newkeys & KEY_SPRINT) && !(oldkeys & KEY_SPRINT))


   {


       if (BalloonSpeed[objectid] < 15.0) BalloonSpeed[objectid] += 0.5;


   }


   if ((newkeys & KEY_JUMP) && !(oldkeys & KEY_JUMP))


   {


       if (BalloonSpeed[objectid] > -10.0) BalloonSpeed[objectid] -= 0.5;


   }


   if ((newkeys & KEY_YES) && !(oldkeys & KEY_YES))


   {


       if (Radius[objectid] < 90.0) Radius[objectid] += 5.0;


   }


   if ((newkeys & KEY_NO) && !(oldkeys & KEY_NO))


   {


       if (Radius[objectid] > 0.0) Radius[objectid] -= 5.0;


   }


   if ((newkeys & KEY_FIRE) && !(oldkeys & KEY_FIRE))


   {


      Diametar[objectid] -= 5.0;


      if (Diametar[objectid] < 0.0) Diametar[objectid] = -5.0;


   }


   if ((newkeys & KEY_AIM) && !(oldkeys & KEY_AIM))


   {


      Diametar[objectid] += 5.0;


      if (Diametar[objectid] > 360.0) Diametar[objectid] = 5.0;


   }


   UpdateBalloonMove (objectid);


}


return 1;


}


UpdateBalloonMove (objectid)


{


StopObject (objectid);


if (BalloonSpeed[objectid] > 0.0)


{


    Continue (objectid);


}


else if (BalloonSpeed[objectid] < 0.0)


{


   KillTimer (ResetTimer[objectid]);


   new Float: x, Float: y, Float: z;


    GetObjectPos (objectid, x, y, z);


    MapAndreas_FindZ_For2DCoord (x, y, z);


   new time = MoveObject (objectid, x, y, z, floatabs(BalloonSpeed[objectid]));


   ResetTimer[objectid] = SetTimerEx (\"ResetSpeed\", time, 0, \"d\", objectid);


}


}


public ResetSpeed (objectid)


{


if (BalloonSpeed[objectid] < 0.0) BalloonSpeed[objectid] = 0.0;


if (Radius[objectid] > 0.0) Radius[objectid] = 0.0;


}


public Continue (objectid)


{


    new Float: x, Float: y, Float: z;


    GetObjectPos (objectid, x, y, z);


    KillTimer (ResetTimer[objectid]);


    KillTimer (ContinueTimer[objectid]);


    z = z + 300 * floatcos (-Radius[objectid], degrees);


    x = x + 1000 * floatsin (-Radius[objectid], degrees) * floatcos (-Diametar[objectid], degrees);


    y = y + 1000 * floatsin (-Radius[objectid], degrees) * floatsin (-Diametar[objectid], degrees);


new time = MoveObject (objectid, x, y, z, BalloonSpeed[objectid]);


ContinueTimer[objectid] = SetTimerEx (\"Continue\", time-2, 0, \"d\", objectid);


}


[/pawn]


eredeti téma :
http://forum.sa-mp.com/showthread.php?t=294701

eredeti készítõ : Srdjan


(bár ha megnézi vlaki a script eleét látja :)
« Utoljára szerkesztve: 2011. December 16. - 18:13:47 írta WebSite »

herban

  • Vendég
hõlégballon [0.3D]
« Válasz #1 Dátum: 2011. December 16. - 12:58:17 »
0 Show voters
Eredeti készítõ nevét tüntesd fel !

Nem elérhető Csabesz

  • 7827
    • Profil megtekintése
hõlégballon [0.3D]
« Válasz #2 Dátum: 2011. December 16. - 13:08:54 »
0 Show voters
Idézetet írta: herban date=1324036697\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"14307\" data-ipsquote-contentclass=\"forums_Topic
Eredeti készítõ nevét tüntesd fel !
 
// Hot air balloon filterscript by Srdjan

Elérhető Flash

  • 5726
  • (っ◕‿◕)っ
    • Profil megtekintése
hõlégballon [0.3D]
« Válasz #3 Dátum: 2011. December 16. - 18:23:16 »
0 Show voters
Ez de jó. :P GRAT!

hõlégballon [0.3D]
« Válasz #4 Dátum: 2011. December 17. - 12:11:15 »
0 Show voters
én csak áthoztam angol fórumról :D  de nekem is nagyon tetszik azért hoztam át :D

Nem elérhető Dialog

  • 547
    • Profil megtekintése
hõlégballon [0.3D]
« Válasz #5 Dátum: 2011. December 17. - 15:41:04 »
0 Show voters
mapandreas plugin kel hozzá :/

Nem elérhető Dead

  • 2045
    • Profil megtekintése
hõlégballon [0.3D]
« Válasz #6 Dátum: 2011. December 17. - 16:27:54 »
0 Show voters
ittvan tessék :D
http://forum.sa-mp.com/showthread.php?t=273263
amúgy jó dolog :)

hõlégballon [0.3D]
« Válasz #7 Dátum: 2011. December 17. - 16:42:07 »
0 Show voters
öm azt elfelejtettem kitenni, de ott az angól fórum link onnan is lelehet tölteni

Nem elérhető JackBronson

  • 1499
  • ??
    • Profil megtekintése
hõlégballon [0.3D]
« Válasz #8 Dátum: 2011. December 18. - 16:58:06 »
0 Show voters
AMugy ez ha pl ha nyomom a elõre gombot akkor elõre megy?:D
Ha igen akkor jó :)

hõlégballon [0.3D]
« Válasz #9 Dátum: 2011. December 20. - 14:33:19 »
0 Show voters
nem, ez xy helytõl xy helyig megy :D

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal