Brzinomjer:
//////Brzinomjer////////
//////Napravio://///////
///////Fallout////////////
//POZOR!!
//*Ovaj FS je napravljen kao korist za RP server
//*Ovaj FS je zasticen i nesmije se zloupotrijebiti
//*Mozete ako zelite napraviti edit pa kad postati na forumu
//Ono sto je iznad include to vam sluzi za snalazenje kada pritisnete CTRL+F
//*Hvala na paznji.
//-------Include-----
#include
//-------Forward-----
forward CheckStatus();
forward Brzinomjer();
//-------Auti-------
new PlayerVehicle[] = {
"Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel", "Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana",
"Infernus", "Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam", "Esperanto", "Taxi", "Washington", "Bobcat",
"Whoopee", "BF Injection", "Hunter", "Premier", "Enforcer", "Securicar", "Banshee", "Predator", "Bus", "Rhino", "Barracks", "Hotknife",
"Trailer 1", "Previon", "Coach", "Cabbie", "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral", "Squalo",
"Seasparrow", "Pizzaboy", "Tram", "Trailer 2", "Turismo", "Speeder", "Reefer", "Tropic", "Flatbed", "Yankee", "Caddy", "Solair",
"Berkley's RC Van", "Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale", "Oceanic", "Sanchez", "Sparrow",
"Patriot", "Quad", "Coastguard", "Dinghy", "Hermes", "Sabre", "Rustler", "ZR-350", "Walton", "Regina", "Comet", "BMX", "Burrito",
"Camper", "Marquis", "Baggage", "Dozer", "Maverick", "News Chopper", "Rancher", "FBI Rancher", "Virgo", "Greenwood", "Jetmax", "Hotring",
"Sandking", "Blista Compact", "Police Maverick", "Boxvillde", "Benson", "Mesa", "RC Goblin", "Hotring Racer A", "Hotring Racer B",
"Bloodring Banger", "Rancher", "Super GT", "Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropduster","Stunt", "Tanker",
"Roadtrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra", "FCR-900", "NRG-500", "HPV1000", "Cement Truck", "Tow Truck", "Fortune",
"Cadrona", "FBI Truck", "Willard", "Forklift", "Tractor", "Combine", "Feltzer", "Remington", "Slamvan", "Blade", "Freight", "Streak",
"Vortex", "Vincent", "Bullet", "Clover", "Sadler", "Firetruck LA", "Hustler", "Intruder", "Primo", "Cargobob", "Tampa", "Sunrise", "Merit",
"Utility", "Nevada", "Yosemite", "Windsor", "Monster A", "Monster B", "Uranus", "Jester", "Sultan", "Stratum", "Elegy", "Raindance",
"RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito", "Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper", "Broadway",
"Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400", "News Van", "Tug", "Trailer 3", "Emperor", "Wayfarer", "Euros", "Hotdog",
"Club", "Freight Carriage", "Trailer 4", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car (LSPD)", "Police Car (SFPD)",
"Police Car (LVPD)", "Police Ranger", "Picador", "S.W.A.T", "Alpha", "Phoenix", "Glendale", "Sadler", "Luggage Trailer A",
"Luggage Trailer B", "Stairs", "Boxville", "Tiller", "Utility Trailer" };
//-----Boolemes(preuzeo sam sa jednoga GM-a)------
new bool:TextDrawsShown;
new bool:LightRedHealthCreated;
new bool:LightYellowSpeedCreated;
new bool:VHSCreated;
new bool:ExclamationShown;
//-------Sat----
new CheckStatusTimer;
//------Tekst-----
new Text:Black0;
new Text:White1;
new Text:White2;
new Text:BlackHealth;
new Text:DarkRedHealth;
new Text:BlackSpeed;
new Text:DarkYellowSpeed;
new Text:Marker;
new Text:Exclamation;
//-----Tekst 2-----
new Text:VHS;
new Text:LightRedHealth;
new Text:LightYellowSpeed;
//------Brzina----
new Float:OldX;
new Float:OldY;
new Float:OldZ;
//------OnFilterScriptInit----
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" ~Brzinomjer by FallOut~");
print("--------------------------------------\n");
SetTimer("Brzinomjer", 1000, 1);
return 1;
}
Black0 = TextDrawCreate(481.000000,353.000000,"_");
TextDrawUseBox(Black0,1);
TextDrawBoxColor(Black0,0x00000044);
TextDrawTextSize(Black0,596.000000,0.000000);
TextDrawAlignment(Black0,0);
TextDrawBackgroundColor(Black0,0x000000ff);
TextDrawFont(Black0,3);
TextDrawLetterSize(Black0,3.599999,7.599996);
TextDrawColor(Black0,0xffffffff);
TextDrawSetOutline(Black0,1);
TextDrawSetProportional(Black0,1);
TextDrawSetShadow(Black0,1);
White1 = TextDrawCreate(482.000000,354.000000,"_");
TextDrawUseBox(White1,1);
TextDrawBoxColor(White1,0xffffff11);
TextDrawTextSize(White1,595.000000,-2.000000);
TextDrawAlignment(White1,0);
TextDrawBackgroundColor(White1,0x000000ff);
TextDrawFont(White1,1);
TextDrawLetterSize(White1,1.700000,7.399997);
TextDrawColor(White1,0xffffffff);
TextDrawSetOutline(White1,1);
TextDrawSetProportional(White1,1);
TextDrawSetShadow(White1,1);
White2 = TextDrawCreate(483.000000,355.000000,"_");
TextDrawUseBox(White2,1);
TextDrawBoxColor(White2,0xffffff22);
TextDrawTextSize(White2,594.000000,0.000000);
TextDrawAlignment(White2,0);
TextDrawBackgroundColor(White2,0x000000ff);
TextDrawFont(White2,1);
TextDrawLetterSize(White2,0.299999,7.199996);
TextDrawColor(White2,0xffffffff);
TextDrawSetOutline(White2,1);
TextDrawSetProportional(White2,1);
TextDrawSetShadow(White2,1);
BlackHealth = TextDrawCreate(487.000000,385.000000,"_");
TextDrawUseBox(BlackHealth,1);
TextDrawBoxColor(BlackHealth,0x00000099);
TextDrawTextSize(BlackHealth,590.000000,-11.000000);
TextDrawAlignment(BlackHealth,0);
TextDrawBackgroundColor(BlackHealth,0x000000ff);
TextDrawFont(BlackHealth,3);
TextDrawLetterSize(BlackHealth,1.000000,0.399999);
TextDrawColor(BlackHealth,0xffffffff);
TextDrawSetOutline(BlackHealth,1);
TextDrawSetProportional(BlackHealth,1);
TextDrawSetShadow(BlackHealth,1);
DarkRedHealth = TextDrawCreate(488.000000,386.000000,"_");
TextDrawUseBox(DarkRedHealth,1);
TextDrawBoxColor(DarkRedHealth,0xff000066);
TextDrawTextSize(DarkRedHealth,589.000000,0.000000);
TextDrawAlignment(DarkRedHealth,0);
TextDrawBackgroundColor(DarkRedHealth,0x000000ff);
TextDrawFont(DarkRedHealth,3);
TextDrawLetterSize(DarkRedHealth,1.000000,0.199999);
TextDrawColor(DarkRedHealth,0xffffffff);
TextDrawSetOutline(DarkRedHealth,1);
TextDrawSetProportional(DarkRedHealth,1);
TextDrawSetShadow(DarkRedHealth,1);
BlackSpeed = TextDrawCreate(536.000000,403.000000,"_");
TextDrawUseBox(BlackSpeed,1);
TextDrawBoxColor(BlackSpeed,0x00000099);
TextDrawTextSize(BlackSpeed,590.000000,0.000000);
TextDrawAlignment(BlackSpeed,0);
TextDrawBackgroundColor(BlackSpeed,0x000000ff);
TextDrawFont(BlackSpeed,3);
TextDrawLetterSize(BlackSpeed,1.000000,1.400000);
TextDrawColor(BlackSpeed,0xffffffff);
TextDrawSetOutline(BlackSpeed,1);
TextDrawSetShadow(BlackSpeed,1);
TextDrawSetProportional(BlackSpeed,1);
DarkYellowSpeed = TextDrawCreate(537.000000,404.000000,"_");
TextDrawUseBox(DarkYellowSpeed,1);
TextDrawBoxColor(DarkYellowSpeed,0xffff0033);
TextDrawTextSize(DarkYellowSpeed,589.000000,0.000000);
TextDrawAlignment(DarkYellowSpeed,0);
TextDrawBackgroundColor(DarkYellowSpeed,0x000000ff);
TextDrawFont(DarkYellowSpeed,3);
TextDrawLetterSize(DarkYellowSpeed,1.000000,1.200000);
TextDrawColor(DarkYellowSpeed,0xffffffff);
TextDrawSetOutline(DarkYellowSpeed,1);
TextDrawSetProportional(DarkYellowSpeed,1);
TextDrawSetShadow(DarkYellowSpeed,1);
Marker = TextDrawCreate(511.000000,382.000000,"l");
TextDrawAlignment(Marker,0);
TextDrawBackgroundColor(Marker,0x000000ff);
TextDrawFont(Marker,1);
TextDrawLetterSize(Marker,0.099999,1.000000);
TextDrawColor(Marker,0xffffffff);
TextDrawSetOutline(Marker,1);
TextDrawSetProportional(Marker,1);
TextDrawSetShadow(Marker,1);
Exclamation = TextDrawCreate(579.000000,351.000000,"~r~!");
TextDrawAlignment(Exclamation,0);
TextDrawBackgroundColor(Exclamation,0x000000ff);
TextDrawFont(Exclamation,2);
TextDrawLetterSize(Exclamation,1.200000,3.399999);
TextDrawColor(Exclamation,0xffffffff);
TextDrawSetOutline(Exclamation,1);
TextDrawSetProportional(Exclamation,1);
TextDrawSetShadow(Exclamation,1);
CheckStatusTimer = SetTimer("CheckStatus", 1000, 1);
}
//-----OnFilterScriptExit------
public OnFilterScriptExit()
{
KillTimer(CheckStatusTimer);
TextDrawDestroy(Text:Black0);
TextDrawDestroy(Text:White1);
TextDrawDestroy(Text:White2);
TextDrawDestroy(Text:BlackHealth);
TextDrawDestroy(Text:DarkRedHealth);
TextDrawDestroy(Text:BlackSpeed);
TextDrawDestroy(Text:DarkYellowSpeed);
TextDrawDestroy(Text:Marker);
TextDrawDestroy(Text:Exclamation);
for(new i=0; i {
TextDrawDestroy(Text:VHS);
TextDrawDestroy(Text:LightRedHealth);
TextDrawDestroy(Text:LightYellowSpeed);
}
}
//----OnPlayerConnect-----
public OnPlayerConnect(playerid)
{
new pname, string[22 + MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s se prikljucio na server", pname);
SendClientMessageToAll(0xAAAAAAAA, string);
return 1;
}
//------Provjera(uzeto iz jednog GM-a)----------
public CheckStatus()
{
for(new i=0; i {
if(IsPlayerConnected(i))
{
if(IsPlayerInAnyVehicle(i))
{
//--------Tekst 3-------
if(TextDrawsShown == false)
{
TextDrawShowForPlayer(i, Text:Black0);
TextDrawShowForPlayer(i, Text:White1);
TextDrawShowForPlayer(i, Text:White2);
TextDrawShowForPlayer(i, Text:BlackHealth);
TextDrawShowForPlayer(i, Text:DarkRedHealth);
TextDrawShowForPlayer(i, Text:BlackSpeed);
TextDrawShowForPlayer(i, Text:DarkYellowSpeed);
TextDrawShowForPlayer(i, Text:Marker);
TextDrawsShown = true;
}
//-----Brzinomjer------
new String;
new Float:X, Float:Y, Float:Z, Float:Distance;
GetPlayerPos(i, X, Y, Z);
Distance = floatsqroot(floatadd(floatadd(floatpower(floatsub(X, OldX), 2), floatpower(floatsub(Y, OldY), 2)), floatpower(floatsub(Z, OldZ), 2)));
new PlayerVehicleModelID = GetVehicleModel(GetPlayerVehicleID(i));
PlayerVehicleModelID -= 400;
format(String,sizeof(String),"~b~Vozilo:~n~~w~%s~n~~b~Energija:~n~~n~Brzina:~n~~w~%im/h~n~%ikm/h~n~Napravio:kizla~n~", PlayerVehicle, floatround(floatmul(floatdiv(Distance, 1.609344), 2.0), floatround_floor), floatround(floatmul(Distance, 2.0), floatround_floor)); //Ovdije stavljate ono sto zelite vidjeti u vasem brzinomjeru(Ime vozila,gorivo,brzina...)
if(VHSCreated == true)
{
TextDrawDestroy(VHS);
}
VHS = TextDrawCreate(485.000000,355.000000,String);
TextDrawAlignment(VHS,0);
TextDrawBackgroundColor(VHS,0x000000ff);
TextDrawFont(VHS,1);
TextDrawLetterSize(VHS,0.299999,1.000000);
TextDrawColor(VHS,0xffffffff);
TextDrawSetOutline(VHS,1);
TextDrawSetProportional(VHS,1);
TextDrawSetShadow(VHS,1);
TextDrawShowForPlayer(i, VHS);
VHSCreated = true;
//-----Energija auta-----
new Float:CarHealth;
GetVehicleHealth(GetPlayerVehicleID(i), CarHealth);
if(LightRedHealthCreated == true)
{
TextDrawDestroy(LightRedHealth);
}
LightRedHealth = TextDrawCreate(488.000000,386.000000,"_");
TextDrawUseBox(LightRedHealth,1);
TextDrawBoxColor(LightRedHealth,0xff000099);
TextDrawTextSize(LightRedHealth, floatadd(484.0, floatdiv(CarHealth, 9.5238095238)),0.000000);
TextDrawAlignment(LightRedHealth,0);
TextDrawBackgroundColor(LightRedHealth,0x000000ff);
TextDrawFont(LightRedHealth,3);
TextDrawLetterSize(LightRedHealth,1.000000,0.199999);
TextDrawColor(LightRedHealth,0xffffffff);
TextDrawSetOutline(LightRedHealth,1);
TextDrawSetProportional(LightRedHealth,1);
TextDrawSetShadow(LightRedHealth,1);
TextDrawShowForPlayer(i, LightRedHealth);
LightRedHealthCreated = true;
if(CarHealth < 250)
{
if(ExclamationShown == true)
{
TextDrawHideForPlayer(i, Text:Exclamation);
ExclamationShown = false;
}
else
{
TextDrawShowForPlayer(i, Text:Exclamation);
ExclamationShown = true;
}
}
else if(CarHealth > 250)
{
if(ExclamationShown == true)
{
TextDrawHideForPlayer(i, Text:Exclamation);
ExclamationShown = false;
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if(LightYellowSpeedCreated == true)
{
TextDrawDestroy(LightYellowSpeed);
}
LightYellowSpeed = TextDrawCreate(537.000000,404.000000,"_");
TextDrawUseBox(LightYellowSpeed,1);
TextDrawBoxColor(LightYellowSpeed,0xffff0066);
if(Distance >= 75)
{
TextDrawTextSize(LightYellowSpeed,589.000000,0.000000);
}
else
{
TextDrawTextSize(LightYellowSpeed, floatadd(533.0, floatdiv(Distance, 1.33928571428)),0.000000);
}
TextDrawAlignment(LightYellowSpeed,0);
TextDrawBackgroundColor(LightYellowSpeed,0x000000ff);
TextDrawFont(LightYellowSpeed,3);
TextDrawLetterSize(LightYellowSpeed,1.000000,1.200000);
TextDrawColor(LightYellowSpeed,0xffffffff);
TextDrawSetOutline(LightYellowSpeed,1);
TextDrawSetProportional(LightYellowSpeed,1);
TextDrawSetShadow(LightYellowSpeed,1);
TextDrawShowForPlayer(i, LightYellowSpeed);
LightYellowSpeedCreated = true;
//------To sam preuzeo----------
OldX = X; OldY = Y; OldZ = Z;
//-----Boje na brzinomjeru-------
}
else
{
if(TextDrawsShown == true)
{
TextDrawHideForPlayer(i, Text:Black0);
TextDrawHideForPlayer(i, Text:White1);
TextDrawHideForPlayer(i, Text:White2);
TextDrawHideForPlayer(i, Text:BlackHealth);
TextDrawHideForPlayer(i, Text:DarkRedHealth);
TextDrawHideForPlayer(i, Text:BlackSpeed);
TextDrawHideForPlayer(i, Text:DarkYellowSpeed);
TextDrawHideForPlayer(i, Text:Marker);
TextDrawHideForPlayer(i, Text:Exclamation);
TextDrawsShown = false;
}
TextDrawHideForPlayer(i, Text:VHS);
TextDrawHideForPlayer(i, Text:LightRedHealth);
TextDrawHideForPlayer(i, Text:LightGreenSpeed);
}
}
}
}
//*Eto ga ovo je kraj ovoga FS-a,nadam se da ste zadovoljni.
Sutra cu dodati AFK system koji je razor rekao da svako moze napraviti 🙂
Napravio:FallOut
Objavio:kizla
