- 0
Cum sa inlocuiesc in loc de height , fuel.
-
Recently Browsing 0 members
- No registered users viewing this page.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.
Question
TheodoR
Nick: TheodoR
Problema: Vreau sa inlocuiesc height si sa pun fuel in loc si nu stiu cum.
Erori / warnings:
Lini/script:[pawn]#include <a_samp>
#include <zcmd>
#include <sscanf2>
#define CO_RED 0xFF0000FF
#define CO_GREEN 0x00FF00FF
//------------------------------------------------------------------------------//
new Text:Line[6];
new Text:Name[MAX_PLAYERS];
new Text:Speed[MAX_PLAYERS];
new Text:HP[MAX_PLAYERS];
new Text:HG[MAX_PLAYERS];
new Speedo[MAX_PLAYERS];
new vtimer;
new VehicleNames[212][] = // didnt created by me
{
{"Landstalker"},{"Bravura"},{"Buffalo"},{"Linerunner"},{"Perrenial"},{"Sentinel"},{"Dumper"},
{"Firetruck"},{"Trashmaster"},{"Stretch"},{"Manana"},{"Infernus"},{"Voodoo"},{"Pony"},{"Mule"},
{"Cheetah"},{"Ambulance"},{"Leviathan"},{"Moonbeam"},{"Esperanto"},{"Taxi"},{"Washington"},
{"Bobcat"},{"Mr 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 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"},{"Boxville"},{"Benson"},
{"Mesa"},{"RCGoblin"},{"HotRacer A"},{"HotRacer B"},{"Bloodring Banger"},{"Rancher"},
{"Super GT"},{"Elegant"},{"Journey"},{"Bike"},{"Mountain Bike"},{"Beagle"},{"Cropdust"},{"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"},{"Duneride"},{"Sweeper"},
{"Broadway"},{"Tornado"},{"AT-400"},{"DFT-30"},{"Huntley"},{"Stafford"},{"BF-400"},{"Newsvan"},
{"Tug"},{"Trailer 3"},{"Emperor"},{"Wayfarer"},{"Euros"},{"Hotdog"},{"Club"},{"Freight Carriage"},
{"Trailer 3"},{"Andromada"},{"Dodo"},{"RC Cam"},{"Launch"},{"Police Car"},{"SFPD"},
{"LVPD"},{"Police Ranger"},{"Picador"},{"S.W.A.T. Van"},{"Alpha"},{"Phoenix"},{"Glendale"},
{"Sadler"},{"LuTrailer A"},{"LuTrailer B"},{"Stair Trailer"},{"Boxville"},{"Farm Plow"},
{"Utility Trailer"}
};
//------------------------------------------------------------------------------//
public OnFilterScriptInit()
{
print("|------------------------------------------------- |");
print("| dEcooR's Speedo Meteter |");
print("| was successfuly loaded.. |");
print("|------------------------------------------------- |");
vtimer = SetTimer("SpeedoMeter",350,1);
Line[0] = TextDrawCreate(613.000000, 361.000000, "_");
TextDrawBackgroundColor(Line[0], 255);
TextDrawFont(Line[0], 1);
TextDrawLetterSize(Line[0], 0.500000, 6.599998);
TextDrawColor(Line[0], -1);
TextDrawSetOutline(Line[0], 0);
TextDrawSetProportional(Line[0], 1);
TextDrawSetShadow(Line[0], 1);
TextDrawUseBox(Line[0], 1);
TextDrawBoxColor(Line[0], 51);
TextDrawTextSize(Line[0], 491.000000, 61.000000);
Line[1] = TextDrawCreate(496.000000, 423.000000, "_");
TextDrawBackgroundColor(Line[1], 255);
TextDrawFont(Line[1], 1);
TextDrawLetterSize(Line[1], 0.520000, -0.199999);
TextDrawColor(Line[1], -1);
TextDrawSetOutline(Line[1], 0);
TextDrawSetProportional(Line[1], 1);
TextDrawSetShadow(Line[1], 1);
TextDrawUseBox(Line[1], 1);
TextDrawBoxColor(Line[1], 255);
TextDrawTextSize(Line[1], 609.000000, 0.000000);
Line[2] = TextDrawCreate(495.000000, 362.000000, "_");
TextDrawBackgroundColor(Line[2], 255);
TextDrawFont(Line[2], 1);
TextDrawLetterSize(Line[2], 0.500000, 6.599998);
TextDrawColor(Line[2], -1);
TextDrawSetOutline(Line[2], 0);
TextDrawSetProportional(Line[2], 1);
TextDrawSetShadow(Line[2], 1);
TextDrawUseBox(Line[2], 1);
TextDrawBoxColor(Line[2], 255);
TextDrawTextSize(Line[2], 493.000000, 0.000000);
Line[3] = TextDrawCreate(612.000000, 362.000000, "_");
TextDrawBackgroundColor(Line[3], 255);
TextDrawFont(Line[3], 1);
TextDrawLetterSize(Line[3], 0.500000, 6.599998);
TextDrawColor(Line[3], -1);
TextDrawSetOutline(Line[3], 0);
TextDrawSetProportional(Line[3], 1);
TextDrawSetShadow(Line[3], 1);
TextDrawUseBox(Line[3], 1);
TextDrawBoxColor(Line[3], 255);
TextDrawTextSize(Line[3], 610.000000, 0.000000);
Line[4] = TextDrawCreate(495.000000, 361.000000, "_");
TextDrawBackgroundColor(Line[4], 255);
TextDrawFont(Line[4], 1);
TextDrawLetterSize(Line[4], 0.500000, -0.200000);
TextDrawColor(Line[4], -1);
TextDrawSetOutline(Line[4], 0);
TextDrawSetProportional(Line[4], 1);
TextDrawSetShadow(Line[4], 1);
TextDrawUseBox(Line[4], 1);
TextDrawBoxColor(Line[4], 255);
TextDrawTextSize(Line[4], 610.000000, 0.000000);
Line[5] = TextDrawCreate(496.000000, 377.000000, "_");
TextDrawBackgroundColor(Line[5], 255);
TextDrawFont(Line[5], 1);
TextDrawLetterSize(Line[5], 0.500000, -0.200000);
TextDrawColor(Line[5], -1);
TextDrawSetOutline(Line[5], 0);
TextDrawSetProportional(Line[5], 1);
TextDrawSetShadow(Line[5], 1);
TextDrawUseBox(Line[5], 1);
TextDrawBoxColor(Line[5], 255);
TextDrawTextSize(Line[5], 610.000000, 0.000000);
for(new i=0; i<MAX_PLAYERS; i++)
{
Speedo = 1;
Name = TextDrawCreate(500.000000, 362.000000, " ");
TextDrawBackgroundColor(Name, 255);
TextDrawFont(Name, 2);
TextDrawLetterSize(Name, 0.210000, 1.300000);
TextDrawColor(Name, -1);
TextDrawSetOutline(Name, 1);
TextDrawSetProportional(Name, 1);
Speed = TextDrawCreate(504.000000, 380.000000, " ");
TextDrawBackgroundColor(Speed, 255);
TextDrawFont(Speed, 1);
TextDrawLetterSize(Speed, 0.310000, 0.899999);
TextDrawColor(Speed, 16711935);
TextDrawSetOutline(Speed, 1);
TextDrawSetProportional(Speed, 1);
HP = TextDrawCreate(505.000000, 394.000000, " ");
TextDrawBackgroundColor(HP, 255);
TextDrawFont(HP, 1);
TextDrawLetterSize(HP, 0.340000, 0.899999);
TextDrawColor(HP, -16776961);
TextDrawSetOutline(HP, 1);
TextDrawSetProportional(HP, 1);
HG = TextDrawCreate(505.000000, 408.000000, " ");
TextDrawBackgroundColor(HG, 255);
TextDrawFont(HG, 1);
TextDrawLetterSize(HG, 0.340000, 0.899999);
TextDrawColor(HG, -16776961);
TextDrawSetOutline(HG, 1);
TextDrawSetProportional(HG, 1);
}
return 1;
}
//------------------------------------------------------------------------------//
public OnFilterScriptExit()
{
KillTimer(vtimer);
print("|------------------------------------------------- |");
print("| dEcooR's Speedo Meteter |");
print("| was successfuly unloaded.. |");
print("|------------------------------------------------- |");
for(new i=0; i<MAX_PLAYERS; i++)
{
TextDrawDestroy(HG);
TextDrawDestroy(HP);
TextDrawDestroy(Speed);
TextDrawDestroy(Name);
}
return 1;
}
//------------------------------------------------------------------------------//
public OnPlayerConnect(playerid)
{
Speedo[playerid] = 1;
return 1;
}
//------------------------------------------------------------------------------//
CMD:speedo(playerid,params[])
{
new sp[4];
if(sscanf(params, "s[4]", sp)) return SendClientMessage(playerid, CO_RED, "Command: /speedo [ On / Off ]");
else if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, CO_RED, "You are not in a vehicle!");
else
{
if(strcmp(sp, "on", true)==0)
{
if(Speedo[playerid] == 1) return SendClientMessage(playerid, CO_RED, "Speedo meter is already on.");
else
{
GameTextForPlayer(playerid,"~y~Speedometer has been ~g~enabled", 3500, 5);
Speedo[playerid] = 1;
}
}
if(strcmp(sp, "off", true)==0)
{
if(Speedo[playerid] == 0) return SendClientMessage(playerid, CO_RED, "Speedo meter is already off.");
else
{
GameTextForPlayer(playerid,"~y~Speedometer has been ~g~disabled", 3600, 5);
Speedo[playerid] = 0;
}
}
}
return 1;
}
//------------------------------------------------------------------------------//
forward SpeedoMeter();
public SpeedoMeter()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInAnyVehicle(i) && Speedo == 1)
{
TextDrawShowForPlayer(i, Line[0]);
TextDrawShowForPlayer(i, Line[1]);
TextDrawShowForPlayer(i, Line[2]);
TextDrawShowForPlayer(i, Line[3]);
TextDrawShowForPlayer(i, Line[4]);
TextDrawShowForPlayer(i, Line[5]);
TextDrawShowForPlayer(i, Line[0]);
TextDrawShowForPlayer(i, Line[0]);
new sp[4][100],Float:health,Float:xX,Float:yY,Float:zZ,vehicleid = GetPlayerVehicleID(i);
GetVehicleHealth(vehicleid,health);
GetPlayerPos(i,xX,yY,zZ);
format(sp[0], 100, "~b~] ~w~%s", VehicleNames[GetVehicleModel(vehicleid)-400]);
format(sp[1], 100, "~g~Speed: ~w~%d ~g~km/h",GetVehicleSpeed(vehicleid));
format(sp[2], 100, "~r~Health: ~w~%.2f",health);
format(sp[3], 100, "~y~Height: ~w~%.1f ~y~m",zZ);
TextDrawSetString(Name, sp[0]);
TextDrawSetString(Speed, sp[1]);
TextDrawSetString(HP, sp[2]);
TextDrawSetString(HG, sp[3]);
TextDrawShowForPlayer(i, Name);
TextDrawShowForPlayer(i, Speed);
TextDrawShowForPlayer(i, HP);
TextDrawShowForPlayer(i, HG);
}
else
{
TextDrawHideForPlayer(i, Line[0]);
TextDrawHideForPlayer(i, Line[1]);
TextDrawHideForPlayer(i, Line[2]);
TextDrawHideForPlayer(i, Line[3]);
TextDrawHideForPlayer(i, Line[4]);
TextDrawHideForPlayer(i, Line[5]);
TextDrawHideForPlayer(i, Name);
TextDrawHideForPlayer(i, Speed);
TextDrawHideForPlayer(i, HP);
TextDrawHideForPlayer(i, HG);
}
}
return 1;
}
//------------------------------------------------------------------------------//
stock GetVehicleSpeed(vehicleid)
{
// Function: GetVehicleSpeed(vehicleid)
new Float:a,Float:b,Float:c,vel;
GetVehicleVelocity(vehicleid, a, b, c);
vel = floatround(floatsqroot(a*a + b*b + c*c)*180);
//vel = floatround(floatsqroot( a*a + b*b + c*c ) * 180 / MPH_KMH); // If you wana use MPH use uncomment this
return vel;
}[/pawn]
Ai incercat sa rezolvi singur ?: Da.
1 answer to this question
Recommended Posts