Skip to content

Commit

Permalink
Have a separate ClearPlayerDialogs function
Browse files Browse the repository at this point in the history
  • Loading branch information
RussellLVP committed Oct 10, 2016
1 parent ed569f7 commit 8692f5b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions pawn/Interface/JavaScriptBridge.pwn
Expand Up @@ -27,6 +27,7 @@ public OnSerializePlayerState(playerid, serialize, restoreOnSpawn) {
RemovePlayerFromBombShop(playerid);

ClearPlayerMenus(playerid);
ClearPlayerDialogs(playerid);

TogglePlayerSpectating(playerid, 0);

Expand Down
6 changes: 4 additions & 2 deletions pawn/Interface/functions.pwn
Expand Up @@ -773,15 +773,17 @@ GameTextForAllEx(const message[], time, style, playerWorldId = -1) {
return 1;
}

ClearPlayerDialogs(playerId) {
ShowPlayerDialog(playerId, -1, DIALOG_STYLE_MSGBOX, "Las Venturas Playground", "You shouldn't see this.", "Close", "");
}

ClearPlayerMenus(playerId) {
if (!Player(playerId)->isConnected())
return 0;

if (IsPlayerInBombShop[playerId])
RemovePlayerFromBombShop(playerId);

ShowPlayerDialog(playerId, -1, DIALOG_STYLE_MSGBOX, "Las Venturas Playground", "You shouldn't see this.", "Close", "");

for (new i; i < MAX_MENUS; i++) {
if (!IsValidMenu(Menu: i))
continue;
Expand Down
4 changes: 1 addition & 3 deletions pawn/Resources/Minigames/Core/DeathmatchHandler.pwn
Expand Up @@ -54,9 +54,7 @@ public DeathmatchStartFunc() {

// Enough sign-ups, do some magic for every contestant.
else if (MinigameTypeInfo[Players] > 1) {
if (LegacyIsPlayerInBombShop(contestant))
RemovePlayerFromBombShop(contestant);

ClearPlayerDialogs(contestant);
ClearPlayerMenus(contestant);
RemovePlayerFromVehicle(contestant);

Expand Down

0 comments on commit 8692f5b

Please sign in to comment.