30.03.2019, 20:13
error 017: undefined symbol "mission"
[pawn]
public EndMission(missionid, reason[], booluccess)
{
if (missionid == INVALID_MISSION)
{
return;
}
KillTimer(missiontimer[missionid]);
FreeCamera(mission);
// Reset missions
Mission[missionid][started] = false;
for (new j = 0; j < MAX_MISSION_PLAYERS; j++)
{
if (!IsPlayerConnected(Mission[missionid][players][j]))
{
continue;
}
TextDrawHideForPlayer(Mission[missionid][players][j], TextdrawBox);
TextDrawHideForPlayer(Mission[missionid][players][j], TextdrawBox2);
TextDrawHideForPlayer(Mission[missionid][players][j], TextdrawBoxText);
TextDrawHideForPlayer(Mission[missionid][players][j], TextdrawText);
TextDrawHideForPlayer(Mission[missionid][players][j], TextdrawFollow);
TogglePlayerSpectating(Mission[missionid][players][j], 0);
TogglePlayerControllable(Mission[missionid][players][j], 1);
SetPlayerVirtualWorld(Mission[missionid][players][j], 0);
if (!success)
{
new reas[164];
format(reas, sizeof(reas), "~r~Mission failed !~n~~w~%s", reason);
GameTextForPlayer(Mission[missionid][players][j], reas, 5000, 0);
}
else
{
GameTextForPlayer(Mission[missionid][players][j], reason, 5000, 0);
}
PlayerMission[Mission[missionid][players][j]] = INVALID_MISSION;
PlayerCreatedMission[Mission[missionid][players][j]] = INVALID_MISSION;
Mission[missionid][players][j] = INVALID_PLAYER_ID;
Mission[missionid][player_dead][j] = false;
}
for (new j = 0; j < MAX_MISSION_NPCS; j++)
{
FCNPC_Destroy(Mission[missionid][npcs][j]);
Mission[missionid][npcs][j] = INVALID_PLAYER_ID;
Mission[missionid][npc_target][j] = INVALID_PLAYER_ID;
}
for (new j = 0; j < MAX_MISSION_VEHICLES; j++)
{
DestroyVehicle(Mission[missionid][vehicles][j]);
}
Mission[missionid][level] = 0;
Mission[missionid][cutscene] = false;
Mission[missionid][cutscene_process] = false;
Mission[missionid][cutscene_stage] = 0;
// Decrease missions count
MissionsStarted--;
}[/[pawn]
[pawn]
public EndMission(missionid, reason[], booluccess)
{
if (missionid == INVALID_MISSION)
{
return;
}
KillTimer(missiontimer[missionid]);
FreeCamera(mission);
// Reset missions
Mission[missionid][started] = false;
for (new j = 0; j < MAX_MISSION_PLAYERS; j++)
{
if (!IsPlayerConnected(Mission[missionid][players][j]))
{
continue;
}
TextDrawHideForPlayer(Mission[missionid][players][j], TextdrawBox);
TextDrawHideForPlayer(Mission[missionid][players][j], TextdrawBox2);
TextDrawHideForPlayer(Mission[missionid][players][j], TextdrawBoxText);
TextDrawHideForPlayer(Mission[missionid][players][j], TextdrawText);
TextDrawHideForPlayer(Mission[missionid][players][j], TextdrawFollow);
TogglePlayerSpectating(Mission[missionid][players][j], 0);
TogglePlayerControllable(Mission[missionid][players][j], 1);
SetPlayerVirtualWorld(Mission[missionid][players][j], 0);
if (!success)
{
new reas[164];
format(reas, sizeof(reas), "~r~Mission failed !~n~~w~%s", reason);
GameTextForPlayer(Mission[missionid][players][j], reas, 5000, 0);
}
else
{
GameTextForPlayer(Mission[missionid][players][j], reason, 5000, 0);
}
PlayerMission[Mission[missionid][players][j]] = INVALID_MISSION;
PlayerCreatedMission[Mission[missionid][players][j]] = INVALID_MISSION;
Mission[missionid][players][j] = INVALID_PLAYER_ID;
Mission[missionid][player_dead][j] = false;
}
for (new j = 0; j < MAX_MISSION_NPCS; j++)
{
FCNPC_Destroy(Mission[missionid][npcs][j]);
Mission[missionid][npcs][j] = INVALID_PLAYER_ID;
Mission[missionid][npc_target][j] = INVALID_PLAYER_ID;
}
for (new j = 0; j < MAX_MISSION_VEHICLES; j++)
{
DestroyVehicle(Mission[missionid][vehicles][j]);
}
Mission[missionid][level] = 0;
Mission[missionid][cutscene] = false;
Mission[missionid][cutscene_process] = false;
Mission[missionid][cutscene_stage] = 0;
// Decrease missions count
MissionsStarted--;
}[/[pawn]