NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

#include <a_samp>

#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1 // Credits go to DracoBlue

#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33FF33AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_BRIGHTRED 0xE60000FF
#define COLOR_BLUE 0x0000FFAA
#define COLOR_PURPLE 0x9900FFAA
#define COLOR_BROWN 0x993300AA
#define COLOR_ORANGE 0xFF9933AA
#define COLOR_CYAN 0x99FFFFAA
#define COLOR_TAN 0xFFFFCCAA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_KHAKI 0x999900AA
#define COLOR_LIME 0x99FF00AA
#define COLOR_BLACK 0x000000AA
#define COLOR_TURQ 0x00A3C0AA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_DARKRED 0xAA993333
#define COLOR_VIOLET 0x9955DEEE
#define COLOR_RED 0xFB0000FF

#define DIVBY 1.300

new
Benzin[MAX_VEHICLES],
bool:PortableFuel[MAX_PLAYERS],
FuelTimer;

new
Text: Fuel[MAX_PLAYERS],
Text: BlackBox,
Text: Moving[MAX_PLAYERS];


public OnFilterScriptInit()
{
FuelTimer = SetTimer("SubFuel", 12000, true);
print("----------------------------------");
print(" Fuel System by RyDeR - Loaded - ");
print("----------------------------------");

BlackBox = TextDrawCreate(354.000000, 422.000000, "_");
TextDrawBackgroundColor(BlackBox, 255);
TextDrawFont(BlackBox, 1);
TextDrawLetterSize(BlackBox, 0.509999, 1.000000);
TextDrawColor(BlackBox, -1);
TextDrawSetOutline(BlackBox, 0);
TextDrawSetProportional(BlackBox, 1);
TextDrawSetShadow(BlackBox, 1);
TextDrawUseBox(BlackBox, 1);
TextDrawBoxColor(BlackBox, 0xFF80001A);
TextDrawTextSize(BlackBox, 277.000000, 51.000000);

new
i;

while (i != GetMaxPlayers())
{
Fuel[i] = TextDrawCreate(258.000000, 421.000000, " ");
TextDrawBackgroundColor(Fuel[i], 255);
TextDrawFont(Fuel[i], 1);
TextDrawLetterSize(Fuel[i], 0.250000, 1.100000);
TextDrawColor(Fuel[i], -1);
TextDrawSetOutline(Fuel[i], 0);
TextDrawSetProportional(Fuel[i], 1);
TextDrawSetShadow(Fuel[i], 1);

Moving[i] = TextDrawCreate(354.000000, 422.000000, "_");
TextDrawBackgroundColor(Moving[i], 255);
TextDrawFont(Moving[i], 1);
TextDrawLetterSize(Moving[i], 0.509999, 1.000000);
TextDrawColor(Moving[i], -1);
TextDrawSetOutline(Moving[i], 0);
TextDrawSetProportional(Moving[i], 1);
TextDrawSetShadow(Moving[i], 1);
TextDrawUseBox(Moving[i], 1);
TextDrawBoxColor(Moving[i], 0xFF8000C1);
TextDrawTextSize(Moving[i], 277.000000, 51.000000);
++i;
}

new
v;

while (v != MAX_VEHICLES)
{
Benzin[v] = random(100);
++v;
}
return 1;
}

public OnFilterScriptExit()
{
new
i,
v;

while (i != GetMaxPlayers())
{
TextDrawDestroy(Fuel[i]);
TextDrawDestroy(Moving[i]);
++i;
}
TextDrawDestroy(BlackBox);
KillTimer(FuelTimer);

while (v != MAX_VEHICLES)
{
Benzin[v] = 100;
++v;
}
return 1;
}

forward SubFuel();
public SubFuel()
{
new
i;

while (i != GetMaxPlayers())
{
if (IsPlayerInAnyVehicle(i))
{
new string[128];
if(Benzin[GetPlayerVehicleID(i)] <0) Benzin[GetPlayerVehicleID(i)] = 0;
if(IsPlayerInAnyVehicle(i))
{
Benzin[GetPlayerVehicleID(i)]-=1;
format(string, 128, "Fuel: %%%d", Benzin[GetPlayerVehicleID(i)]);
TextDrawSetString(Fuel[i], string), TextDrawShowForPlayer(i, Fuel[i]),
TextDrawShowForPlayer(i, BlackBox),
TextDrawTextSize(Moving[i], (354.0 - (Benzin[GetPlayerVehicleID(i)] / DIVBY)), 0.000000),
TextDrawShowForPlayer(i, Moving[i]);
}
if (Benzin[GetPlayerVehicleID(i)] < 1)
{
Benzin[GetPlayerVehicleID(i)] = 0;
GameTextForPlayer(i, "~n~~n~~n~~n~~n~~n~~n~~w~You don't have fuel in your vehicle.", 4000, 3);
TogglePlayerControllable(i, false);
RemovePlayerFromVehicle(i);
}
}
else
{
TextDrawHideForPlayer(i, Fuel[i]),
TextDrawHideForPlayer(i, BlackBox),
TextDrawHideForPlayer(i, Moving[i]);
GameTextForPlayer(i, " ", 100, 3);
TogglePlayerControllable(i, true);
}
++i;
}
return 1;
}

public OnVehicleSpawn(vehicleid)
{
Benzin[vehicleid] = random(100);
}

public OnPlayerConnect(playerid)
{
PortableFuel[playerid] = false;
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
TextDrawHideForPlayer(playerid, Fuel[playerid]);
TextDrawHideForPlayer(playerid, Moving[playerid]);
TextDrawHideForPlayer(playerid, BlackBox);
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
TextDrawHideForPlayer(playerid, Fuel[playerid]);
TextDrawHideForPlayer(playerid, Moving[playerid]);
TextDrawHideForPlayer(playerid, BlackBox);
return 1;
}

dcmd_fill (playerid, params[])
{
new
miktar,
string[128],
string2[128],
string3[128],
string4[128],
Fiyat,
Sum;

if (!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, ">> You are not in any vehicle to refill!");
if (!IsAtGasStation(playerid)) return SendClientMessage(playerid, COLOR_RED, ">> You are not in a gas station!");
if (!strlen(params)) return SendClientMessage(playerid, COLOR_RED, ">> /fill [amount in 0 - 100 l]");
miktar = strval(params);
if (miktar < 1 || miktar > 100) return SendClientMessage(playerid, COLOR_RED, ">> Wrong amount in liters! (0-100l)");
if (Benzin[GetPlayerVehicleID(playerid)] >= 100) return SendClientMessage(playerid, COLOR_RED, ">> You can't refill. Your car is full!");
Fiyat = (miktar * 2);
format(string2, 128, ">> You don't have money enough! You need $%d.", Fiyat);
if (GetPlayerMoney(playerid) < Fiyat) return SendClientMessage(playerid, COLOR_RED, string2);
GivePlayerMoney(playerid, -Fiyat);
format(string, 128, ">> You have filled your vehicle for %d liters. Cost: $%d.", miktar, Fiyat);
SendClientMessage(playerid, COLOR_LIME, string);
Benzin[GetPlayerVehicleID(playerid)] += miktar;
if (Benzin[GetPlayerVehicleID(playerid)] > 100) Sum = miktar*2-Benzin[GetPlayerVehicleID(playerid)]+100, GivePlayerMoney(playerid, Sum), format(string4, 128, ">> You have choose a too large amount of liters that your car can't accept. Here's your change($%d).", Sum), SendClientMessage(playerid, COLOR_ORANGE, string4), Benzin[GetPlayerVehicleID(playerid)] = 100;
format(string3, 128, "Fuel: %%%d", Benzin[GetPlayerVehicleID(playerid)]);
TextDrawSetString(Fuel[playerid], string3),
TextDrawShowForPlayer(playerid, Fuel[playerid]),
TextDrawTextSize(Moving[playerid], (354.0 - (Benzin[GetPlayerVehicleID(playerid)] / DIVBY)), 0.000000),
TextDrawShowForPlayer(playerid, Moving[playerid]);
return 1;
}

dcmd_buyfuel (playerid, params[])
{
#pragma unused params
if (!IsAtGasStation(playerid)) return SendClientMessage(playerid, COLOR_RED, ">> You are not in a gas station!");
if (PortableFuel[playerid] == true) return SendClientMessage(playerid, COLOR_RED, ">> You can't have more than one tank.");
SendClientMessage(playerid, COLOR_LIME, ">> You have bought a little fuel tank. You can use it when your fuel is low. (/usefuel)");
PortableFuel[playerid] = true;
return 1;
}

dcmd_usefuel (playerid, params[])
{
new
string[128];

#pragma unused params
if (!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, ">> You are not in any vehicle!");
if (PortableFuel[playerid] == false) return SendClientMessage(playerid, COLOR_RED, ">> You don't have a fuel tank with you. Buy one by writing /buyfuel.");
if (Benzin[GetPlayerVehicleID(playerid)] >= 40) return SendClientMessage(playerid, COLOR_RED, ">> You have fuel enough.");
SendClientMessage(playerid, COLOR_LIME, ">> You used your fuel tank. (Fuel +25)");
Benzin[GetPlayerVehicleID(playerid)] += 25;
PortableFuel[playerid] = false;
format(string, 128, "Fuel: %%%d", Benzin[GetPlayerVehicleID(playerid)]);
TextDrawSetString(Fuel[playerid], string),
TextDrawShowForPlayer(playerid, Fuel[playerid]),
TextDrawTextSize(Moving[playerid], (354.0 - (Benzin[GetPlayerVehicleID(playerid)] / DIVBY)), 0.000000),
TextDrawShowForPlayer(playerid, Moving[playerid]);
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd (fill, 4, cmdtext);
dcmd (buyfuel, 7, cmdtext);
dcmd (usefuel, 7, cmdtext);
return 0;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
new
string[128],
string2[128];


if(newstate == PLAYER_STATE_DRIVER)
{
format(string, 128, "Fuel: %%%d", Benzin[GetPlayerVehicleID(playerid)]);
TextDrawSetString(Fuel[playerid], string),
TextDrawShowForPlayer(playerid, Fuel[playerid]),
TextDrawShowForPlayer(playerid, BlackBox),
TextDrawTextSize(Moving[playerid], (354.0 - (Benzin[GetPlayerVehicleID(playerid)] / DIVBY)), 0.000000),
TextDrawShowForPlayer(playerid, Moving[playerid]);
if (Benzin[GetPlayerVehicleID(playerid)] < 1)
{
Benzin[GetPlayerVehicleID(playerid)] = 1;
format(string2, 128, "Fuel: %%%d", Benzin[GetPlayerVehicleID(playerid)]);
TextDrawSetString(Fuel[playerid], string2),
TextDrawShowForPlayer(playerid, Fuel[playerid]),
TextDrawTextSize(Moving[playerid], (354.0 - (Benzin[GetPlayerVehicleID(playerid)] / DIVBY)), 0.000000),
TextDrawShowForPlayer(playerid, Moving[playerid]);
}
if(Benzin[GetPlayerVehicleID(playerid)] < 1)
{
Benzin[GetPlayerVehicleID(playerid)] = 0;
GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~w~You don't have fuel in your vehicle.", 4000, 3);
RemovePlayerFromVehicle(playerid);
}
}
else if (newstate == PLAYER_STATE_ONFOOT)
{
TextDrawHideForPlayer(playerid, Fuel[playerid]),
TextDrawHideForPlayer(playerid, BlackBox),
TextDrawHideForPlayer(playerid, Moving[playerid]);
TogglePlayerControllable(playerid, true);
}
return 1;
}

stock IsAtGasStation(playerid)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid, 6.0,1004.0070,-939.3102,42.1797) || IsPlayerInRangeOfPoint(playerid, 6.0,1944.3260,-1772.9254,13.3906))
{
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid, 6.0,-90.5515,-1169.4578,2.4079) || IsPlayerInRangeOfPoint(playerid, 6.0,-1609.7958,-2718.2048,48.5391))
{
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid, 6.0,-2029.4968,156.4366,28.9498) || IsPlayerInRangeOfPoint(playerid, 8.0,-2408.7590,976.0934,45.4175))
{
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid, 5.0, -2243.9629,-2560.6477,31.8841) || IsPlayerInRangeOfPoint(playerid, 8.0,-1676.6323,414.0262,6.9484))
{
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid, 6.0,2202.2349,2474.3494,10.5258) || IsPlayerInRangeOfPoint(playerid, 10.0, 614.9333,1689.7418,6.6968))
{
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid, 8.0,-1328.8250,2677.2173,49.7665) || IsPlayerInRangeOfPoint(playerid, 6.0,70.3882,1218.6783,18.5165))
{
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid, 8.0,2113.7390,920.1079,10.5255) || IsPlayerInRangeOfPoint(playerid, 6.0,-1327.7218,2678.8723,50.0625))
{
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid, 12.0,1596.2595,2199.3120,10.8203))
{
return 1;
}
}
return 0;
}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.