[Ajuda] Erro na Profissгo
#1

Abaixo vocк vizualiza o Codigo e la em baixo msm o Erro.


PHP код:
// This function gets called whenever a courier player enters "/work"
Lixeiro_StartJob(playerid)
{
    
// Setup local variables
    
new HouseCounterHousesInRange[200], DialogList[200];
    
// First clear the house-list
    
for (new i11i++)
        
APlayerData[playerid][CourierHouses][i] = 0;
    
// Count how many owned houses are in range of the player
    
for (new HouseID 1HouseID MAX_HOUSESHouseID++)
    {
        
// Check if the house is owned
        
if (AHouseData[HouseID][Owned] == true)
        {
            
// Check if the house is in range of the player
            
if (IsPlayerInRangeOfPoint(playeridLixeiroJobRangeAHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ]))
            {
                
// Check if there aren't 200 in-range houses have been found yet
                
if (HouseCounter 200)
                {
                    
HousesInRange[HouseCounter] = HouseID// Store the HouseID in the list of in-range houses
                    
HouseCounter++; // Increase the number of owned houses in range of the player (range = 1000 meters)
                
}
                else
                {
                    break; 
// Stop searching for more houses (200 is the maximum)
                
}
            }
        }
    }
    
// Abort the mission if there are less than 2 houses in range and inform the player
    
if (HouseCounter 2)
    {
        
SendClientMessage(playerid0xFFFFFFFF"{FF0000}Nгo а casa no local para recolher lixos, tente algum outro ponto");
        return 
0;
    }
    if (
HouseCounter >= 2)
    {
        
format(DialogListsizeof(DialogList), "Recolher 2 lixos\n"); // Add the line to the dialog
        
APlayerData[playerid][CourierMaxStep] = 2// Set the number of houses for the job to 2
    
}
    if (
HouseCounter >= 5)
    {
        
format(DialogListsizeof(DialogList), "%sRecolher 5 lixos\n"DialogList); // Add the line to the dialog
        
APlayerData[playerid][CourierMaxStep] = 5// Set the number of houses for the job to 5
    
}
    if (
HouseCounter >= 10)
    {
        
format(DialogListsizeof(DialogList), "%sRecolher 10 lixos\n"DialogList); // Add the line to the dialog
        
APlayerData[playerid][CourierMaxStep] = 10// Set the number of houses for the job to 10
    
}
    
APlayerData[playerid][CourierHouses][1] = HousesInRange[random(HouseCounter)];
    
// Now choose as many houses randomly as allowed, starting from the second
    
for (new 2<= APlayerData[playerid][CourierMaxStep]; i++)
    {
        
// Copy a random HouseID from the prepared list on in-range houses to the job-list
        
APlayerData[playerid][CourierHouses][i] = HousesInRange[random(HouseCounter)];
        
// If the HouseID is the same as the previous HouseID (the player would visit the same house twice in a row)
        
while (APlayerData[playerid][CourierHouses][1] == APlayerData[playerid][CourierHouses][i])
            
APlayerData[playerid][CourierHouses][i] = HousesInRange[random(HouseCounter)]; // Get a new random HouseID as long as the HouseID is the same as the previous one
    
}
    
// Let the player choose how many packages he wants to deliver
    
ShowPlayerDialog(playeridDialogCourierSelectQuantDIALOG_STYLE_LIST"Escolha quantos lixos vocк deseja recolher:"DialogListTXT_DialogButtonSelectTXT_DialogButtonCancel);
    return 
1;
}
// This function is called when the player has chosen how many packages he wants to deliver
Lixeiro_BeginJob(playerid)
{
    
// Setup local variables
    
new Lixeiro[128], StepHouseIDFloat:xFloat:yFloat:z,LoadMsgs[128];
    
// Job has started
    
APlayerData[playerid][JobStarted] = true;
    
// Store the vehicleID (required to be able to check if the player left his vehicle)
    
APlayerData[playerid][VehicleID] = GetPlayerVehicleID(playerid);
    
// Set jobstep to 1 (going to the first house)
    
Step 1;
    
APlayerData[playerid][JobStep] = Step;
    
// Get the HouseID of the house where the mission starts (the first house in the list of in-range owned house)
    
HouseID APlayerData[playerid][LixeiroHouses][Step];
    
// Set the TextDraw so the player can see it
    
format(Lixeiro255TXT_LixeiroTextDrawStepAPlayerData[playerid][CourierMaxStep], AHouseData[HouseID][HouseName]);
    
TextDrawSetString(APlayerData[playerid][MissionText], Lixeiro);
    
// Grab the x, y, z positions for the first location
    
AHouseData[HouseID][HouseX];
    
AHouseData[HouseID][HouseY];
    
AHouseData[HouseID][HouseZ];
    
// Create a checkpoint where the player should deliver his package
    
SetPlayerCheckpoint(playeridxyz3);
    
// Set the job-fail-time for the global vehicle-timer
    
APlayerData[playerid][VehicleTimerTime] = Job_TimeToFailMission;
    
// Send the player a message to inform him that the mission has started
    
return 1;
}
// This function is called when a courier enters a checkpoint
Lixeiro_OnPlayerEnterCheckpoint(playerid)
{
    
// Setup local variables
    
new Lixeiro[128], StepHouseIDFloat:xFloat:yFloat:zName[24], Msg[128], Payment;
    
// Check if the player is outside his vehicle while entering a checkpoint
    
if (GetPlayerVehicleSeat(playerid) == -1)
    {
        
// Check if all the packages haven't been delivered
        
if (APlayerData[playerid][CourierMaxStep] != APlayerData[playerid][JobStep])
        {
            
// First disable the current checkpoint
            
DisablePlayerCheckpoint(playerid);
            
// Let the player know he delivered a package
            
GameTextForPlayer(playeridTXT_LixosDeliveredGameText50004);
            
SendClientMessage(playerid0xFFFFFFFFTXT_LixosDeliveredMessage);
            
// Set next JobStep (next house)
            
APlayerData[playerid][JobStep]++;
            
Step APlayerData[playerid][JobStep];
            
// Get the HouseID of the house where the mission starts (the first house in the list of in-range owned house)
            
HouseID APlayerData[playerid][CourierHouses][Step];
            
// Set the TextDraw so the player can see it
            
format(Lixeiro255"~w~Recolher Lixos ~b~%i/%i~w~ para: ~r~%s"StepAPlayerData[playerid][CourierMaxStep], AHouseData[HouseID][HouseName]);
            
TextDrawSetString(APlayerData[playerid][MissionText], Lixeiro);
            
// Grab the x, y, z positions for the first location
            
AHouseData[HouseID][HouseX];
            
AHouseData[HouseID][HouseY];
            
AHouseData[HouseID][HouseZ];
            
// Create a checkpoint where the player should deliver his package
            
SetPlayerCheckpoint(playeridxyz3);
        }
        else 
// All packages have been delivered, the player has to get paid now
        
{
            
// Get the player name
            
GetPlayerName(playeridNamesizeof(Name));
            
// Send a message to all players to inform them that this player completed a courier-job
            
format(Msg128TXT_PlayerCompletedLixeiroJobNameAPlayerData[playerid][CourierMaxStep]);
            
SendClientMessageToAll(0xFFFFFFFFMsg);
            
// Set a payment based on the number of packages
            
Payment APlayerData[playerid][CourierMaxStep] * PaymentPerPackage;
            
// Pay the player money and give scorepoints, both based on the number of packages delivered
            
RewardPlayer(playeridPaymentAPlayerData[playerid][CourierMaxStep]);
            
// Send a message to let the player know he finished his mission and got paid
            
format(Msg128TXT_RewardJobPayment);
            
SendClientMessage(playerid0xFFFFFFFFMsg);
            
// Increase the stats for completing a courier job
            
APlayerData[playerid][StatsLixeiroJobs]++;
            
// End the current trucker job (clear mission-data)
            
Courier_EndJob(playerid);
            
// Also save the data (in case the server crashes, progress would be lost)
            
PlayerFile_Save(playerid);
        }
    }
    else
        
SendClientMessage(playerid0xFFFFFFFFTXT_NeedOnFootToProceed);
    return 
1;
}
// This function is used to stop any Courier-mission that has been started
Lixeiro_EndJob(playerid)
{
    if (
APlayerData[playerid][JobStarted] == true)
    {
        
// Clear all data about the job from the player, so he can start a new one
        
APlayerData[playerid][JobStarted] = false;
        
APlayerData[playerid][JobStep] = 0;
        
APlayerData[playerid][VehicleTimerTime] = 0;
        
APlayerData[playerid][VehicleID] = 0;
        
APlayerData[playerid][CourierMaxStep] = 0;
        
// Clear the list of houses-in-range
        
for (new i11i++)
            
APlayerData[playerid][CourierHouses][i] = 0;
        
// Delete the checkpoint
        
DisablePlayerCheckpoint(playerid);
        
// Reset the missiontext
        
TextDrawSetString(APlayerData[playerid][MissionText], Lixeiro_NoJobText);
    }
    return 
1;

Erro:

C:\Users\Caio\Desktop\[GM]Mundo dos Caminhoneiros\MDC\gamemodes\MDC.pwn(1786) : warning 203: symbol is never used: "Lixeiro_BeginJob"
C:\Users\Caio\Desktop\[GM]Mundo dos Caminhoneiros\MDC\gamemodes\MDC.pwn(1786) : warning 203: symbol is never used: "Lixeiro_EndJob"
C:\Users\Caio\Desktop\[GM]Mundo dos Caminhoneiros\MDC\gamemodes\MDC.pwn(1786) : warning 203: symbol is never used: "Lixeiro_OnPlayerEnterCheckpoint"
C:\Users\Caio\Desktop\[GM]Mundo dos Caminhoneiros\MDC\gamemodes\MDC.pwn(1786) : warning 203: symbol is never used: "Lixeiro_StartJob"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Warnings.
Reply
#2

Nгo sгo erros..
Sу esta avisando que Lixeiro_BeginJob, Lixeiro_EndJob Lixeiro_OnPlayerEnterCheckpoint e Lixeiro_StartJob
Nгo estгo sendo usadas.
Reply
#3

me mande o codigo exato? pf
Reply
#4

pawn Код:
// This function gets called whenever a courier player enters "/work"
stock Lixeiro_StartJob(playerid)
{
    // Setup local variables
    new HouseCounter, HousesInRange[200], DialogList[200];

    // First clear the house-list
    for (new i; i < 11; i++)
        APlayerData[playerid][CourierHouses][i] = 0;

    // Count how many owned houses are in range of the player
    for (new HouseID = 1; HouseID < MAX_HOUSES; HouseID++)
    {
        // Check if the house is owned
        if (AHouseData[HouseID][Owned] == true)
        {
            // Check if the house is in range of the player
            if (IsPlayerInRangeOfPoint(playerid, LixeiroJobRange, AHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ]))
            {
                // Check if there aren't 200 in-range houses have been found yet
                if (HouseCounter < 200)
                {
                    HousesInRange[HouseCounter] = HouseID; // Store the HouseID in the list of in-range houses
                    HouseCounter++; // Increase the number of owned houses in range of the player (range = 1000 meters)
                }
                else
                {
                    break; // Stop searching for more houses (200 is the maximum)
                }
            }
        }
    }

    // Abort the mission if there are less than 2 houses in range and inform the player
    if (HouseCounter < 2)
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Nгo а casa no local para recolher lixos, tente algum outro ponto");
        return 0;
    }
    if (HouseCounter >= 2)
    {
        format(DialogList, sizeof(DialogList), "Recolher 2 lixos\n"); // Add the line to the dialog
        APlayerData[playerid][CourierMaxStep] = 2; // Set the number of houses for the job to 2
    }
    if (HouseCounter >= 5)
    {
        format(DialogList, sizeof(DialogList), "%sRecolher 5 lixos\n", DialogList); // Add the line to the dialog
        APlayerData[playerid][CourierMaxStep] = 5; // Set the number of houses for the job to 5
    }
    if (HouseCounter >= 10)
    {
        format(DialogList, sizeof(DialogList), "%sRecolher 10 lixos\n", DialogList); // Add the line to the dialog
        APlayerData[playerid][CourierMaxStep] = 10; // Set the number of houses for the job to 10
    }

    APlayerData[playerid][CourierHouses][1] = HousesInRange[random(HouseCounter)];
    // Now choose as many houses randomly as allowed, starting from the second
    for (new i = 2; i <= APlayerData[playerid][CourierMaxStep]; i++)
    {
        // Copy a random HouseID from the prepared list on in-range houses to the job-list
        APlayerData[playerid][CourierHouses][i] = HousesInRange[random(HouseCounter)];

        // If the HouseID is the same as the previous HouseID (the player would visit the same house twice in a row)
        while (APlayerData[playerid][CourierHouses][i - 1] == APlayerData[playerid][CourierHouses][i])
            APlayerData[playerid][CourierHouses][i] = HousesInRange[random(HouseCounter)]; // Get a new random HouseID as long as the HouseID is the same as the previous one
    }

    // Let the player choose how many packages he wants to deliver
    ShowPlayerDialog(playerid, DialogCourierSelectQuant, DIALOG_STYLE_LIST, "Escolha quantos lixos vocк deseja recolher:", DialogList, TXT_DialogButtonSelect, TXT_DialogButtonCancel);

    return 1;
}

// This function is called when the player has chosen how many packages he wants to deliver
stock Lixeiro_BeginJob(playerid)
{
    // Setup local variables
    new Lixeiro[128], Step, HouseID, Float:x, Float:y, Float:z,LoadMsgs[128];

    // Job has started
    APlayerData[playerid][JobStarted] = true;
    // Store the vehicleID (required to be able to check if the player left his vehicle)
    APlayerData[playerid][VehicleID] = GetPlayerVehicleID(playerid);
    // Set jobstep to 1 (going to the first house)
    Step = 1;
    APlayerData[playerid][JobStep] = Step;
    // Get the HouseID of the house where the mission starts (the first house in the list of in-range owned house)
    HouseID = APlayerData[playerid][LixeiroHouses][Step];
    // Set the TextDraw so the player can see it
    format(Lixeiro, 255, TXT_LixeiroTextDraw, Step, APlayerData[playerid][CourierMaxStep], AHouseData[HouseID][HouseName]);
    TextDrawSetString(APlayerData[playerid][MissionText], Lixeiro);
    // Grab the x, y, z positions for the first location
    x = AHouseData[HouseID][HouseX];
    y = AHouseData[HouseID][HouseY];
    z = AHouseData[HouseID][HouseZ];
    // Create a checkpoint where the player should deliver his package
    SetPlayerCheckpoint(playerid, x, y, z, 3);
    // Set the job-fail-time for the global vehicle-timer
    APlayerData[playerid][VehicleTimerTime] = Job_TimeToFailMission;
    // Send the player a message to inform him that the mission has started

    return 1;
}



// This function is called when a courier enters a checkpoint
stock Lixeiro_OnPlayerEnterCheckpoint(playerid)
{
    // Setup local variables
    new Lixeiro[128], Step, HouseID, Float:x, Float:y, Float:z, Name[24], Msg[128], Payment;

    // Check if the player is outside his vehicle while entering a checkpoint
    if (GetPlayerVehicleSeat(playerid) == -1)
    {
        // Check if all the packages haven't been delivered
        if (APlayerData[playerid][CourierMaxStep] != APlayerData[playerid][JobStep])
        {
            // First disable the current checkpoint
            DisablePlayerCheckpoint(playerid);
            // Let the player know he delivered a package
            GameTextForPlayer(playerid, TXT_LixosDeliveredGameText, 5000, 4);
            SendClientMessage(playerid, 0xFFFFFFFF, TXT_LixosDeliveredMessage);
            // Set next JobStep (next house)
            APlayerData[playerid][JobStep]++;
            Step = APlayerData[playerid][JobStep];
            // Get the HouseID of the house where the mission starts (the first house in the list of in-range owned house)
            HouseID = APlayerData[playerid][CourierHouses][Step];
            // Set the TextDraw so the player can see it
            format(Lixeiro, 255, "~w~Recolher Lixos ~b~%i/%i~w~ para: ~r~%s", Step, APlayerData[playerid][CourierMaxStep], AHouseData[HouseID][HouseName]);
            TextDrawSetString(APlayerData[playerid][MissionText], Lixeiro);
            // Grab the x, y, z positions for the first location
            x = AHouseData[HouseID][HouseX];
            y = AHouseData[HouseID][HouseY];
            z = AHouseData[HouseID][HouseZ];
            // Create a checkpoint where the player should deliver his package
            SetPlayerCheckpoint(playerid, x, y, z, 3);
        }
        else // All packages have been delivered, the player has to get paid now
        {
            // Get the player name
            GetPlayerName(playerid, Name, sizeof(Name));
            // Send a message to all players to inform them that this player completed a courier-job
            format(Msg, 128, TXT_PlayerCompletedLixeiroJob, Name, APlayerData[playerid][CourierMaxStep]);
            SendClientMessageToAll(0xFFFFFFFF, Msg);
            // Set a payment based on the number of packages
            Payment = APlayerData[playerid][CourierMaxStep] * PaymentPerPackage;
            // Pay the player money and give scorepoints, both based on the number of packages delivered
            RewardPlayer(playerid, Payment, APlayerData[playerid][CourierMaxStep]);
            // Send a message to let the player know he finished his mission and got paid
            format(Msg, 128, TXT_RewardJob, Payment);
            SendClientMessage(playerid, 0xFFFFFFFF, Msg);

            // Increase the stats for completing a courier job
            APlayerData[playerid][StatsLixeiroJobs]++;
            // End the current trucker job (clear mission-data)
            Courier_EndJob(playerid);
            // Also save the data (in case the server crashes, progress would be lost)
            PlayerFile_Save(playerid);
        }
    }
    else
        SendClientMessage(playerid, 0xFFFFFFFF, TXT_NeedOnFootToProceed);

    return 1;
}



// This function is used to stop any Courier-mission that has been started
stock Lixeiro_EndJob(playerid)
{
    if (APlayerData[playerid][JobStarted] == true)
    {
        // Clear all data about the job from the player, so he can start a new one
        APlayerData[playerid][JobStarted] = false;
        APlayerData[playerid][JobStep] = 0;
        APlayerData[playerid][VehicleTimerTime] = 0;
        APlayerData[playerid][VehicleID] = 0;
        APlayerData[playerid][CourierMaxStep] = 0;

        // Clear the list of houses-in-range
        for (new i; i < 11; i++)
            APlayerData[playerid][CourierHouses][i] = 0;

        // Delete the checkpoint
        DisablePlayerCheckpoint(playerid);
        // Reset the missiontext
        TextDrawSetString(APlayerData[playerid][MissionText], Lixeiro_NoJobText);
    }

    return 1;
}
Com isso /\ os warnnings irгo sumir, mais fique sabendo que voce nгo esta usando nenhuma dessas funзхes..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)