[Ajuda] Velocнmetro quando alguйm da G
#1

Queria que alguйm colocasse nesse cуdigo e me enviasse para aparecer a velocidade Km/h pra quem ta de carona porque sу aparece pra quem ta dirigindo.

PHP код:
#include            a_samp
new Text:Textdraw0[MAX_PLAYERS];
new 
Text:Textdraw1[MAX_PLAYERS];
new 
TimerVelocimetro[MAX_PLAYERS];
public 
OnFilterScriptInit()
{
    for(new 
0MAX_PLAYERSx++){
    
Textdraw0[x] = TextDrawCreate(548.000000350.000000"");// Velocidade
    
TextDrawBackgroundColor(Textdraw0[x], 255);
    
TextDrawFont(Textdraw0[x], 2);
    
TextDrawLetterSize(Textdraw0[x], 0.5699993.999998);
    
TextDrawColor(Textdraw0[x], -1);
    
TextDrawSetOutline(Textdraw0[x], 0);
    
TextDrawSetProportional(Textdraw0[x], 1);
    
TextDrawSetShadow(Textdraw0[x], 1);
    
Textdraw1[x] = TextDrawCreate(600.000000350.000000"Km/h");// KM
    
TextDrawBackgroundColor(Textdraw1[x], 255);
    
TextDrawFont(Textdraw1[x], 2);
    
TextDrawLetterSize(Textdraw1[x], 0.2100001.300000);
    
TextDrawColor(Textdraw1[x], -1);
    
TextDrawSetOutline(Textdraw1[x], 0);
    
TextDrawSetProportional(Textdraw1[x], 1);
    
TextDrawSetShadow(Textdraw1[x], 1);
    }
    return 
1;
}
public 
OnFilterScriptExit()
{
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    
KillTimer(TimerVelocimetro[playerid]);
    return 
1;
}
public 
OnPlayerStateChange(playeridnewstateoldstate)
{
    if(
newstate == PLAYER_STATE_DRIVER)
    {
        
TimerVelocimetro[playerid] = SetTimerEx("AtualizarVelocimetro"100true"n"playerid);
    }
    else if(
oldstate == PLAYER_STATE_DRIVER)
    {
        
KillTimer(TimerVelocimetro[playerid]);
        
TextDrawHideForPlayer(playeridTextdraw0[playerid]);
        
TextDrawHideForPlayer(playeridTextdraw1[playerid]);
    }
    return 
1;
}
forward AtualizarVelocimetro(playerid);
public 
AtualizarVelocimetro(playerid)
{
    if(
IsPlayerInAnyVehicle(playerid))
    {
        new 
Velo[30];
        
format(Velo30"%i"GetPlayerSpeed(playerid));
        
TextDrawSetString(Textdraw0[playerid], Velo);
        
TextDrawShowForPlayer(playeridTextdraw0[playerid]);
        
TextDrawShowForPlayer(playeridTextdraw1[playerid]);
    }
    return 
1;
}
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


Messages In This Thread
Velocнmetro quando alguйm da G - by Nork - 06.03.2014, 13:51
Re: Velocнmetro quando alguйm da G - by smiir - 06.03.2014, 13:56
Re: Velocнmetro quando alguйm da G - by Nork - 06.03.2014, 14:00
Re: Velocнmetro quando alguйm da G - by Nork - 06.03.2014, 14:13
Re: Velocнmetro quando alguйm da G - by smiir - 06.03.2014, 14:15
Re: Velocнmetro quando alguйm da G - by DannielCooper - 06.03.2014, 14:26
Re: Velocнmetro quando alguйm da G - by Nork - 06.03.2014, 14:27
Re: Velocнmetro quando alguйm da G - by Nork - 06.03.2014, 14:51
Re: Velocнmetro quando alguйm da G - by smiir - 06.03.2014, 14:59
Re: Velocнmetro quando alguйm da G - by Dieguinho - 06.03.2014, 15:19

Forum Jump:


Users browsing this thread: 4 Guest(s)