09.09.2014, 19:57
Bom, queria definir um certo veiculo para nгo tomar multa, mas nгo sei como encaixar isso no cуdigo, alguem poderia me ajudar, ou dar algum exemplo, tutorial ou algo do tipo por favor ?
Cуdigo :
Cуdigo :
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 )
;
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 );
}
}
}
}
}