Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- new Text:Full;
- new Text:Half;
- new Text:Jk;
- new Text:Low;
- new jetpack;
- forward full(playerid);
- forward half(playerid);
- forward low(playerid);
- forward warning(playerid);
- forward out(playerid);
- forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Jet Script by Jaan_Kukin");
- print("--------------------------------------\n");
- jetpack = CreatePickup(370, 2, 1519.2051,-1617.0542,13.5469, 0);
- Full = TextDrawCreate(525.000000,162.000000,"Full");
- Half = TextDrawCreate(524.000000,185.000000,"half");
- Low = TextDrawCreate(524.000000,203.000000,"Low");
- Jk = TextDrawCreate(202.000000,435.000000,"Jk");
- TextDrawAlignment(Jk,0);
- TextDrawBackgroundColor(Jk,0x000000ff);
- TextDrawFont(Jk,1);
- TextDrawLetterSize(Jk,1.000000,1.000000);
- TextDrawColor(Jk,0xffffffff);
- TextDrawSetOutline(Jk,1);
- TextDrawSetProportional(Jk,1);
- TextDrawSetShadow(Jk,1);
- TextDrawUseBox(Full,1);
- TextDrawBoxColor(Full,0x00ff0033);
- TextDrawTextSize(Full,593.000000,43.000000);
- TextDrawUseBox(Half,1);
- TextDrawBoxColor(Half,0xffff0066);
- TextDrawTextSize(Half,594.000000,-1.000000);
- TextDrawUseBox(Low,1);
- TextDrawBoxColor(Low,0xff000066);
- TextDrawTextSize(Low,595.000000,-86.000000);
- TextDrawAlignment(Full,0);
- TextDrawAlignment(Half,0);
- TextDrawAlignment(Low,0);
- TextDrawBackgroundColor(Full,0x00ff0000);
- TextDrawBackgroundColor(Half,0x000000ff);
- TextDrawBackgroundColor(Low,0x000000ff);
- TextDrawFont(Full,1);
- TextDrawLetterSize(Full,1.200000,2.200000);
- TextDrawFont(Half,1);
- TextDrawLetterSize(Half,1.000000,1.600000);
- TextDrawFont(Low,3);
- TextDrawLetterSize(Low,1.100000,2.499999);
- TextDrawColor(Full,0xffff00ff);
- TextDrawColor(Half,0x00ffffcc);
- TextDrawColor(Low,0xff00ffff);
- TextDrawSetOutline(Full,1);
- TextDrawSetOutline(Half,1);
- TextDrawSetOutline(Low,1);
- TextDrawSetProportional(Full,1);
- TextDrawSetProportional(Half,1);
- TextDrawSetProportional(Low,1);
- TextDrawSetShadow(Full,1);
- TextDrawSetShadow(Half,1);
- TextDrawSetShadow(Low,1);
- SetTimer("full",30000,false); // Set a timer of 1000 miliseconds (1 second)
- SetTimer("half",90000,false); // Set a timer of 1000 miliseconds (1 second)
- SetTimer("low",120000,false); // Set a timer of 1000 miliseconds (1 second)
- SetTimer("warning",160000,false); // Set a timer of 1000 miliseconds (1 second)
- SetTimer("out",170000,false); // Set a timer of 1000 miliseconds (1 second)
- return 1;
- }
- public full(playerid)
- {
- if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK)
- {
- TextDrawHideForPlayer(playerid, Jk);
- TextDrawHideForPlayer(playerid, Low);
- TextDrawHideForPlayer(playerid, Half);
- TextDrawShowForPlayer(playerid, Full);
- }
- }
- public half(playerid)
- {
- if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK)
- {
- TextDrawShowForPlayer(playerid, Half);
- TextDrawHideForPlayer(playerid, Full);
- }
- }
- public low(playerid)
- {
- if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK)
- {
- TextDrawHideForPlayer(playerid, Half);
- TextDrawShowForPlayer(playerid, Low);
- }
- }
- public warning(playerid)
- {
- if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK)
- {
- SendClientMessage(playerid, 0xFFFF00AA, "Your Jetpack is out of fuel in 10 second!");
- PlayerPlaySound(playerid, 1142, 0.0, 0.0, 10.0);
- }
- }
- public out(playerid)
- {
- if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK)
- {
- TextDrawHideForPlayer(playerid, Low);
- ClearAnimations(playerid);
- GameTextForPlayer(playerid, "~w~Out of Fuel!", 5000, 1);
- PlayerPlaySound(playerid, 1144, 0.0, 0.0, 10.0);
- }
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- if(pickupid == jetpack) SendClientMessage(playerid, 0xFFFF00AA, "Your Jetpack is full of fuel!");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- TextDrawHideForPlayer(playerid, Low);
- TextDrawHideForPlayer(playerid, Half);
- TextDrawHideForPlayer(playerid, Full);
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/filljet", cmdtext, true, 10) == 0)
- {
- if(PlayerToPoint(10.0,playerid,1938.8751,-1774.2018,13.3828) || PlayerToPoint(10.0,playerid,1944.3260,-1772.9254,13.3906))
- {
- if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK)
- {
- SetTimer("full",30000,false); // Set a timer of 1000 miliseconds (1 second)
- SendClientMessage(playerid, 0xFFFF00AA, "You filled your jetpack with fuel!");
- TextDrawHideForPlayer(playerid, Low);
- TextDrawHideForPlayer(playerid, Half);
- TextDrawShowForPlayer(playerid, Full);
- }
- else
- {
- SendClientMessage(playerid,0xC2A2DAAA," You're not at a Gas Station!");
- }
- return 1;
- }
- }
- return 0;
- }
- public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
- {
- if(IsPlayerConnected(playerid))
- {
- RemovePlayerMapIcon(playerid, 0); //Map icon disable xD
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- tempposx = (oldposx -x);
- tempposy = (oldposy -y);
- tempposz = (oldposz -z);
- if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- return 1;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement