[Ajuda] Radar nгo funfa ajuda
#1

Glr eu crio um radar de 90 exemplo e passo a + de 100 km/h e o radar nгo pega meu amigo falo pra ver uns 2 arquivos olhei como tava meio o nome tava certo + eu acho q ta faltando alguma coisa slб alguem pode me ajudar pfv eu uso a GM Brasil vida de cargas
Reply
#2

Sem cуdigo nгo podemos lhe ajudar camarada!
Reply
#3

Quote:
Originally Posted by Cidiei
Посмотреть сообщение
Sem cуdigo nгo podemos lhe ajudar camarada!
Bom eu n sei mt bem onde fica o codigo pq so iniciante ainda com essa parada + achei esse codigo no PPC_Common

Quote:

// This function creates a speedcamera (store data and create the objects)
SetupSpeedCamera(CamID, Float, Float:y, Float:z, Float:rot, MaxSpeed)
{
// Store all the given values
ACameras[CamID][CamX] = x;
ACameras[CamID][CamY] = y;
ACameras[CamID][CamZ] = z;
ACameras[CamID][CamAngle] = rot;
ACameras[CamID][CamSpeed] = MaxSpeed;
// Create both camera objects and store their reference
new JS_TEXTO[256];
format(JS_TEXTO, sizeof(JS_TEXTO), "{FF0000}[RADAR] \nVel. Mбxima {FFFF00}%i {FF0000}Km/h ",MaxSpeed);
ACameras[CamID][Cam3DText] = CreateDynamic3DTextLabel(JS_TEXTO,-1,x,y,z +5.0,100.0);
ACameras[CamID][CamObj1] = CreateObject(18880, x, y, z, 0.0, 0.0, rot);
ACameras[CamID][CamObj2] = CreateObject(18880, x, y, z, 0.0, 0.0, rot + 180.0);
ACameras[CamID][CamObj3] = CreateDynamicMapIcon(x, y, z, 34, 0, 0, 0, -1, 300.0);
}

Esse Codigo a baixo peguei de outro gm q funfa o radar e o codigo й
Quote:

SetupSpeedCamera(CamID, Float, Float:y, Float:z, Float:rot, MaxSpeed)
{
new String[128];
ACameras[CamID][CamX] = x;
ACameras[CamID][CamY] = y;
ACameras[CamID][CamZ] = z;
ACameras[CamID][CamAngle] = rot;
ACameras[CamID][CamSpeed] = MaxSpeed;
ACameras[CamID][CamObj1] = CreateObject(18880, x, y, z, 0.0, 0.0, rot);
ACameras[CamID][CamObj2] = CreateObject(18880, x, y, z, 0.0, 0.0, rot + 180.0);
ACameras[CamID][CamObj3] = CreateDynamicMapIcon(x, y, z, 34, 0, 0, 0, -1, 300.0);
format(String, sizeof(String), "{FF0000}Vel. Max\n{FFFFFF}%i {FF0000}Km/h", MaxSpeed);
ACameras[CamID][CamObj4] = Create3DTextLabel(String, -1, x, y, z + 4.2, 150.0, 0, 0);
}

Reply
#4

Isso ai sу define as variaveis, vб em PPC_Speedometer em CheckPlayerSpeeding(playerid) e poste-o aqui.
Reply
#5

Quote:
Originally Posted by TenhoUmaDuvida
Посмотреть сообщение
Isso ai sу define as variaveis, vб em PPC_Speedometer em CheckPlayerSpeeding(playerid) e poste-o aqui.
Tem 2 CheckPlayerSpeeding eu acho q й esse ve ai

Quote:

// This function checks if the player is speeding near a speedcamera
CheckPlayerSpeeding(playerid)
{
// Setup local variables
new Name[24], Msg[128];
new Msg2[128];
if (APlayerData[playerid][PlayerCaughtSpeeding] == 0)
{
for (new CamID; CamID < MAX_CAMERAS; CamID++)
{
if (ACameras[CamID][CamSpeed] != 0)
{
/*if (IsPlayerInRangeOfPoint(playerid, 100.0, ACameras[CamID][CamX], ACameras[CamID][CamY], ACameras[CamID][CamZ]))
{
TextDrawShowForPlayer(playerid, RadarRadar[playerid]);
SetTimer("DestruirTextRadar", 3000, false);
}*/
if (GetPlayerVehicleSeat(playerid) == 0)
{
if (APlayerData[playerid][PlayerSpeed] > ACameras[CamID][CamSpeed])
{
if (IsPlayerInRangeOfPoint(playerid, 30.0, ACameras[CamID][CamX], ACameras[CamID][CamY], ACameras[CamID][CamZ]))
{
GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);
APlayerData[playerid][PlayerCaughtSpeeding] = 20;
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 1);
SendClientMessage(playerid, 0xFFFFFFFF, TXT_PlayerCaughtSpeeding);
GetPlayerName(playerid, Name, sizeof(Name));
format(Msg, 128, "{FFFF00}[INFO] {009D4F}Player %s estб dirigindo em alta velocidade, pare-o e multe-o", Name);
Police_SendMessage(Msg);
format(Msg2, sizeof(Msg2), "{009D4F}Visto pela ъltima vez nas redondezas de: {AFAFAF}%s", zone);
Police_SendMessage(Msg2);
}
}
}
}
}
}
else // If the player has been caught before, reduce the value until it's 0 again, then he can be caught again
APlayerData[playerid][PlayerCaughtSpeeding]--;
}

Reply
#6

Mostre-o outro que vocк citou acima.
Reply
#7

Quote:
Originally Posted by TenhoUmaDuvida
Посмотреть сообщение
Mostre-o outro que vocк citou acima.
Esse aqui sу tem os 2 nessa pasta

Quote:

// Check if the player is not in any plane or helicopter (those cannot be caught by speedcamera's)
if (IsVehicleAirVehicle(vehicleid) == 0)
if (APlayerData[playerid][PlayerClass] != ClassPolice && APlayerData[playerid][PlayerClass] != ClassBombeiro) // Check if the player isn't speeding (cops won't get caught)
CheckPlayerSpeeding(playerid);
}
else
{
// If the player is not inside a vehicle, display an empty string (looks like the speedometer is gone)
//TextDrawSetString(APlayerData[playerid][SpeedometerText], " ");
TextDrawSetString(APlayerData[playerid][FuelGauge], " ");
TextDrawSetString(APlayerData[playerid][MotorDraw], " ");
TextDrawSetString(APlayerData[playerid][FarolDraw], " ");
TextDrawSetString(APlayerData[playerid][AtreladoDraw], " ");
TextDrawSetString(APlayerData[playerid][TextRadar], " ");
//TextDrawSetString(APlayerData[playerid][KmhV], " ");

// Set the speed of the player to 0
APlayerData[playerid][PlayerSpeed] = 0;
}
}



// This timer-function is called when a player picks up a refuelpickup
public RefuelVehicle(playerid)
{
new RefuelMsg[128];
// Get the vehicle-id of the player's vehicle
new vID = GetPlayerVehicleID(playerid);
// Calculate the amount of fuel that needs to be refuelled
new Amount = MaxFuel - AVehicleData[vID][Fuel];
// Calculate the price to refuel
new RefuelPrice = (Amount * RefuelMaxPrice) / MaxFuel;

// Check if the player has enough cash
if (APlayerData[playerid][PlayerMoney] >= RefuelPrice)
{
// Refuel the vehicle
AVehicleData[vID][Fuel] = MaxFuel;
// Withdraw the money from the player
RewardPlayer(playerid, -RefuelPrice, 0);
// Let the player know he refuelled his vehicle
format(RefuelMsg, 128, TXT_RefuelledVehicle, RefuelPrice);
SendClientMessage(playerid, 0xFFFFFFFF, RefuelMsg);
}
else
SendClientMessage(playerid, 0xFFFFFFFF, TXT_CannotRefuelVehicle);

// Allow the player to move again
TogglePlayerControllable(playerid, 1);

return 1;
}

Reply
#8

Isso nгo й uma segunda funзгo, ai a funзгo estб sendo usada, por esses codes ai, notei que vocк pegou gm da net, te aconselho a pegar um gm mais Simples se for pegar. Sobre o problema, no cуdigo estб para setar 1 estrela a mais, alguma coisa estб burlando o cуdigo, tente fazer um debug.
Reply
#9

Quote:
Originally Posted by TenhoUmaDuvida
Посмотреть сообщение
Isso nгo й uma segunda funзгo, ai a funзгo estб sendo usada, por esses codes ai, notei que vocк pegou gm da net, te aconselho a pegar um gm mais Simples se for pegar. Sobre o problema, no cуdigo estб para setar 1 estrela a mais, alguma coisa estб burlando o cуdigo, tente fazer um debug.
Eu so iniciante com isso eu nem sei como faz o debug se tiver como me ajudar
Reply
#10

[Tutorial] Como fazer um debug.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)