[Ajuda]Textdraw definicao
#1

eu criei um velocimetro ele buga quando o outro player entra
EX: o velo dele da conflito com o meu
como arrumar isso?
Reply
#2

poste o codigo.
Reply
#3

PHP код:
/*
Filterscript generated using Zamaroht's TextDraw Editor Version 1.0.
Designed for SA-MP 0.3a.
Time and Date: 2011-9-29 @ 19:44:2
Instructions:
1- Compile this file using the compiler provided with the sa-mp server package.
2- Copy the .amx file to the filterscripts directory.
3- Add the filterscripts in the server.cfg file (more info here:
https://sampwiki.blast.hk/wiki/Server.cf...3.02928649
4- Run the server!
Disclaimer:
You have full rights over this file. You can distribute it, modify it, and
change it as much as you want, without having to give any special credits.
*/
#include <a_samp>
static Float:poskm [3];
new 
veiculos[][] ={
"Landstalker","Bravura","Buffalo","Linerunner","Pereniel","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","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","ZR3 50","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","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",
"Trailer","Kart","Mower","Duneride","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley","Stafford",
"BF-400","Newsvan","Tug","Trailer A","Emperor","Wayfarer","Euros","Hotdog","Club","Trailer B","Trailer C",
"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" };
new 
Text:Textdraw0;
new 
Text:Textdraw1;
new 
Text:Textdraw2;
new 
Text:Textdraw3;
new 
Text:Textdraw4;
new 
Text:Textdraw5;
new 
Text:Textdraw6;
new 
Text:Textdraw7;
new 
Text:Textdraw8;
new 
Text:Textdraw9;
new 
Text:Textdraw10;
new 
Text:Textdraw11;
new 
Text:Textdraw12;
new 
Text:Textdraw13;
public 
OnFilterScriptInit()
{
    print(
"Textdraw file generated by");
    print(
"    Zamaroht's textdraw editor was loaded.");
    
// Create the textdraws:
    
Textdraw0 TextDrawCreate(145.000000373.000000" ");
    
TextDrawBackgroundColor(Textdraw0255);
    
TextDrawFont(Textdraw03);
    
TextDrawLetterSize(Textdraw00.2700001.000000);
    
TextDrawColor(Textdraw0, -1);
    
TextDrawSetOutline(Textdraw01);
    
TextDrawSetProportional(Textdraw01);
    
Textdraw1 TextDrawCreate(414.000000353.000000"_");
    
TextDrawBackgroundColor(Textdraw1255);
    
TextDrawFont(Textdraw11);
    
TextDrawLetterSize(Textdraw10.5000007.799995);
    
TextDrawColor(Textdraw1102);
    
TextDrawSetOutline(Textdraw10);
    
TextDrawSetProportional(Textdraw11);
    
TextDrawSetShadow(Textdraw11);
    
TextDrawUseBox(Textdraw11);
    
TextDrawBoxColor(Textdraw1102);
    
TextDrawTextSize(Textdraw1141.0000000.000000);
    
Textdraw2 TextDrawCreate(308.000000373.000000" ");
    
TextDrawBackgroundColor(Textdraw2255);
    
TextDrawFont(Textdraw23);
    
TextDrawLetterSize(Textdraw20.2700001.000000);
    
TextDrawColor(Textdraw2, -1);
    
TextDrawSetOutline(Textdraw21);
    
TextDrawSetProportional(Textdraw21);
    
Textdraw3 TextDrawCreate(180.000000354.000000"~p~B~g~r~y~a~r~s~b~i~y~l ~r~A~p~M~b~D ~y~G~p~a~r~m~b~e~g~s ~r~R~p~P~b~G V0.1");
    
TextDrawBackgroundColor(Textdraw3255);
    
TextDrawFont(Textdraw33);
    
TextDrawLetterSize(Textdraw30.4099991.000000);
    
TextDrawColor(Textdraw3, -1);
    
TextDrawSetOutline(Textdraw31);
    
TextDrawSetProportional(Textdraw31);
    
Textdraw4 TextDrawCreate(414.000000370.000000"_");
    
TextDrawBackgroundColor(Textdraw4255);
    
TextDrawFont(Textdraw41);
    
TextDrawLetterSize(Textdraw41.279999, -0.200000);
    
TextDrawColor(Textdraw4, -1);
    
TextDrawSetOutline(Textdraw40);
    
TextDrawSetProportional(Textdraw41);
    
TextDrawSetShadow(Textdraw41);
    
TextDrawUseBox(Textdraw41);
    
TextDrawBoxColor(Textdraw4255);
    
TextDrawTextSize(Textdraw4141.0000000.000000);
    
Textdraw5 TextDrawCreate(414.000000352.000000"_");
    
TextDrawBackgroundColor(Textdraw5255);
    
TextDrawFont(Textdraw51);
    
TextDrawLetterSize(Textdraw51.279999, -0.300000);
    
TextDrawColor(Textdraw5, -1);
    
TextDrawSetOutline(Textdraw50);
    
TextDrawSetProportional(Textdraw51);
    
TextDrawSetShadow(Textdraw51);
    
TextDrawUseBox(Textdraw51);
    
TextDrawBoxColor(Textdraw5255);
    
TextDrawTextSize(Textdraw5141.0000000.000000);
    
Textdraw6 TextDrawCreate(414.000000426.000000"_");
    
TextDrawBackgroundColor(Textdraw6255);
    
TextDrawFont(Textdraw61);
    
TextDrawLetterSize(Textdraw61.279999, -0.300000);
    
TextDrawColor(Textdraw6, -1);
    
TextDrawSetOutline(Textdraw60);
    
TextDrawSetProportional(Textdraw61);
    
TextDrawSetShadow(Textdraw61);
    
TextDrawUseBox(Textdraw61);
    
TextDrawBoxColor(Textdraw6255);
    
TextDrawTextSize(Textdraw6141.0000000.000000);
    
Textdraw7 TextDrawCreate(145.000000391.000000" ");
    
TextDrawBackgroundColor(Textdraw7255);
    
TextDrawFont(Textdraw73);
    
TextDrawLetterSize(Textdraw70.2700001.000000);
    
TextDrawColor(Textdraw7, -1);
    
TextDrawSetOutline(Textdraw71);
    
TextDrawSetProportional(Textdraw71);
    
Textdraw8 TextDrawCreate(293.000000406.000000"~r~A~p~M~b~D");
    
TextDrawBackgroundColor(Textdraw8255);
    
TextDrawFont(Textdraw80);
    
TextDrawLetterSize(Textdraw80.6099991.399999);
    
TextDrawColor(Textdraw8, -1);
    
TextDrawSetOutline(Textdraw81);
    
TextDrawSetProportional(Textdraw81);
    
Textdraw9 TextDrawCreate(233.000000408.000000"~r~]");
    
TextDrawBackgroundColor(Textdraw9255);
    
TextDrawFont(Textdraw90);
    
TextDrawLetterSize(Textdraw90.5000001.000000);
    
TextDrawColor(Textdraw9, -1);
    
TextDrawSetOutline(Textdraw91);
    
TextDrawSetProportional(Textdraw91);
    
Textdraw10 TextDrawCreate(145.000000409.000000" ");
    
TextDrawBackgroundColor(Textdraw10255);
    
TextDrawFont(Textdraw103);
    
TextDrawLetterSize(Textdraw100.2700001.000000);
    
TextDrawColor(Textdraw10, -1);
    
TextDrawSetOutline(Textdraw101);
    
TextDrawSetProportional(Textdraw101);
    
Textdraw11 TextDrawCreate(308.000000392.000000" ");
    
TextDrawBackgroundColor(Textdraw11255);
    
TextDrawFont(Textdraw113);
    
TextDrawLetterSize(Textdraw110.2700001.000000);
    
TextDrawColor(Textdraw11, -1);
    
TextDrawSetOutline(Textdraw111);
    
TextDrawSetProportional(Textdraw111);
    
Textdraw12 TextDrawCreate(267.000000378.000000"~p~]");
    
TextDrawBackgroundColor(Textdraw12255);
    
TextDrawFont(Textdraw120);
    
TextDrawLetterSize(Textdraw120.5000001.000000);
    
TextDrawColor(Textdraw12, -1);
    
TextDrawSetOutline(Textdraw121);
    
TextDrawSetProportional(Textdraw121);
    
Textdraw13 TextDrawCreate(352.000000408.000000"~b~]");
    
TextDrawBackgroundColor(Textdraw13255);
    
TextDrawFont(Textdraw130);
    
TextDrawLetterSize(Textdraw130.5000001.000000);
    
TextDrawColor(Textdraw13, -1);
    
TextDrawSetOutline(Textdraw131);
    
TextDrawSetProportional(Textdraw131);
    return 
1;
}
public 
OnFilterScriptExit()
{
    
TextDrawHideForAll(Textdraw0);
    
TextDrawDestroy(Textdraw0);
    
TextDrawHideForAll(Textdraw1);
    
TextDrawDestroy(Textdraw1);
    
TextDrawHideForAll(Textdraw2);
    
TextDrawDestroy(Textdraw2);
    
TextDrawHideForAll(Textdraw3);
    
TextDrawDestroy(Textdraw3);
    
TextDrawHideForAll(Textdraw4);
    
TextDrawDestroy(Textdraw4);
    
TextDrawHideForAll(Textdraw5);
    
TextDrawDestroy(Textdraw5);
    
TextDrawHideForAll(Textdraw6);
    
TextDrawDestroy(Textdraw6);
    
TextDrawHideForAll(Textdraw7);
    
TextDrawDestroy(Textdraw7);
    
TextDrawHideForAll(Textdraw8);
    
TextDrawDestroy(Textdraw8);
    
TextDrawHideForAll(Textdraw9);
    
TextDrawDestroy(Textdraw9);
    
TextDrawHideForAll(Textdraw10);
    
TextDrawDestroy(Textdraw10);
    
TextDrawHideForAll(Textdraw11);
    
TextDrawDestroy(Textdraw11);
    
TextDrawHideForAll(Textdraw12);
    
TextDrawDestroy(Textdraw12);
    
TextDrawHideForAll(Textdraw13);
    
TextDrawDestroy(Textdraw13);
    return 
1;
}
public 
OnPlayerStateChange(playeridnewstateoldstate)
{
    if(
newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
    {
        
Speed(playerid);
    }
    else if(
oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
    {
        
TextDrawHideForPlayer(playeridTextdraw0);
        
TextDrawHideForPlayer(playeridTextdraw1);
        
TextDrawHideForPlayer(playeridTextdraw2);
        
TextDrawHideForPlayer(playeridTextdraw3);
        
TextDrawHideForPlayer(playeridTextdraw4);
        
TextDrawHideForPlayer(playeridTextdraw5);
        
TextDrawHideForPlayer(playeridTextdraw6);
        
TextDrawHideForPlayer(playeridTextdraw7);
        
TextDrawHideForPlayer(playeridTextdraw8);
        
TextDrawHideForPlayer(playeridTextdraw9);
        
TextDrawHideForPlayer(playeridTextdraw10);
        
TextDrawHideForPlayer(playeridTextdraw11);
        
TextDrawHideForPlayer(playeridTextdraw12);
        
TextDrawHideForPlayer(playeridTextdraw13);
    }
    return 
1;
}
Speed(playerid);
public 
Speed(playerid)
{
    new 
MySpeed[48];
       new 
MyCar[48];
       new 
MyAltitude[48];
    new 
MyGas[48];
    new 
MyHealh[48];
    new 
Float:Speedo_X,Float:Speedo_Y,Float:Speedo_Z;
    new 
Float:Speedo_HP;
    
GetVehicleHealth(GetPlayerVehicleID(playerid), Speedo_HP);
    
GetPlayerPos(playeridSpeedo_XSpeedo_YSpeedo_Z);
    
format(MySpeed,sizeof(MySpeed),"~>~~p~Velocidade~b~: ~b~%d ~y~km/h",GetSpeed(playerid));
    
format(MyCar,sizeof(MyCar),"~>~~p~Veiculo~b~: ~y~%s",veiculos[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
    
format(MyAltitude,sizeof(MyAltitude),"~>~~p~Altitude~b~: ~y~%.2f",Speedo_Z);
    
format(MyGas,sizeof(MyGas),"~>~~p~Gasolina~b~: ~y~100");
    
format(MyHealh,sizeof(MyHealh),"~>~~p~Lataria~b~: ~y~%.2f",Speedo_HP);
    
TextDrawSetString(Textdraw0MySpeed);
    
TextDrawSetString(Textdraw2MyCar);
    
TextDrawSetString(Textdraw7MyAltitude);
    
TextDrawSetString(Textdraw11MyGas);
    
TextDrawSetString(Textdraw10MyHealh);
    
TextDrawShowForPlayer(playeridTextdraw0);
    
TextDrawShowForPlayer(playeridTextdraw1);
    
TextDrawShowForPlayer(playeridTextdraw2);
    
TextDrawShowForPlayer(playeridTextdraw3);
    
TextDrawShowForPlayer(playeridTextdraw4);
    
TextDrawShowForPlayer(playeridTextdraw5);
    
TextDrawShowForPlayer(playeridTextdraw6);
    
TextDrawShowForPlayer(playeridTextdraw7);
    
TextDrawShowForPlayer(playeridTextdraw8);
    
TextDrawShowForPlayer(playeridTextdraw9);
    
TextDrawShowForPlayer(playeridTextdraw10);
    
TextDrawShowForPlayer(playeridTextdraw11);
    
TextDrawShowForPlayer(playeridTextdraw12);
    
TextDrawShowForPlayer(playeridTextdraw13);
    
SetTimerEx("Speed",1,0,"i",playerid);
}
stock
    GetSpeed 
playerid mode )
{
    
GetVehicleVelocity GetPlayerVehicleID playerid ) , poskm ] , poskm ] , poskm ] ) ;
    return 
IsPlayerInAnyVehicle playerid ) ? floatround ( ( ( floatsqroot ( ( ( poskm ] * poskm ] ) + ( poskm ] * poskm ] ) + ( poskm ] * poskm ] ) ) ) * ( !mode 105.0 170.0 ) ) ) * ) : 0;

Reply
#4

use isto pra getar a velocidade:

pawn Код:
stock GetPlayerSpeed(playerid)
{
    new Float:ST[4];
    if(IsPlayerInAnyVehicle(playerid))
    GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
    else GetPlayerVelocity(playerid,ST[0],ST[1],ST[2]);
    ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 100.3;
    return floatround(ST[3]);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)