Sziasztok! Eredeti fórumról hoztam el nektek ezt a kis FilterScriptet!
A scriptet készítette : Jarnu
Fordította : Bencuskaa
Fordítás ideje : 5perc
Eredeti Link : http://forum.sa-mp.com/showthread.php?t=384115
Videó : Eredei Linknél
Remélem felhasználjátok páran /*
A Scriptet készítette Jarnu
A Scriptet fordította Bencuskaa
*/
#include <a_samp>
new Text:vSpeed[MAX_PLAYERS];
new Text:Vehicle[MAX_PLAYERS];
new Text:vHealth[MAX_PLAYERS];
new Text:Textdraw3;
new Text:Textdraw4;
new Text:Textdraw5;
new Text:Textdraw6;
new Speed[MAX_PLAYERS];
/*
Jármû nevek
*/
new VehicleNames[][] =
{
\"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\", \"Previon\", \"Coach\", \"Cabbie\",
\"Stallion\", \"Rumpo\", \"RC Bandit\", \"Romero\", \"Packer\", \"Monster\", \"Admiral\",
\"Squalo\", \"Seasparrow\", \"Pizzaboy\", \"Tram\", \"Trailer\", \"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\", \"Hustler\", \"Intruder\", \"Primo\",
\"Cargobob\", \"Tampa\", \"Sunrise\", \"Merit\", \"Utility\", \"Nevada\", \"Yosemite\",
\"Windsor\", \"Monster\", \"Monster\", \"Uranus\", \"Jester\", \"Sultan\", \"Stratium\",
\"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\", \"Emperor\", \"Wayfarer\", \"Euros\", \"Hotdog\", \"Club\",
\"Freight Box\", \"Trailer\", \"Andromada\", \"Dodo\", \"RC Cam\", \"Launch\", \"Police Car\",
\"Police Car\", \"Police Car\", \"Police Ranger\", \"Picador\", \"S.W.A.T\", \"Alpha\",
\"Phoenix\", \"Glendale\", \"Sadler\", \"Luggage\", \"Luggage\", \"Stairs\", \"Boxville\",
\"Tiller\", \"Utility Trailer\"
};
public OnFilterScriptInit()
{
print(\"Speedo-meter by Jarnu was loaded!\");
SetTimer(\"UpdateSpeed\", 180, true); //Sebességmérõ Frissítése
return 1;
}
public OnFilterScriptExit()
{
TextDrawHideForAll(Textdraw3);
TextDrawDestroy(Textdraw3);
return 1;
}
public OnPlayerConnect(playerid)
{
vSpeed[playerid] = TextDrawCreate(240.000000, 370.000000, \"Speed: 0 KM/H\");
TextDrawBackgroundColor(vSpeed[playerid], 255);
TextDrawFont(vSpeed[playerid], 1);
TextDrawLetterSize(vSpeed[playerid], 0.490000, 1.700000);
TextDrawColor(vSpeed[playerid], -100693846);
TextDrawSetOutline(vSpeed[playerid], 0);
TextDrawSetProportional(vSpeed[playerid], 1);
TextDrawSetShadow(vSpeed[playerid], 1);
Vehicle[playerid] = TextDrawCreate(240.000000, 387.000000, \"Vehicle: -\");
TextDrawBackgroundColor(Vehicle[playerid], 255);
TextDrawFont(Vehicle[playerid], 1);
TextDrawLetterSize(Vehicle[playerid], 0.490000, 1.700000);
TextDrawColor(Vehicle[playerid], -111321686);
TextDrawSetOutline(Vehicle[playerid], 0);
TextDrawSetProportional(Vehicle[playerid], 1);
TextDrawSetShadow(Vehicle[playerid], 1);
vHealth[playerid] = TextDrawCreate(240.000000, 404.000000, \"Health: -\");
TextDrawBackgroundColor(vHealth[playerid], 255);
TextDrawFont(vHealth[playerid], 1);
TextDrawLetterSize(vHealth[playerid], 0.490000, 1.700000);
TextDrawColor(vHealth[playerid], 2030005418);
TextDrawSetOutline(vHealth[playerid], 0);
TextDrawSetProportional(vHealth[playerid], 1);
TextDrawSetShadow(vHealth[playerid], 1);
Textdraw3 = TextDrawCreate(313.000000, 440.000000, \"_\");
TextDrawAlignment(Textdraw3, 2);
TextDrawBackgroundColor(Textdraw3, 255);
TextDrawFont(Textdraw3, 1);
TextDrawLetterSize(Textdraw3, 0.500000, -9.000000);
TextDrawColor(Textdraw3, -100693846);
TextDrawSetOutline(Textdraw3, 0);
TextDrawSetProportional(Textdraw3, 1);
TextDrawSetShadow(Textdraw3, 1);
TextDrawUseBox(Textdraw3, 1);
TextDrawBoxColor(Textdraw3, -222);
TextDrawTextSize(Textdraw3, 0.000000, -160.000000);
Textdraw4 = TextDrawCreate(241.000000, 355.000000, \"-------------------\");
TextDrawBackgroundColor(Textdraw4, 0xFF0000FF);
TextDrawFont(Textdraw4, 1);
TextDrawLetterSize(Textdraw4, 0.500000, 1.000000);
TextDrawColor(Textdraw4, -1);
TextDrawSetOutline(Textdraw4, 1);
TextDrawSetProportional(Textdraw4, 1);
Textdraw5 = TextDrawCreate(241.000000, 430.000000, \"-------------------\");
TextDrawBackgroundColor(Textdraw5, 0xFF0000FF);
TextDrawFont(Textdraw5, 1);
TextDrawLetterSize(Textdraw5, 0.500000, 1.000000);
TextDrawColor(Textdraw5, -1);
TextDrawSetOutline(Textdraw5, 1);
TextDrawSetProportional(Textdraw5, 1);
Textdraw6 = TextDrawCreate(339.000000, 394.000000, \"_\");
TextDrawAlignment(Textdraw6, 2);
TextDrawBackgroundColor(Textdraw6, 255);
TextDrawFont(Textdraw6, 1);
TextDrawLetterSize(Textdraw6, 0.700000, -3.099999);
TextDrawColor(Textdraw6, -1);
TextDrawSetOutline(Textdraw6, 0);
TextDrawSetProportional(Textdraw6, 1);
TextDrawSetShadow(Textdraw6, 1);
TextDrawUseBox(Textdraw6, 1);
TextDrawBoxColor(Textdraw6, 85);
TextDrawTextSize(Textdraw6, 43.000000, -94.000000);
return 1;
}
forward UpdateSpeed();
public UpdateSpeed()
{
new Float:vHeal;
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerInAnyVehicle(i))
{
new veh = GetPlayerVehicleID(i);
GetVehicleHealth(veh, vHeal);
new Float:x, Float:y, Float:z, Float:Speeed;
GetVehicleVelocity(GetPlayerVehicleID(i), x, y, z);
Speeed = floatmul(floatsqroot(floatadd(floatadd(floatpower(x, 2), floatpower(y, 2)), floatpower(z, 2))), 100.0);
Speed = floatround(floatdiv(Speeed, 0.75), floatround_floor);
TextDrawShowForPlayer(i, vSpeed);
TextDrawShowForPlayer(i, Vehicle);
TextDrawShowForPlayer(i, vHealth);
TextDrawShowForPlayer(i, Textdraw3);
TextDrawShowForPlayer(i, Textdraw4);
TextDrawShowForPlayer(i, Textdraw5);
TextDrawShowForPlayer(i, Textdraw6);
new str[100], str1[100], str2[100];
format(str, sizeof(str),\"Sebesség: ~y~%d KM/H\", Speed);
TextDrawSetString(vSpeed, str);
format(str1,sizeof(str1),\"Jármû: ~g~%s\",VehicleNames[GetVehicleModel(GetPlayerVehicleID(i))-400]);
TextDrawSetString(Vehicle, str1);
format(str2, sizeof(str2),\"Élet: ~r~%.2f\", vHeal);
TextDrawSetString(vHealth, str2);
}
else if(!IsPlayerInAnyVehicle(i))
{
TextDrawHideForPlayer(i, vSpeed);
TextDrawHideForPlayer(i, Vehicle);
TextDrawHideForPlayer(i, vHealth);
TextDrawHideForPlayer(i, Textdraw3);
TextDrawHideForPlayer(i, Textdraw4);
TextDrawHideForPlayer(i, Textdraw5);
TextDrawHideForPlayer(i, Textdraw6);
}
}
return 1;
}