[Ajuda] Sistema de RADAR
#1

Seguinte, tenho um sistema de radar mas ele nгo puxa qual a velocidade que o player passou no radar, so mostra quele ele foi pego em alta velocidade.

estava tentando acrescentar esse recurso mas acabei fazendo merda e prejudiquei 9 comandos do server, queria a ajuda de alguйm.


PHP Code:
CheckPlayerSpeeding(playerid)
{
    
// Setup local variables
    
new Name[24], Msg[128];
    
// Check if the player hasn't been caught speeding recently
    
if (APlayerData[playerid][PlayerCaughtSpeeding] == 0)
    {
        
// Loop through all speedcameras
        
for (new CamIDCamID MAX_CAMERASCamID++)
        {
            
// Check if this camera has been created
            
if (ACameras[CamID][CamSpeed] != 0)
            {
                
// Check if the player is the driver of the vehicle
                
if (GetPlayerVehicleSeat(playerid) == 0)
                {
                    
// Check if the player's speed is greater than the speed allowed by this camera (no need to process a distance-check if not speeding)
                    
if (APlayerData[playerid][PlayerSpeed] > ACameras[CamID][CamSpeed])
                    {
                        
// Check if the player is near the camera
                        
if (IsPlayerInRangeOfPoint(playerid50.0ACameras[CamID][CamX], ACameras[CamID][CamY], ACameras[CamID][CamZ]))
                        {
                            
// Prevent the player being caught multiple times by the same speed-camera
                            
APlayerData[playerid][PlayerCaughtSpeeding] = 20;
                            
// Increase the wanted-level of this player by 1 star
                            
SetPlayerWantedLevel(playeridGetPlayerWantedLevel(playerid) + 1);
                            
// Let the player know he's been caught speeding
                            
SendClientMessage(playerid0xFFFFFFFF"Voce passou a %d KM/H e o limite de velocidade permitido й %d KM/H");
                            
// Get the name of the player
                            
GetPlayerName(playeridNamesizeof(Name));
                            
// Also inform all police players that this player is caught speeding
                            
format(Msg128"{00FF00}Player {FFFF00}%s{00FF00} foi pego no radar, persiga-o e multe-o"Name);
                            
Police_SendMessage(Msg);
                        }
                    }
                }
            }
        }
    }
    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


Messages In This Thread
Sistema de RADAR - by Hades12 - 08.03.2019, 17:53
Re: Sistema de RADAR - by Don_Speed - 08.03.2019, 18:15
Re: Sistema de RADAR - by zHellSync - 08.03.2019, 18:22
Re: Sistema de RADAR - by AutoMatic2 - 08.03.2019, 21:24

Forum Jump:


Users browsing this thread: 3 Guest(s)