Car speed
#1

helo i want to check speed vehicle and to show to player with /speed for first.
I watch tutorials and topics and i don't know..i'm confuse

PHP код:
stock GetVehicleSpeed(vehicleid)
{
    new 
Float:V[3];
    
GetVehicleVelocity(vehicleidV[0], V[1], V[2]);
    return 
floatround(floatsqroot(V[0] * V[0] + V[1] * V[1] + V[2] * V[2]) * 180.00);

PHP код:
CMD:speed(playerid)
{
    new 
string[128];
    
format(string,sizeof(string),"Viteza actuala %i!",GetVehicleSpeed(playerid));
    
SendClientMessage(playerid,-1,string);
    return 
1;

in game /speed don't work , don't show the speed. Why?Can some explain detalied?
Reply
#2

folosesti comanda in timp ce mergi sau stai pe loc?

Код:
stock GetSpeed(playerid)
{
    new Float:ST[3];
    GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
    return floatround(1.61*floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 100.3);
}
Reply
#3

Iti multumsc, acest stock este mai bun decat al meu , acum functioneaza.Am o intrebare, cum fac ca textdraw
unde scrie SPEED : X sa se actualizeze constant cand se schimba x?
Reply
#4

Iti multumsc, acest stock este mai bun decat al meu , acum functioneaza.Am o intrebare, cum fac ca textdraw
unde scrie SPEED : X sa se actualizeze constant cand se schimba x?
Reply
#5

Quote:
Originally Posted by Calinut200
Посмотреть сообщение
helo i want to check speed vehicle and to show to player with /speed for first.
I watch tutorials and topics and i don't know..i'm confuse

PHP код:
stock GetVehicleSpeed(vehicleid)
{
    new 
Float:V[3];
    
GetVehicleVelocity(vehicleidV[0], V[1], V[2]);
    return 
floatround(floatsqroot(V[0] * V[0] + V[1] * V[1] + V[2] * V[2]) * 180.00);

PHP код:
CMD:speed(playerid)
{
    new 
string[128];
    
format(string,sizeof(string),"Viteza actuala %i!",GetVehicleSpeed(playerid));
    
SendClientMessage(playerid,-1,string);
    return 
1;

in game /speed don't work , don't show the speed. Why?Can some explain detalied?
Код:
stock GetVehicleSpeed(vehicleid) 
{ 
    new Float:vx,Float:vy,Float:vz; 
    GetVehicleVelocity(vehicleid, vx, vy, vz); 
    return floatsqroot(floatpower(floatabs(vx), 2.0) + floatpower(floatabs(vy), 2.0) + floatpower(floatabs(vz), 2.0)) * 126.6;
}  

the function is faster.
Reply
#6

daca vrei sa se actualizeze la fiecare miscare il pui la OnPlayerUpdate(playerid); sau poti sa creezi un timer dar acesta nu e asa rapid insa nu creeaza lag care la un numar mare de jucatori de observa
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)