public static async Task ShowShard(MessageType type, string title, string subtitle, int backgroundColor, int textColor, int duration) { var scale = new Scaleform("MP_BIG_MESSAGE_FREEMODE"); if (!HasNamedScaleformMovieLoaded("MP_BIG_MESSAGE_FREEMODE") || !scale.IsLoaded) { RequestScaleformMovie("MP_BIG_MESSAGE_FREEMODE"); } while (!HasNamedScaleformMovieLoaded("MP_BIG_MESSAGE_FREEMODE") || !scale.IsLoaded) { await Delay(0); } switch (type) { case MessageType.KNOCKED_OUT: var timer = GetGameTimer(); scale.CallFunction("SHOW_SHARD_WASTED_MP_MESSAGE", title, subtitle, 0, true, true); StartScreenEffect("MinigameEndNeutral", duration, false); //SumoSound.Play(SumoSound.sound.PLAYER_DIED); SumoSound.Play(SumoSound.sound.SHARD_RESULT); while (GetGameTimer() - timer < duration) { scale.Render2D(); await Delay(0); } StopAllScreenEffects(); break; default: break; } }
private async void PlayerDied(string playerName) { SumoSound.Play(SumoSound.sound.PLAYER_DIED); await Delay(3000); var allout = true; var playersAlive = NetworkGetNumConnectedPlayers(); foreach (Player p in new PlayerList()) { if (!(p.IsDead || !IsPedInAnyVehicle(GetPlayerPed(p.Handle), false) || !IsEntityVisible(GetPlayerPed(p.Handle)))) { allout = false; } else { playersAlive--; } } if (allout || playersAlive < 2) { currentPhase = GamePhase.RESET; } }