#include <a_samp>
#define FILTERSCRIPT
new Text:Textdraw99;
new Text:Textdraw88;
forward Clock(playerid);
public Clock(playerid)
{
new string[256];
new string2[256];
new year, month, day;
new hour, minute, second;
getdate(year, month, day);
gettime(hour,minute,second);
new mtext[20];
getdate(year, month, day);
if(month == 1) { mtext = "January"; }
else if(month == 2) { mtext = "February"; }
else if(month == 3) { mtext = "March"; }
else if(month == 4) { mtext = "April"; }
else if(month == 5) { mtext = "May"; }
else if(month == 6) { mtext = "June"; }
else if(month == 7) { mtext = "July"; }
else if(month == 8) { mtext = "August"; }
else if(month == 9) { mtext = "September"; }
else if(month == 10) { mtext = "October"; }
else if(month == 11) { mtext = "November"; }
else if(month == 12) { mtext = "December"; }
format(string, sizeof(string), "%d %s, %d", day, mtext, year);
TextDrawSetString(Text:Textdraw99, string);
format(string2, sizeof(string2), "%d:%d:%d", hour, minute, second);
TextDrawSetString(Text:Textdraw88, string2);
}
public OnGameModeInit()
{
SetTimer("Clock", 1000, 1); // Updates the clock every 1 second
Textdraw99 = TextDrawCreate(450.000000,5.000000, "--");
Textdraw88 = TextDrawCreate(551.000000,23.000000,"--");
TextDrawAlignment(Textdraw99,0);
TextDrawAlignment(Textdraw88,0);
TextDrawBackgroundColor(Textdraw99,0x0000ffff);
TextDrawBackgroundColor(Textdraw88,0x0000ffff);
TextDrawFont(Textdraw99,2);
TextDrawLetterSize(Textdraw99,0.499999,1.500000);
TextDrawFont(Textdraw88,2);
TextDrawLetterSize(Textdraw88,0.399999,2.000000);
TextDrawColor(Textdraw99,0x00ffffff);
TextDrawColor(Textdraw88,0x00ffffff);
TextDrawSetOutline(Textdraw99,1);
TextDrawSetOutline(Textdraw88,1);
TextDrawSetProportional(Textdraw99,1);
TextDrawSetProportional(Textdraw88,1);
TextDrawSetShadow(Textdraw99,1);
TextDrawSetShadow(Textdraw88,1);
return 1;
}
public OnPlayerConnect(playerid)
{
TextDrawShowForPlayer(playerid, Textdraw99);
TextDrawShowForPlayer(playerid, Textdraw88);
return 0;
}
// Vehicle System 1.1 Beta © 2010 Johny C. & Luka P.
// Contributors: Betamaster (Vehicle Name List)
#include "a_samp.inc"
#define FUEL_UPDATE_TIME (20000)
#define COLOR_RED 0xAA3333AA
#define COLOR_BLUE 0x2641FEAA
stock Float:GetVehicleVelocityX(vehicleid){new Float:velocity_X, Float:velocity_dump_Y, Float:velocity_dump_Z;GetVehicleVelocity(vehicleid, velocity_X, velocity_dump_Y, velocity_dump_Z);velocity_dump_Y = 0.00;velocity_dump_Z = 0.00;return velocity_X;}
stock Float:GetVehicleVelocityY(vehicleid){new Float:velocity_dump_X, Float:velocity_Y, Float:velocity_dump_Z;GetVehicleVelocity(vehicleid, velocity_dump_X, velocity_Y, velocity_dump_Z);velocity_dump_X = 0.00;velocity_dump_Z = 0.00;return velocity_Y;}
stock Float:GetVehicleVelocityZ(vehicleid){new Float:velocity_dump_X, Float:velocity_dump_Y, Float:velocity_Z;GetVehicleVelocity(vehicleid, velocity_dump_X, velocity_dump_Y, velocity_Z);velocity_dump_X = 0.00;velocity_dump_Y = 0.00;return velocity_Z;}
stock Float:SetVehicleSpeed(vehicleid, speed){new Float:angle;GetVehicleZAngle(vehicleid,angle);if(SetVehicleVelocity(vehicleid, (speed / 170.0) * floatsin(-angle, degrees), (speed / 170.0) * floatcos(-angle, degrees), 0.0))return(speed/170.0);else return(Float:0);}
#define GetVehicleSpeed_P(%0) floatmul(floatsqroot(floatadd(floatpower(GetVehicleVelocityX(GetPlayerVehicleID(%0)), 2), floatadd(floatpower(GetVehicleVelocityY(GetPlayerVehicleID(%0)), 2), floatpower(GetVehicleVelocityZ(GetPlayerVehicleID(%0)), 2)))), 200)
#define GetVehicleSpeed_V(%0) floatmul(floatsqroot(floatadd(floatpower(GetVehicleVelocityX(%0), 2), floatadd(floatpower(GetVehicleVelocityY(%0), 2), floatpower(GetVehicleVelocityZ(%0), 2)))), 200);
#define Boolean bool
enum E_VEHICLE_INFO
{
Boolean: E_VEHICLE_PROCESSED,
Float: E_VEHICLE_FUEL,
E_VEHICLE_FUEL_TIMER,
Float: E_VEHICLE_HEALTH
}
new Text:VehicleText[MAX_PLAYERS][8], Float:LastSpeed[MAX_PLAYERS], VehicleInfo[MAX_VEHICLES][E_VEHICLE_INFO], Boolean:TextdrawsCreated[MAX_PLAYERS];
forward UpdateFuelByPlayerVehicleID(playerid);
stock CreateTextdraws(playerid)
{
VehicleText[playerid][0] = TextDrawCreate(330.000000, 435.000000, "~r~Vehicle name: ~w~name~r~ Vehicle health:~w~ health ~r~Vehicle fuel: ~w~fuel");TextDrawAlignment(VehicleText[playerid][0], 2);TextDrawBackgroundColor(VehicleText[playerid][0], 255);TextDrawFont(VehicleText[playerid][0], 1);TextDrawLetterSize(VehicleText[playerid][0], 0.340000, 1.000000);TextDrawColor(VehicleText[playerid][0], -1);
TextDrawSetOutline(VehicleText[playerid][0], 1);TextDrawSetProportional(VehicleText[playerid][0], 1);TextDrawUseBox(VehicleText[playerid][0], 1);TextDrawBoxColor(VehicleText[playerid][0], 100);TextDrawTextSize(VehicleText[playerid][0], 713.000000, 860.000000);
VehicleText[playerid][1] = TextDrawCreate(321.000000, 409.000000, "000km/h");TextDrawAlignment(VehicleText[playerid][1], 2);TextDrawBackgroundColor(VehicleText[playerid][1], 255);TextDrawFont(VehicleText[playerid][1], 1);TextDrawLetterSize(VehicleText[playerid][1], 0.440000, 2.399999);
TextDrawColor(VehicleText[playerid][1], -1);TextDrawSetOutline(VehicleText[playerid][1], 0);TextDrawSetProportional(VehicleText[playerid][1], 1);TextDrawSetShadow(VehicleText[playerid][1], 1);TextDrawUseBox(VehicleText[playerid][1], 1);TextDrawBoxColor(VehicleText[playerid][1], 100);TextDrawTextSize(VehicleText[playerid][1], 163.000000, -131.000000);
VehicleText[playerid][2] = TextDrawCreate(259.000000, 433.000000, "_");TextDrawBackgroundColor(VehicleText[playerid][2], 255);TextDrawFont(VehicleText[playerid][2], 1);TextDrawLetterSize(VehicleText[playerid][2], 0.500000, -0.200000);
TextDrawColor(VehicleText[playerid][2], -1);TextDrawSetOutline(VehicleText[playerid][2], 0);TextDrawSetProportional(VehicleText[playerid][2], 1);TextDrawSetShadow(VehicleText[playerid][2], 1);TextDrawUseBox(VehicleText[playerid][2], 1);TextDrawBoxColor(VehicleText[playerid][2], 255);TextDrawTextSize(VehicleText[playerid][2], -45.000000, 0.000000);
VehicleText[playerid][3] = TextDrawCreate(386.000000, 433.000000, "_");TextDrawBackgroundColor(VehicleText[playerid][3], 255);TextDrawFont(VehicleText[playerid][3], 1);TextDrawLetterSize(VehicleText[playerid][3], 0.500000, -0.200000);TextDrawColor(VehicleText[playerid][3], -1);TextDrawSetOutline(VehicleText[playerid][3], 0);
TextDrawSetProportional(VehicleText[playerid][3], 1);TextDrawSetShadow(VehicleText[playerid][3], 1);TextDrawUseBox(VehicleText[playerid][3], 1);TextDrawBoxColor(VehicleText[playerid][3], 255);TextDrawTextSize(VehicleText[playerid][3], 648.000000, 0.000000);
VehicleText[playerid][4] = TextDrawCreate(259.000000, 409.000000, "_");TextDrawBackgroundColor(VehicleText[playerid][4], 255);TextDrawFont(VehicleText[playerid][4], 1);TextDrawLetterSize(VehicleText[playerid][4], 0.500000, 2.200000);TextDrawColor(VehicleText[playerid][4], -1);
TextDrawSetOutline(VehicleText[playerid][4], 0);TextDrawSetProportional(VehicleText[playerid][4], 1);TextDrawSetShadow(VehicleText[playerid][4], 1);TextDrawUseBox(VehicleText[playerid][4], 1);TextDrawBoxColor(VehicleText[playerid][4], 255);TextDrawTextSize(VehicleText[playerid][4], 253.000000, 0.000000);
VehicleText[playerid][5] = TextDrawCreate(388.500000, 407.000000, "_");TextDrawBackgroundColor(VehicleText[playerid][5], 255);TextDrawFont(VehicleText[playerid][5], 1);TextDrawLetterSize(VehicleText[playerid][5], 0.500000, -0.100000);TextDrawColor(VehicleText[playerid][5], -1);
TextDrawSetOutline(VehicleText[playerid][5], 0);TextDrawSetProportional(VehicleText[playerid][5], 1);TextDrawSetShadow(VehicleText[playerid][5], 1);TextDrawUseBox(VehicleText[playerid][5], 1);TextDrawBoxColor(VehicleText[playerid][5], 255);TextDrawTextSize(VehicleText[playerid][5], 253.000000, 24.000000);
VehicleText[playerid][6] = TextDrawCreate(386.000000, 408.000000, "_");TextDrawBackgroundColor(VehicleText[playerid][6], 255);TextDrawFont(VehicleText[playerid][6], 1);TextDrawLetterSize(VehicleText[playerid][6], 0.500000, 2.599999);TextDrawColor(VehicleText[playerid][6], -1);
TextDrawSetOutline(VehicleText[playerid][6], 0);TextDrawSetProportional(VehicleText[playerid][6], 1);TextDrawSetShadow(VehicleText[playerid][6], 1);TextDrawUseBox(VehicleText[playerid][6], 1);TextDrawBoxColor(VehicleText[playerid][6], 255);TextDrawTextSize(VehicleText[playerid][6], 385.000000, 0.000000);
VehicleText[playerid][7] = TextDrawCreate(676.000000, 448.000000, "_");TextDrawBackgroundColor(VehicleText[playerid][7], 255);TextDrawFont(VehicleText[playerid][7], 1);TextDrawLetterSize(VehicleText[playerid][7], 0.500000, -0.200000);TextDrawColor(VehicleText[playerid][7], -1);
TextDrawSetOutline(VehicleText[playerid][7], 0);TextDrawSetProportional(VehicleText[playerid][7], 1);TextDrawSetShadow(VehicleText[playerid][7], 1);TextDrawUseBox(VehicleText[playerid][7], 1);TextDrawBoxColor(VehicleText[playerid][7], 255);TextDrawTextSize(VehicleText[playerid][7], -45.000000, 0.000000);
TextdrawsCreated[playerid] = true;
return 1;
}
static VehicleList[212][] =
{
{"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 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"},{"Boxville"},{"Benson"},{"Mesa"},{"RC Goblin"},{"Hotring Racer A"},{"Hotring Racer 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 (LSPD)"},{"Police Car (SFPD)"},{"Police Car (LVPD)"},{"Police Ranger"},{"Picador"},{"S.W.A.T. Van"},{"Alpha"},{"Phoenix"},{"Glendale"},{"Sadler"},{"Luggage Trailer A"},{"Luggage Trailer B"},{"Stair Trailer"},{"Boxville"},{"Farm Plow"},{"Utility Trailer"}
};
static Float:FuelStationCoords[][3] =
{
{2146.7766,2747.4424,10.8203},{2638.5972,1106.7181,10.8203},{1597.3271,2197.7712,10.8203},{608.5480,1699.3431,6.9922},{618.5945,1684.5210,6.9922},{-1470.1311,1863.6323,32.6328},{-737.2454,2742.9482,47.2266},{656.9113,-564.4317,16.510},{2202.2349,2474.3494,10.5258},{614.9333,1689.7418,6.6968},{-1328.8250,2677.2173,49.7665},{70.3882,1218.6783,18.5165},{2113.7390,920.1079,10.5255},{-1327.7218,2678.8723,50.0625},{-2409.5752,976.3114,45.2969},{-2026.0743,156.6390,28.7872},{-2244.5063,-2561.0781,31.9219},
{-1603.3645,-2709.4622,48.3874},{-1609.7147,-2717.6572,48.3874},{-88.9507,-1164.7794,2.3085},{-93.0625,-1173.2089,2.3244},{1003.7032,-937.5828,42.3281},{1940.6816,-1770.7999,13.3906},{1940.0111,-1776.4730,13.3906},{1381.7468,459.1537,20.3452},{-1680.0511,408.4660,7.1797},{-1672.9927,415.2118,7.1797},{-730.05,2744.22,47.22},{2268.7329,26.4267,26.7098},{2257.1467,26.8044,26.7032}
};
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/abastecer", cmdtext, true) == 0)
{
new Boolean:found = false;
for(new i=0; i < sizeof(FuelStationCoords); i++)
{
if(IsPlayerInRangeOfPoint(playerid, 6.5, FuelStationCoords[i][0], FuelStationCoords[i][1], FuelStationCoords[i][2]))
{
found = true;
}
}
if(!found) SendClientMessage(playerid, COLOR_RED, "Vocк nгo estб em um posto de combustivel!");
else if(!IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid, COLOR_RED, "Vocк nгo estб em um veiculo!");
else
{
new Float:cost = ((100.00 - VehicleInfo[GetPlayerVehicleID(playerid)][E_VEHICLE_FUEL]) * 100);
if(GetPlayerMoney(playerid) < cost)
{
new szOutput[128]; format(szOutput, sizeof(szOutput), "Vocк nгo tem dinheiro suficiente para abastecer o seu veiculo ($%i).", floatround(cost));
SendClientMessage(playerid, COLOR_RED, szOutput);
}
else
{
GivePlayerMoney(playerid, -1000);
VehicleInfo[GetPlayerVehicleID(playerid)][E_VEHICLE_FUEL] = 100.00;
SendClientMessage(playerid, COLOR_BLUE, "Seu veнculo foi abastecido!");
}
}
return 1;
}
return 0;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if((newkeys & 16) && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER && VehicleInfo[GetPlayerVehicleID(playerid)][E_VEHICLE_FUEL] < 1)
{
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, true);
}
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(!ispassenger)
{
if(VehicleInfo[vehicleid][E_VEHICLE_PROCESSED] == false)
{
VehicleInfo[vehicleid][E_VEHICLE_PROCESSED] = true;
VehicleInfo[vehicleid][E_VEHICLE_FUEL] = 100.00;
}
else
{
if(VehicleInfo[vehicleid][E_VEHICLE_FUEL] == 0.00)
{
SetVehicleSpeed(GetPlayerVehicleID(playerid), 0);
PutPlayerInVehicle(playerid, vehicleid, 0);
SetVehicleParamsEx(VEHICLE_PARAMS_OFF);
TogglePlayerControllable(playerid, false);
GameTextForPlayer(playerid, "~r~Sem combustнvel!", 1000, 4);
}
}
if(GetVehicleModel(vehicleid) != 481 && GetVehicleModel(vehicleid) != 510 && GetVehicleModel(vehicleid) != 509)
{
VehicleInfo[vehicleid][E_VEHICLE_FUEL_TIMER] = SetTimerEx("UpdateFuelByPlayerVehicleID", FUEL_UPDATE_TIME, 1, "i", playerid);
}
}
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return KillTimer(VehicleInfo[vehicleid][E_VEHICLE_FUEL_TIMER]);
}
public UpdateFuelByPlayerVehicleID(playerid)
{
new const vehicleid = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 510 || GetVehicleModel(vehicleid) == 509)
{
return 1;
}
new Float:memory[3]={0.00,0.00,0.00 }, result_speed=0;
GetVehicleVelocity(vehicleid,memory[0],memory[1],memory[2]);
result_speed = floatround(floatround(floatsqroot(((memory[0]*memory[0])+(memory[1]*memory[1]))+(memory[2]*memory[2]))*(136.666667),floatround_round)*(1.609344));
if(result_speed)
{
new _random = random(100); while(_random < 50) _random = random(100); new val[4]; format(val, sizeof(val), "0.%i", _random);
if(floatsub(VehicleInfo[vehicleid][E_VEHICLE_FUEL], floatstr(val)) > 0.00)
{
VehicleInfo[vehicleid][E_VEHICLE_FUEL] = floatsub(VehicleInfo[vehicleid][E_VEHICLE_FUEL], floatstr(val));
new string[128], Float:health; GetVehicleHealth(GetPlayerVehicleID(playerid), health);
format(string, sizeof(string), "~r~Nome do Veiculo: ~w~%s~r~ Vida do Veiculo:~w~ %.2f\%% ~r~Gasolina: ~w~%.2f\%%", VehicleList[(GetVehicleModel(GetPlayerVehicleID(playerid)) - 400)], health / 1000 * 100, VehicleInfo[GetPlayerVehicleID(playerid)][E_VEHICLE_FUEL]);
TextDrawHideForPlayer(playerid, VehicleText[playerid][0]);
TextDrawSetString(VehicleText[playerid][0], string);
TextDrawShowForPlayer(playerid, VehicleText[playerid][0]);
}
else
{
VehicleInfo[vehicleid][E_VEHICLE_FUEL] = 0.00;
SetVehicleSpeed(GetPlayerVehicleID(playerid), 0);
TogglePlayerControllable(playerid, false);
GameTextForPlayer(playerid, "~r~Sem Combustнvel!", 1000, 4);
}
}
return 1;
}
public OnPlayerUpdate(playerid)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(IsPlayerInAnyVehicle(playerid))
{
new Float:speed = GetVehicleSpeed_P(playerid);
if(speed != LastSpeed[playerid])
{
new szOutput[9];
format(szOutput, sizeof(szOutput), "%ikm/h", floatround(speed));
TextDrawHideForPlayer(playerid, VehicleText[playerid][1]);
TextDrawSetString(VehicleText[playerid][1], szOutput);
TextDrawShowForPlayer(playerid, VehicleText[playerid][1]);
LastSpeed[playerid] = speed;
}
new string[128], Float:health; GetVehicleHealth(GetPlayerVehicleID(playerid), health);
if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 481 && GetVehicleModel(GetPlayerVehicleID(playerid)) != 510 && GetVehicleModel(GetPlayerVehicleID(playerid)) != 509)
{
format(string, sizeof(string), "~r~Nome do Veiculo: ~w~%s~r~ Vida do Veiculo:~w~ %.2f\%% ~r~Gasolina: ~w~%.2f\%%", VehicleList[(GetVehicleModel(GetPlayerVehicleID(playerid)) - 400)], health / 1000 * 100, VehicleInfo[GetPlayerVehicleID(playerid)][E_VEHICLE_FUEL]);
}
else
{
format(string, sizeof(string), "~r~Nome do Veiculo: ~w~%s", VehicleList[(GetVehicleModel(GetPlayerVehicleID(playerid)) - 400)]);
}
if(TextdrawsCreated[playerid] == false)
{
CreateTextdraws(playerid);
}
TextDrawHideForPlayer(playerid, VehicleText[playerid][0]);
TextDrawSetString(VehicleText[playerid][0], string);
TextDrawShowForPlayer(playerid, VehicleText[playerid][0]);
}
}
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
for(new i=0; i <= 7; i++)
{
TextDrawShowForPlayer(playerid, VehicleText[playerid][i]);
new string[128], Float:health;
GetVehicleHealth(GetPlayerVehicleID(playerid), health);
format(string, sizeof(string), "~r~Nome do Veiculo: ~w~%s~r~ Vida do Veiculo:~w~ %.2f\%% ~r~Gasolina: ~w~%.2f\%%", VehicleList[(GetVehicleModel(GetPlayerVehicleID(playerid)) - 400)], health / 1000 * 100, VehicleInfo[GetPlayerVehicleID(playerid)][E_VEHICLE_FUEL]);
TextDrawHideForPlayer(playerid, VehicleText[playerid][0]);
TextDrawSetString(VehicleText[playerid][0], string);
TextDrawShowForPlayer(playerid, VehicleText[playerid][0]);
VehicleInfo[GetPlayerVehicleID(playerid)][E_VEHICLE_HEALTH] = health;
}
}
else
{
for(new i=0; i <= 7; i++)
{
TextDrawHideForPlayer(playerid, VehicleText[playerid][i]);
}
}
return 1;
}
public OnFilterScriptExit()
{
for(new i=0; i < MAX_PLAYERS; i++)
{
for(new j=0; j <= 7; j++)
{
TextDrawDestroy(VehicleText[i][j]);
}
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
for(new i=0; i <= 7; i++)
{
TextDrawDestroy(VehicleText[playerid][i]);
}
LastSpeed[playerid] = 0.00;
return 1;
}
public OnPlayerConnect(playerid)
{
TextdrawsCreated[playerid] = false;
CreateTextdraws(playerid);
return 1;
}
Vocк quer que a gente redefina o local do text draw ? Jб quer demais ...
Se vira ae: http://forum.sa-mp.com/showpost.php?...61&postcount=1 |