Bom... tentei fazer com que o radar no meu servidor nгo funcionasse caso o player estiver em um veнculo "nгo terrestre"... Porйm nгo obtive sucesso, sou novo no pawno entгo se alguйm puder dar essa "forcinha" ai eu agradeзo muito!
Pra quem nгo entendeu direito eu quero que o jogador leve multas quando passar no radar apenas se estiver em veнculos normais, e nгo aviхes/barcos/helicуpteros...
Code:
public Radar(playerid)
{
if(IsPlayerInAnyVehicle(playerid)) {
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER){
new Float:X, Float:Y, Float:Z, Float:Speed;
GetVehicleVelocity(GetPlayerVehicleID(playerid), X, Y, Z);
Speed = floatmul(floatsqroot(floatadd(floatadd(floatpower(X, 2), floatpower(Y, 2)), floatpower(Z, 2))), 100.0);
new Float:vcarro;
GetVehicleHealth(GetPlayerVehicleID(playerid), vcarro);
new velocid;
velocid = floatround(Speed, floatround_floor);
if(IsPlayerInCircle(playerid, 1698.01270, -736.61951, 20) || IsPlayerInCircle(playerid, 1348.89185, -1437.88037,20) || IsPlayerInCircle(playerid, 1207.30078, -1706.53113,20) || IsPlayerInCircle(playerid,-121.80331, -1204.59814,20) || IsPlayerInCircle(playerid,-1654.15955, 2730.46631,20) || IsPlayerInCircle(playerid, 1217.35876, 1689.29993, 20) || IsPlayerInCircle(playerid, 877.14832, 2617.93750,20) || IsPlayerInCircle(playerid, -2681.44043, 1697.19482,20)
|| IsPlayerInCircle(playerid,521.51068, -1722.01721,20) || IsPlayerInCircle(playerid,884.85620, -1389.45581,20) || IsPlayerInCircle(playerid, 1698.01270, -736.61951, 20) || IsPlayerInCircle(playerid, 356.64810, -1376.79541,20) || IsPlayerInCircle(playerid, -152.74860, -1482.63660,20) || IsPlayerInCircle(playerid, -1093.93665, -2857.70215,20) || IsPlayerInCircle(playerid, -2887.01465, -1030.04370,20) || IsPlayerInCircle(playerid, -845.09442, -1045.57422,20)
|| IsPlayerInCircle(playerid,-1817.13293, 206.84985,20) || IsPlayerInCircle(playerid,-379.07733, 2708.18726,20) || IsPlayerInCircle(playerid,2137.04468, 2019.77856,20) || IsPlayerInCircle(playerid,370.2837,1497.6050,20) || IsPlayerInCircle(playerid,-628.94098, 651.85773,20) || IsPlayerInCircle(playerid,-167.75929, 367.75211,20) || IsPlayerInCircle(playerid,-708.56897, -1471.71875,20) || IsPlayerInCircle(playerid,520.20801, 473.19461,20) || IsPlayerInCircle(playerid,-1663.99243, -1636.30969,20)){
if(velocid > 95){
if(aradar[playerid] == 0){
SendClientMessage(playerid,Vermelho,"==========================================> Radar <==========================================");
TextDrawShowForPlayer(playerid, Flash);
PlayerPlaySound(playerid,1132,0.0,0.0,0.0);
format(gstring, 128,"| RADAR | Velocidade Registrada: %iKm/h",velocid);
SendClientMessage(playerid,Amarelo,gstring);
SendClientMessage(playerid,Branco,"| INFO | Vocк foi pego(a) no radar,por estar acima do limite permitido(85KM/h)");
SendClientMessage(playerid,Branco,"| INFO | Portanto,vocк foi multado em {1CEB00}$500, {FFFFFF}Para pagar vб atй o Detran de LV!");
format(gstring, 128,"| INFO | No total,vocк tem %d Multas",dini_Int(filena(playerid),"Multas")+1);
SendClientMessage(playerid,Branco,gstring);
SetTimerEx("flex", 1000, false, "i", playerid);
SendClientMessage(playerid,Branco,"| INFO | Ao completar {FF0000}6 multas {FFFFFF}vocк perdera sua habilitaзгo terrestre e pagarб {1CEB00}$6.000!");
dini_IntSet(filena(playerid), "Multas",dini_Int(filena(playerid),"Multas")+1);
if(dini_Int(filena(playerid),"Multas") >= 6){
PlayerInfo[playerid][pHabTerrestre] = 0;
dini_IntSet(filena(playerid),"SaldoBancario",dini_Int(filena(playerid),"SaldoBancario")-6000);
dini_IntSet(filena(playerid),"Multas",0);
SendClientMessage(playerid,Branco,"| INFO | Vocк completou {FF0000}6 multas {FFFFFF}sem pagar, perdeu sua habilitaзгo e pagou {1CEB00}$6.000!");
}
SendClientMessage(playerid,Vermelho,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> Radar <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
aradar[playerid] = 1;
}
} else {
if(aradar[playerid] == 0){
GameTextForPlayer(playerid, "~r~RADAR", 3000, 3);
format(gstring, 256,"| RADAR | Velocidade Registrada: %iKm/h",velocid);
SendClientMessage(playerid,Amarelo,gstring);
aradar[playerid] = 1;
}
}
} else aradar[playerid] = 0;
}
}
}
Faзa a verificaзгo pra ver se o veнculo nгo й terrestre (com GetPlayerVehicleID) e depois use o retorno.