15.06.2014, 11:02
Error:
codes:
Код:
E:\WOT\gamemodes\555.pwn(6672) : error 017: undefined symbol "Train_SetRandomJob" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
pawn Код:
// This function is called when a truckdriver wants to start a job by entering "/work" and has no truckers license
Train_StartRandomJob(playerid)
{
// Check if a job could be set correctly (player must be driving a valid trucking vehicle)
if (Train_SetRandomJob(playerid) != 0)
{
// Setup local variables
new StartLoc[50], EndLoc[50], Load[50], RouteText[255], Float:x, Float:y, Float:z, LoadMsg[128];
// Job has started
PInfo[playerid][JobStarted] = true;
// Set jobstep to 1 (going to load the goods)
PInfo[playerid][JobStep] = 1;
// Get the startlocation, endlocation and the load texts
format(StartLoc, 50, ALocations[PInfo[playerid][JobLoc1]][LocationName]);
format(EndLoc, 50, ALocations[PInfo[playerid][JobLoc2]][LocationName]);
format(Load, 50, ALoads[PInfo[playerid][LoadID]][LoadName]);
// Combine it all into a string for the TextDraw (the player can see this all the time) to describe the mission
format(RouteText, 255, TXT_HaulingCargoFromToPickup, Load, StartLoc, EndLoc);
// Set the TextDraw so the player can see it
TextDrawSetString(PInfo[playerid][MissionText], RouteText);
// Grab the x, y, z positions for the first location
x = ALocations[PInfo[playerid][JobLoc1]][LocX];
y = ALocations[PInfo[playerid][JobLoc1]][LocY];
z = ALocations[PInfo[playerid][JobLoc1]][LocZ];
// Create a checkpoint where the player should load the goods
SetPlayerCheckpoint(playerid, x, y, z, 7);
// Set the job-fail-time for the global vehicle-timer
PInfo[playerid][VehicleTimerTime] = Job_TimeToFailMission;
// Inform the player that he must load his goods
format(LoadMsg, 128, TXT_PickupCargoAt, Load, StartLoc);
SendClientMessage(playerid, 0xFFFFFFFF, LoadMsg);
}
return 1;
}
// This function is used to cleanup the current job
Train_EndJob(playerid)
{
if (PInfo[playerid][JobStarted] == true)
{
// Clear the Mafia-wanted status of the vehicle (or trailer) in the array "AVehicleData"
if (PInfo[playerid][TrailerID] == 0)
AVehicleData[PInfo[playerid][VehicleID]][MafiaLoad] = false; // The player has no trailer, so clear his main vehicle as wanted by the mafia
else
AVehicleData[PInfo[playerid][TrailerID]][MafiaLoad] = false; // The player has a trailer, so clear his trailer as wanted by the mafia
// Clear all data about the job from the player, so he can start a new one
PInfo[playerid][JobStarted] = false;
PInfo[playerid][JobStep] = 0;
PInfo[playerid][JobID] = 0;
PInfo[playerid][VehicleTimerTime] = 0;
PInfo[playerid][VehicleID] = 0;
PInfo[playerid][TrailerID] = 0;
PInfo[playerid][LoadID] = 0;
PInfo[playerid][JobLoc1] = 0;
PInfo[playerid][JobLoc2] = 0;
PInfo[playerid][MafiaLoad] = false;
// Delete the checkpoint
DisablePlayerCheckpoint(playerid);
// Reset the missiontext
TextDrawSetString(PInfo[playerid][MissionText], Trucker_NoJobText);
// Kill the LoadingTimer
KillTimer(PInfo[playerid][LoadingTimer]);
// Check if the player has been overloaded
if (PInfo[playerid][Overloaded] == true)
{
// Clear the overloaded status of the player
PInfo[playerid][Overloaded] = false;
// Check if the player has a wanted level of 2 or higher
if (GetPlayerWantedLevel(playerid) >= 2)
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) - 2); // Reduce the wanted level by 2
else
SetPlayerWantedLevel(playerid, 0); // If the player has a wanted level of less than 2, reset the wanted level to 0
}
}
return 1;
}