[Ajuda] Ajuda na fiscalizaзгo ppc_trucking
#1

Boa noite, bom eu queria ajuda aqui pf.. Se eu colocar a fiscalizaзгo em primeiro lguar, e passar na fiscalizaзгo, sou pego, mas se passar no radar, nгo aparece nada ... Tem como alguйm me ajuda ?


Jб tentei colocar else mas dб erro

Codigo que tentei



pawn Код:
CheckPlayerSpeeding(playerid)
{
    // Setup local variables
    new Name[28], Msg[128], Msgg[128], location[MAX_ZONE_NAME], targetid;

    // Check if the player hasn't been caught speeding recently
    if (APlayerData[playerid][PlayerCaughtSpeeding] == 0)
    {
        for (new FiscaID; FiscaID < MAX_FISCA; FiscaID++)
        {
            // Fiscaaaaaaaaa
            // Check if this camera has been created
            if (AFiscal[FiscaID][FiscaSpeed] != 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] > AFiscal[FiscaID][FiscaSpeed])
                    {
                        // Check if the player is near the camera
                        if (IsPlayerInRangeOfPoint(playerid, 40.0, AFiscal[FiscaID][FiscaX], AFiscal[FiscaID][FiscaY], AFiscal[FiscaID][FiscaZ]))
                        {
                            new Ha[128];
                            // 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(playerid, GetPlayerWantedLevel(playerid) + 1);
                            // Let the player know he's been caught speeding
                            format(Ha, sizeof(Ha), "[Fiscalizaзгo] {FF0000}Vocк foi flagrado pela fiscalizaзгo: {FFFFFF}%i Km/h {FF0000}[Permitido: {FFFFFF}%i{FF0000}].", APlayerData[playerid][PlayerSpeed], AFiscal[FiscaID][FiscaSpeed]);
                            SendClientMessage(playerid, -1, Ha);
                            // Get the name of the player
                            GetPlayerName(playerid, Name, sizeof(Name));
                            GetPlayer2DZonea(targetid, location, MAX_ZONE_NAME);
                            // Also inform all police players that this player is caught speeding
                            format(Msg, 128, "[Radar] %s {FF0000}foi flagrado em alta velocidade pelo {FFFFFF}radar!", Name);
                            format(Msgg, 128, "[Local] {FF0000}Visto pela ultima vez proximo de: {FFFFFF}%s", location);
                            Police_SendMessage(Msg);
                            Police_SendMessage(Msgg);
                        }
                    }
                }
            }
        }
                else
        // Loop through all speedcameras
        for (new CamID; CamID < MAX_CAMERAS; CamID++)
        {
            // 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(playerid, 40.0, ACameras[CamID][CamX], ACameras[CamID][CamY], ACameras[CamID][CamZ]))
                        {
                            new Ha[128];
                            // 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(playerid, GetPlayerWantedLevel(playerid) + 1);
                            // Let the player know he's been caught speeding
                            format(Ha, sizeof(Ha), "[Radar] {FF0000}Vocк foi flagrado a: {FFFFFF}%i Km/h {FF0000}[Permitido: {FFFFFF}%i{FF0000}].", APlayerData[playerid][PlayerSpeed], ACameras[CamID][CamSpeed]);
                            SendClientMessage(playerid, -1, Ha);
                            // Get the name of the player
                            GetPlayerName(playerid, Name, sizeof(Name));
                            GetPlayer2DZonea(targetid, location, MAX_ZONE_NAME);
                            // Also inform all police players that this player is caught speeding
                            format(Msg, 128, "[Radar] %s {FF0000}foi flagrado em alta velocidade pelo {FFFFFF}radar!", Name);
                            format(Msgg, 128, "[Local] {FF0000}Visto pela ultima vez proximo de: {FFFFFF}%s", location);
                            Police_SendMessage(Msg);
                            Police_SendMessage(Msgg);
                        }
                    }
                }
            }
        }
    }
    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]--;
}

Codigo desbugado

pawn Код:
CheckPlayerSpeeding(playerid)
{
    // Setup local variables
    new Name[28], Msg[128], Msgg[128], location[MAX_ZONE_NAME], targetid;

    // Check if the player hasn't been caught speeding recently
    if (APlayerData[playerid][PlayerCaughtSpeeding] == 0)
    {
        for (new FiscaID; FiscaID < MAX_FISCA; FiscaID++)
        {
            // Fiscaaaaaaaaa
            // Check if this camera has been created
            if (AFiscal[FiscaID][FiscaSpeed] != 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] > AFiscal[FiscaID][FiscaSpeed])
                    {
                        // Check if the player is near the camera
                        if (IsPlayerInRangeOfPoint(playerid, 40.0, AFiscal[FiscaID][FiscaX], AFiscal[FiscaID][FiscaY], AFiscal[FiscaID][FiscaZ]))
                        {
                            new Ha[128];
                            // 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(playerid, GetPlayerWantedLevel(playerid) + 1);
                            // Let the player know he's been caught speeding
                            format(Ha, sizeof(Ha), "[Fiscalizaзгo] {FF0000}Vocк foi flagrado pela fiscalizaзгo: {FFFFFF}%i Km/h {FF0000}[Permitido: {FFFFFF}%i{FF0000}].", APlayerData[playerid][PlayerSpeed], AFiscal[FiscaID][FiscaSpeed]);
                            SendClientMessage(playerid, -1, Ha);
                            // Get the name of the player
                            GetPlayerName(playerid, Name, sizeof(Name));
                            GetPlayer2DZonea(targetid, location, MAX_ZONE_NAME);
                            // Also inform all police players that this player is caught speeding
                            format(Msg, 128, "[Radar] %s {FF0000}foi flagrado em alta velocidade pelo {FFFFFF}radar!", Name);
                            format(Msgg, 128, "[Local] {FF0000}Visto pela ultima vez proximo de: {FFFFFF}%s", location);
                            Police_SendMessage(Msg);
                            Police_SendMessage(Msgg);
                        }
                    }
                }
            }
        }
        // Loop through all speedcameras
        for (new CamID; CamID < MAX_CAMERAS; CamID++)
        {
            // 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(playerid, 40.0, ACameras[CamID][CamX], ACameras[CamID][CamY], ACameras[CamID][CamZ]))
                        {
                            new Ha[128];
                            // 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(playerid, GetPlayerWantedLevel(playerid) + 1);
                            // Let the player know he's been caught speeding
                            format(Ha, sizeof(Ha), "[Radar] {FF0000}Vocк foi flagrado a: {FFFFFF}%i Km/h {FF0000}[Permitido: {FFFFFF}%i{FF0000}].", APlayerData[playerid][PlayerSpeed], ACameras[CamID][CamSpeed]);
                            SendClientMessage(playerid, -1, Ha);
                            // Get the name of the player
                            GetPlayerName(playerid, Name, sizeof(Name));
                            GetPlayer2DZonea(targetid, location, MAX_ZONE_NAME);
                            // Also inform all police players that this player is caught speeding
                            format(Msg, 128, "[Radar] %s {FF0000}foi flagrado em alta velocidade pelo {FFFFFF}radar!", Name);
                            format(Msgg, 128, "[Local] {FF0000}Visto pela ultima vez proximo de: {FFFFFF}%s", location);
                            Police_SendMessage(Msg);
                            Police_SendMessage(Msgg);
                        }
                    }
                }
            }
        }
    }
    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
#2

Alguйm ?
Reply
#3

Cria outra tipo CheckPlayerSpeeding(playerid) so que para a fiscalizaзгo
Reply
#4

Quote:
Originally Posted by Don_Speed
Посмотреть сообщение
Cria outra tipo CheckPlayerSpeeding(playerid) so que para a fiscalizaзгo
Vlw Don, mas mesmo asism nгo consegui, porque eu sу define o CheckPlayerSpeeding no speedometer, porque nгo acho em mais nenhuma include :/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)