03/02/2024 16:56
Código PHP:
stock CheckInRadar(playerid, Float:X, Float:Y, Float:Z, Float:radius, Speed)
{
new VehVelocity = VelocidadeDoVeiculo(GetPlayerVehicleID(playerid));
if(IsPlayerInRangeOfPoint(playerid, radius, X, Y, Z) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new vehid = GetPlayerVehicleID(playerid);
if(VehVelocity > Speed)
{
if(LiberouRadar[playerid] < gettime())
{
if(IsABike(vehid)) return 1;
format(String, sizeof(String), "| RADAR | Velocidade Registrada: %d KM/H", VehVelocity);
SendClientMessage(playerid, COR_AMARELO, String);
pInfo[playerid][Fines]++;
pInfo[playerid][ValueFines] = pInfo[playerid][ValueFines] + VehVelocity * 3;
SendClientMessage(playerid, COR_VERDE, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[ RADAR ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
format(String, sizeof(String), "| RADAR | Você Passou Nesse Radar Acima Do Limite Permitido: %dKm/h", Speed);
SendClientMessage(playerid, -1, String);
format(String, sizeof(String), "| MULTAS | Você Recebeu %d Multa(s) Na Habilitação Da Sua Classe Veicular", pInfo[playerid][Fines]);
SendClientMessage(playerid, -1, String);
SendClientMessage(playerid, COR_VERDE, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[ RADAR ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
GameTextForPlayer(playerid, "~r~MULTA", 2500, 3);
LiberouRadar[playerid] = gettime() + 5;
PlayerPlaySound(playerid, 1132, 0.0, 0.0, 0.0);
//
if(pInfo[playerid][Fines] == 6)
{
format(String, sizeof(String), "| RADAR | Velocidade Registrada: %d KM/H", VehVelocity);
SendClientMessage(playerid, COR_AMARELO, String);
pInfo[playerid][Fines] = 0;
pInfo[playerid][ValueFines] = 0;
// mysql_format(DBConn, Query, sizeof(Query), "UPDATE bank_accounts SET Balance=Balance-6000 WHERE ID=%d && Disabled=0", CurrentAccountID[playerid]);
// mysql_tquery(DBConn, Query);
//pInfo[playerid][HabTerrestre] = 0;
GameTextForPlayer(playerid, "~r~MULTA", 2500, 3);
PlayerPlaySound(playerid, 1132, 0.0, 0.0, 0.0);
LiberouRadar[playerid] = gettime() + 5;
SendClientMessage(playerid, COR_VERDE, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[ RADAR ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
format(String, sizeof(String), "| RADAR | Velocidade Detectada: %d Km/h", VehVelocity);
SendClientMessage(playerid, COR_AMARELO, String);
SendClientMessage(playerid, -1, "| MULTAS | Você Perdeu A Sua Habilitação E Pagou Uma Taxa De 6.000 Por Ter Acumulado 6 Multas.");
SendClientMessage(playerid, COR_VERDE, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[ RADAR ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
}
}
}
else if(VehVelocity < Speed)
{
GameTextForPlayer(playerid, "~g~RADAR", 2000, 3);
if(LiberouRadar[playerid] < gettime() && VehVelocity > 0)
{
LiberouRadar[playerid] = gettime() + 5;
}
return 1;
}
else if(VehVelocity > (Speed + 10))
{
if(LiberouRadar[playerid] < gettime())
{
LiberouRadar[playerid] = gettime() + 5;
SendClientMessage(playerid, COR_VERDE, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Radar ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
format(String, sizeof(String), "| RADAR | A Velocidade Maxima Permitida Desse Radar é de %dKm/h E Você Passou a %dKm/h!", Speed, VehVelocity);
SendClientMessage(playerid, -1, String);
format(String, sizeof(String), "| RADAR | Tolerância De Ate %dKm/h Sem Receber Multa!", Speed + 10);
SendClientMessage(playerid, COR_AMARELO, String);
SendClientMessage(playerid, COR_VERDE, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Radar ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
GameTextForPlayer(playerid, "~y~RADAR", 2000, 3);
return 1;
}
//printf("Velocidade Radar: %d | Velocidade Veiculo: %d | Passou No Limite: %s", Speed, VehVelocity , VehVelocity >= (Speed - 10) ? ("Passou") : ("Não Passou"));
}
else if(VehVelocity > (Speed + 25))
{
GameTextForPlayer(playerid, "~r~MULTA", 2000, 3);
if(LiberouRadar[playerid] < gettime() && VehVelocity > 0)
{
LiberouRadar[playerid] = gettime() + 5;
}
SendClientMessage(playerid, COR_VERDE, "| RADAR | Você Passou No Radar Acima Do Limite Permitido, Foi Adicionado +1 Estrela de Procurado Por Estar Em Uma Possivel Fuga.");
return 1;
}
else if(Fardado[playerid] == true)
{
SendClientMessage(playerid, COR_VERDE, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Radar ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
format(String, sizeof(String), "| RADAR | Velocidade Registrada: %d KM/H | Você Não Levou Multa Por Estar Fardado!", VehVelocity);
SendClientMessage(playerid, COR_AMARELO, String);
SendClientMessage(playerid, COR_VERDE, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Radar ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
GameTextForPlayer(playerid, "~y~RADAR LIBERADO", 2000, 3);
if(LiberouRadar[playerid] < gettime() && VehVelocity > 0)
{
LiberouRadar[playerid] = gettime() + 5;
}
return 1;
}
}
return 1;
}
Programador SA-MP Desde 2020.
Desenvolvendo Garver Roleplay...