forward ExitMission(); // Unloads the current filterscript.
public ExitMission()
{
CallRemoteFunction("UnloadMission", "s", "mission84");
}
forward UnloadMission(params[]);
public UnloadMission(params[])
{
foreach(new i : Player)
{
HideSpawnLogo(i);
SetTimerEx("SendPlayerToWelcomeScreen", 1, false, "d", i);
}
new string[30];
format(string, sizeof string, "unloadfs %s", params);
SendRconCommand(string);
SendRconCommand("loadfs lobby");
MissionLoaded = false;
for(new i = 0; i < 6; i++)
{
SendDeathMessage(202, 202, 202);
}
return 1;
}
[02:23:43] Filterscript 'mission84.amx' unloaded.
[02:23:43]
[02:23:43] --------------------------
[02:23:43] Lobby by Infamous [2015]
[02:23:43] --------------------------
[02:23:43]
[02:23:43] Filterscript 'lobby.amx' loaded.
[02:23:43] [debug] Server crashed due to an unknown error
[02:23:44] [debug] Native backtrace:
[02:23:44] [debug] #0 00480452 in ?? () from samp-server.exe
[02:23:44] [debug] #1 0048ceca in ?? () from samp-server.exe
[02:46:46] Filterscript 'mission84.amx' unloaded.
[02:46:46]
[02:46:46] --------------------------
[02:46:46] Lobby by Infamous [2015]
[02:46:46] --------------------------
[02:46:46]
[02:46:46] Filterscript 'lobby.amx' loaded.
[02:46:46] [debug] Run time error 7: "Stack underflow"
[02:46:46] [debug] Stack pointer (STK) is 0x4D8BC, stack top (STP) is 0x7670
[02:46:46] [debug] AMX backtrace:
[02:46:46] [debug] #0 00000000 in public Itter_OnPlayerDisconnect ()
[02:46:46] [debug] Server crashed due to an unknown error
[02:46:46] [debug] Native backtrace:
[02:46:46] [debug] #0 00480452 in ?? () from samp-server.exe
[02:46:46] [debug] #1 0048ceca in ?? () from samp-server.exe
forward UnloadMission(params[]); public UnloadMission(params[]) { foreach(new i : Player) { HideSpawnLogo(i); SetTimerEx("SendPlayerToWelcomeScreen", 1, false, "d", i); } new string[30]; format(string, sizeof string, "unloadfs %s", params); SendRconCommand(string); SendRconCommand("loadfs lobby"); MissionLoaded = false; print("1"); for(new i = 0; i < 6; i++) { printf("Loop %i", i+1); SendDeathMessage(202, 202, 202); } print("2"); return 1; }
[03:27:23] Filterscript 'lobby.amx' loaded.
[03:27:23] 1
[03:27:23] Loop 1
[03:27:23] Loop 2
[03:27:23] Loop 3
[03:27:23] Loop 4
[03:27:23] Loop 5
[03:27:23] Loop 6
[03:27:23] 2
[03:27:23] [debug] Run time error 7: "Stack underflow"
[03:27:23] [debug] Stack pointer (STK) is 0x4D8BC, stack top (STP) is 0x7670
[03:27:23] [debug] AMX backtrace:
[03:27:23] [debug] #0 00000000 in public Itter_OnPlayerDisconnect ()
[03:27:23] [debug] Run time error 7: "Stack underflow"
[03:27:23] [debug] Stack pointer (STK) is 0x4D8C4, stack top (STP) is 0x7670
[03:27:23] [debug] AMX backtrace:
[03:27:23] [debug] #0 00000000 in public OnPlayerUpdate ()
[03:27:23] [debug] Run time error 7: "Stack underflow"
[03:27:23] [debug] Stack pointer (STK) is 0x4D8C0, stack top (STP) is 0x7670
[03:27:23] [debug] AMX backtrace:
[03:27:23] [debug] #0 00000000 in public OnPlayerSpawn ()
[03:27:23] [debug] Run time error 7: "Stack underflow"
[03:27:23] [debug] Stack pointer (STK) is 0x4D8BC, stack top (STP) is 0x7670
[03:27:23] [debug] AMX backtrace:
[03:27:23] [debug] #0 00000000 in public OnPlayerUpdate ()
[03:27:23] [debug] Run time error 7: "Stack underflow"
[03:27:23] [debug] Stack pointer (STK) is 0x4D8B8, stack top (STP) is 0x7670
forward MissionFinished();
public MissionFinished()
{
GameOver = true;
foreach(new i : Player)
{
ResetPlayerVars(i);
RemovePlayerMapIcon(i, 0);
RemovePlayerMapIcon(i, 1);
RemovePlayerMapIcon(i, 2);
RemovePlayerMapIcon(i, 3);
RemovePlayerMapIcon(i, 4);
KillTimer(BombPlantTimer[i]);
KillTimer(PanelHackTimer[i]);
TogglePlayerAllDynamicCPs(i, 0);
SetPlayerArmour(i, 0);
SetPlayerHealth(i, FLOAT_INFINITY);
SetPlayerSpecialAction(i, SPECIAL_ACTION_NONE);
DestroyDynamicPickup(Jetpack_Pickup);
Jetpack_Pickup = INVALID_PICKUP_ID;
TogglePlayerControllable(i, 0);
PlayerTextDrawDestroy(i, Objective[i]);
PlayerTextDrawDestroy(i, SpectateTDx[i]);
}
KillTimer(RoundTimerVar);
KillTimer(BombExplodeTimer);
TextDrawDestroy(RoundTimeTD);
TextDrawDestroy(SpawnLogo[0]);
TextDrawDestroy(SpawnLogo[1]);
TextDrawDestroy(SpawnLogo[2]);
TextDrawDestroy(SpectateTD[0]);
TextDrawDestroy(SpectateTD[1]);
TextDrawDestroy(SpectateTD[2]);
TextDrawDestroy(SpectateTD[3]);
TextDrawDestroy(SpectateTD[4]);
TextDrawDestroy(SpectateTD[5]);
TextDrawDestroy(SpectateTD[6]);
TextDrawDestroy(TeamMenuTD[0]);
TextDrawDestroy(TeamMenuTD[1]);
TextDrawDestroy(TeamMenuTD[2]);
TextDrawDestroy(TeamMenuTD[3]);
TextDrawDestroy(TeamMenuTD[4]);
TextDrawDestroy(TeamMenuTD[5]);
TextDrawDestroy(TeamMenuTD[6]);
for(new v; v < MAX_VEHICLES; v++)
{
DestroyVehicle(v);
}
Streamer_DestroyAllItems(STREAMER_TYPE_OBJECT, 0);
SetTimer("ExitMission", 6000, 0);
forward SendPlayerToWelcomeScreen(playerid);
public SendPlayerToWelcomeScreen(playerid)
{
SetPVarInt(playerid, "viewing_welcome_screen", 1);
SetPlayerVirtualWorld(playerid, 1);
SpawnPlayer(playerid);
return 1;
}
public OnPlayerSpawn(playerid)
{
if(GetPVarInt(playerid, "viewing_welcome_screen") == 1)
{
////////////////////////////////////////////////////////////////////
TogglePlayerSpectating(playerid, true);
ShowWelcomeScreen(playerid);
////////////////////////////////////////////////////////////////////
if(GetPVarInt(playerid, "playing_audio") == 0)
{
PlayAudioStreamForPlayer(playerid, "http://************/mowc5nw");
SetPVarInt(playerid, "playing_audio", 1);
}
////////////////////////////////////////////////////////////////////
if(GetPVarInt(playerid, "logged_in") == 0)
{
format(SQL_Query, sizeof(SQL_Query), "SELECT * FROM `player_accounts` WHERE Account_Name = '%s'", EscapeText(PlayerName(playerid)));
mysql_function_query(SQL_Connection, SQL_Query, true, "CheckRegistered", "i", playerid);
}
////////////////////////////////////////////////////////////////////
}
return 1;
}
public OnPlayerUpdate(playerid)
{
if(GetPVarInt(playerid, "viewing_welcome_screen") == 1)
{
if(GetPVarInt(playerid, "viewing_team_menu") == 0)
{
SendPlayerToTeamSelection(playerid);
}
}
return 1;
}
//if (funcidx(YSI_gsOnPlayerDisconnect) != -1)
//{
// YSI_g_sCallbacks |= 1;
//}
//if (funcidx(YSI_gsOnPlayerConnect) != -1)
//{
// YSI_g_sCallbacks |= 2;
//}
After UnloadMission is called the main gamemode sends the player to the welcome screen;
PHP код:
PHP код:
PHP код:
EDIT: @Kar I'm using a slightly modified version of foreach 0.4.1: http://pastebin.com/FDy6SC64 |