[AJUDA] Sistema de Radar (format) D:
#1

Ae galera, to com um probleminha aqui no meu sistema de radar.
Bom, ele ta funcionando e talz, mas eu queria que quando ele passasse no radar mostrasse a quantos KM/h ele passou, ja tentei usar todas formas:

PHP код:
formar(String80" Vocк passou a %d KM/H no radar e tomou MULTA! "VelocidadeCarro);
formar(String80" Vocк passou a %d KM/H no radar e tomou MULTA! "VelocidadeCarro(playerid));
formar(String80" Vocк passou a %d KM/H no radar e tomou MULTA! "VelocidadeCarro[playerid]); 
Aqui os code:

PHP код:
forward RadarSistema(playerid);
public 
RadarSistema(playerid)
{
    if(
IsPlayerInRangeOfPoint(playerid51543.5094,-1592.4246,13.0079))
    {
        if(
VelocidadeCarro(playerid,true) >= 30)
        {
            foreach(
Playeri)
            {
                
SendClientMessage(playeridCOR_BRANCO" Vocк tomou uma multa ");
                print(
" MULTADO ");
            }
        }
    }
    return 
1;

PHP код:
stock VelocidadeCarro(playerid,bool:kmh)
{
    new 
Float:Vx,Float:Vy,Float:Vz,Float:rtn;
    if(
IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid),Vx,Vy,Vz); else GetPlayerVelocity(playerid,Vx,Vy,Vz);
    
rtn floatsqroot(floatabs(floatpower(Vx Vy Vz,2)));
    return 
kmh?floatround(rtn 100 1.61):floatround(rtn 100);

Reply
#2

O sistema jб funciona perfeitamente e sу falta essa atualizaзгo momentвnea?
Reply
#3

formar?

pawn Код:
format(String, sizeof(String), " Vocк passou a %d KM/H no radar e tomou MULTA! ", VelocidadeCarro(playerid));
Nгo sei como estava pegando .-.

pawn Код:
stock VelocidadeCarro(playerid)
{
    new Float:Vx,Float:Vy,Float:Vz;
    new carro = GetPlayerVehicleID(playerid);
    if(IsPlayerInAnyVehicle(playerid)) return GetVehicleVelocity(carro,Vx,Vy,Vz);    
    return 1;
}
pawn Код:
forward RadarSistema(playerid);
public RadarSistema(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 1543.5094,-1592.4246,13.0079))
    {
        if(VelocidadeCarro(playerid) >= 30)
        {
              SendClientMessage(playerid, COR_BRANCO, "Vocк tomou uma multa!");
              GivePlayerMoney(playerid, -500);
        }
    }
    return 1;
}
Reply
#4

EDIT 2 D::
Fuck, sу da esse erro D:
PHP код:
(3185) : warning 202number of arguments does not match definition 
Linha do Erro*ATUALIZADO*
PHP код:
if(VelocidadeCarro(playerid,true) >= 30
Bom, mudei aqui e compilo, coloquei sу:
PHP код:
if(VelocidadeCarro(playerid) >= 30)//sem o true 
Testei e nгo funfo

**
Nem era formar, aqui que eu esqueci do "t" kkk malz, vou testar o seu aqui!

@Vini
Sim, ja tem "tudo", agora sу falta eu ir adicionando os locais de radar kk.
Reply
#5

Ups, helpme D:
Reply
#6

Vocк tб usando timer?
Reply
#7

Sim, o Timer RadarSistema.
PHP код:
SetTimer("RadarSistema"500true); 
Reply
#8

Nunca vi GetVehicleVelocity ter valores maiores que 2, quanto mais 30 lol

Nгo usa ele pra pegar velocidade real nгo, porque ele armazena a velocidade X, Y e Z.
Partindo do princнpio de que elas sгo vetores separados, e aplicando o Teorema de Pitбgoras, vocк percebe que ela retorna a velocidade fatorada, e nгo a real.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)