[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
#2

Mas tem cada nego nesse fуrum.

Vai ficar querendo
Reply
#3

Carб, se nгo ajuda nгo fala merda.
Reply
#4

Alguйm?
Reply
#5

Da seus pulo
Reply
#6

O cara sу vem no Fуrum pra pedir ajuda, e ainda desrespeita as regras em quase todo o tуpico.

Tambйm nгo vou ajudar.
Reply
#7

DannielCooper, carб me ajuda mano
Reply
#8

PF ALGUЙM
Reply
#9

Nгo cara para de ser chato

pra vocк estudar:
https://sampforum.blast.hk/showthread.php?tid=497801
https://sampforum.blast.hk/showthread.php?tid=428964


Se nгo quiser problema teu
Reply
#10

Quote:
Originally Posted by Nork
Посмотреть сообщение
Alguйm?
pawn Код:
// so arrumei este filterscript pra ver se vocк desconfiar e
// comeзar a criar seus proprios projetos que isto seja de liзгo !!!

// й tambйm vai estudar "pawno"


#include            a_samp
new Text:Textdraw0[MAX_PLAYERS];
new Text:Textdraw1[MAX_PLAYERS];
new TimerVelocimetro[MAX_PLAYERS];

public OnFilterScriptInit()
{
    for(new x = 0; x < MAX_PLAYERS; x++)
    {
        Textdraw0[x] = TextDrawCreate(548.000000, 350.000000, "");// Velocidade
        TextDrawBackgroundColor(Textdraw0[x], 255);
        TextDrawFont(Textdraw0[x], 2);
        TextDrawLetterSize(Textdraw0[x], 0.569999, 3.999998);
        TextDrawColor(Textdraw0[x], -1);
        TextDrawSetOutline(Textdraw0[x], 0);
        TextDrawSetProportional(Textdraw0[x], 1);
        TextDrawSetShadow(Textdraw0[x], 1);

        Textdraw1[x] = TextDrawCreate(600.000000, 350.000000, "Km/h");// KM
        TextDrawBackgroundColor(Textdraw1[x], 255);
        TextDrawFont(Textdraw1[x], 2);
        TextDrawLetterSize(Textdraw1[x], 0.210000, 1.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(playerid, reason)
{
    KillTimer(TimerVelocimetro[playerid]);
    return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
    {
        TimerVelocimetro[playerid] = SetTimerEx("AtualizarVelocimetro", 1000, true, "d", playerid);
    }
    else if(oldstate == PLAYER_STATE_DRIVER)
    {
        KillTimer(TimerVelocimetro[playerid]);
        TextDrawHideForPlayer(playerid, Textdraw0[playerid]);
        TextDrawHideForPlayer(playerid, Textdraw1[playerid]);
    }
    return 1;
}
forward AtualizarVelocimetro(playerid);
public AtualizarVelocimetro(playerid)
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        new Velo[30];

        format(Velo, 30, "%i", GetPlayerSpeed(playerid));
        TextDrawSetString(Textdraw0[playerid], Velo);
        TextDrawShowForPlayer(playerid, Textdraw0[playerid]);

        TextDrawShowForPlayer(playerid, Textdraw1[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


Forum Jump:


Users browsing this thread: 3 Guest(s)