[Ajuda] Definir veiculo para nгo tomar multa
#3

Quote:
Originally Posted by Mark009
Посмотреть сообщение
Basta utilizar o GetVehicleModel para identificar o modelo do veнculo do jogador e comparб-lo com uma "lista" de veнculos que nгo irгo tomar multa, seria assim:

pawn Код:
new modeloid = GetVehicleModel(GetPlayerVehicleID(playerid));
if(modeloid == 596 || modeloid == 597 || modeloid == 599) //Aqui vocк defini os modelos dos veiculos que nгo irгo tomar multa ao passar no radar.
{
    return 1; //Caso o veнculo do jogador seja um dos modelo acima, haverб o retorno, ou seja, o mesmo nгo irб receber multa.
}
Nos nъmeros vocк deve definir os modelos, vocк pode ver o nъmero de cada modelo aqui: https://sampwiki.blast.hk/wiki/Vehicles:All

No seu caso, esse cуdigo de verificaзгo pode ficar acima de if( t_speedY > speed ), assim:

pawn Код:
stock CheckInRadar( playerid, Float:xx, Float:yy, Float:zz, Float:radius, speed )
{
    if( IsPlayerInRangeOfPoint( playerid, radius, xx, yy, zz ))
    {
        if( GetPlayerState( playerid ) == PLAYER_STATE_DRIVER && PassouRadar[ playerid ] == 0 )
        {
            new
                t_speedY = GetPlayerSpeed( playerid, true ),
                f_speedY = GetPlayerSpeed( playerid, false )
            ;
            new modeloid = GetVehicleModel(GetPlayerVehicleID(playerid));
            if(modeloid == 596 || modeloid == 597 || modeloid == 599) //Aqui vocк defini os modelos dos veiculos que nгo irгo tomar multa ao passar no radar.
            {
                return 1; //Caso o veнculo do jogador seja um dos modelo acima haverб o retorno, ou seja, o mesmo nгo irб receber multa.
            }
            if( t_speedY > speed )
            {
                    if( PassouRadar[ playerid ] == 0 )
                    {
                        SendClientMessage( playerid, COLOR_AZULCLARO, "Ч Policia Rodoviaria Federal Ч" );
                        format( gstring, sizeof( gstring ), "• %s, vocк excedeu o limite de velocidade permitido neste local. Seguem os dados:", PlayerName( playerid ));
                        SendClientMessage( playerid, COLOR_BRANCO, gstring );
                        format( gstring, sizeof( gstring ), "Ч Velocidade mбxima permitida: {FF0000}%d KM/H{FFFFFF}.", speed );
                        SendClientMessage( playerid, COLOR_BRANCO, gstring );
                        format( gstring, sizeof( gstring ), "Ч Velocidade detectada: {FF0000}%d KM/H{FFFFFF}.", t_speedY, f_speedY );
                        SendClientMessage( playerid, COLOR_BRANCO, gstring );
                        format( gstring, sizeof( gstring ), "Ч Veнculo usado no momento da infraзгo: {FF0000}%s{FFFFFF}.", vNome[ GetVehicleModel( GetPlayerVehicleID( playerid )) - 400 ] );
                        SendClientMessage( playerid, COLOR_BRANCO, gstring );
                        format( gstring, sizeof( gstring ), "Ч Valor da multa: {00DD00}$ %d{FFFFFF}.", t_speedY * 2 );
                        SendClientMessage( playerid, COLOR_BRANCO, gstring );
                        TextDrawShowForPlayer( playerid, Flash );
                        GameTextForPlayer( playerid, "~r~RADAR", 2000, 5 );
                        SetTimerEx( "LiberarRadar", 5000, false, "d", playerid );
                        SetTimerEx( "FlashFotoSair", 1500, false, "d", playerid );
                        sGivePlayerCash( playerid, -t_speedY*2 );
                        PlayerPlaySound( playerid, 1132, 0.0, 0.0, 0.0 );
                        PassouRadar[ playerid ] = 1;
                    }
            }
            else if( t_speedY < speed )
            {
                    if( PassouRadar[ playerid ] == 0 )
                    {
                        GameTextForPlayer( playerid, "~y~RADAR", 2000, 5 );
                        format( gstring, sizeof( gstring ), "| RADAR | Velocidade atual detectada: {FF0000}%d KM/H{FFFFFF}.", t_speedY, f_speedY );
                        SendClientMessage( playerid, COLOR_AMARELOCLARO, gstring );
                        SetTimerEx( "LiberarRadar", 5000, false, "d", playerid );
                        PassouRadar[ playerid ] = 1;
                        PlayerPlaySound( playerid, 1132, 0.0, 0.0, 0.0 );
                    }
            }
        }
    }
}
Irei testar aqui .
@Edit
Valeu funcionou perfeitamente . +REP
Reply


Messages In This Thread
Definir veiculo para nгo tomar multa - by Alwe - 09.09.2014, 19:57
Re: Definir veiculo para nгo tomar multa - by Mark009 - 09.09.2014, 20:10
Re: Definir veiculo para nгo tomar multa - by Alwe - 09.09.2014, 20:31

Forum Jump:


Users browsing this thread: 1 Guest(s)