private void onPlayerChat(string text, Events.CancelEventArgs cancel) { if (!isPlayerAuthorized || isPlayerInBrowser) { return; } }
private void OnPlayerEnterCheckpoint(Checkpoint checkpoint, Events.CancelEventArgs cancel) { if (checkpoint == garbageCheckpoint && Player.LocalPlayer.Vehicle != null) { // Get the next checkpoint Events.CallRemote("garbageCheckpointEntered"); } }
private void OnPlayerEnterCheckpoint(Checkpoint checkpoint, Events.CancelEventArgs cancel) { if (checkpoint == fastFoodCheckpoint) { // Deliver the order Events.CallRemote("fastfoodCheckpointReached"); } }
private void OnPlayerStartEnterVehicle(Vehicle vehicle, int seatId, Events.CancelEventArgs cancel) { if (handcuffed && seatId == -1) { // Prevent the player from driving the vehicle cancel.Cancel = true; } }
private void OnPlayerStartEnterVehicle(Vehicle vehicle, int seatId, Events.CancelEventArgs cancel) { if (handcuffed && seatId == Constants.VEHICLE_SEAT_DRIVER) { // Prevent the player from driving the vehicle cancel.Cancel = true; } }
private void OnPlayerEnterCheckpoint(Checkpoint checkpoint, Events.CancelEventArgs cancel) { if (checkpoint == factionWarningCheckpoint) { // Destroy the checkpoint DeleteFactionWarningEvent(null); // Remove the faction warning Events.CallRemote("removeWarning"); } }
private void OnPlayerWeaponShotEvent(Vector3 targetPos, Player target, Events.CancelEventArgs cancel) { // Calculate the weapon the player is holding uint weaponHash = RAGE.Game.Weapon.GetSelectedPedWeapon(Player.LocalPlayer.Handle); // Get the bullets remaining int bullets = Player.LocalPlayer.GetAmmoInWeapon(weaponHash); // Update the weapon's bullet amount Events.CallRemote("updateWeaponBullets", bullets); }
private void OnPlayerCommandEvent(string cmd, Events.CancelEventArgs cancel) { if (!Globals.playerLogged) { // Send the message to the player Events.CallRemote("playerNotLoggedCommand"); // Cancel the command cancel.Cancel = true; } }
private void OnPlayerEnterCheckpoint(Checkpoint checkpoint, Events.CancelEventArgs cancel) { if (checkpoint == vehicleLocationCheckpoint) { // Destroy the checkpoint on the map vehicleLocationCheckpoint.Destroy(); vehicleLocationCheckpoint = null; // Destroy the blip on the map vehicleLocationBlip.Destroy(); vehicleLocationBlip = null; } }
private void OnPlayerEnterCheckpoint(Checkpoint checkpoint, Events.CancelEventArgs cancel) { if (checkpoint == carShopTestCheckpoint && Player.LocalPlayer.Vehicle != null) { // Destroy the checkpoint carShopTestCheckpoint.Destroy(); carShopTestCheckpoint = null; // Delete the blip carShopTestBlip.Destroy(); carShopTestBlip = null; // Deliver the test vehicle Events.CallRemote("deliverTestVehicle"); } }
/// <summary> /// Starts the wasted screen if enabled, which subscribes to the <see cref="Events.Tick"/> /// </summary> /// <param name="player"></param> /// <param name="reason"></param> /// <param name="killer"></param> /// <param name="cancel"></param> private void PlayerDied(RAGE.Elements.Player player, uint reason, RAGE.Elements.Player killer, Events.CancelEventArgs cancel) { if (_wastedEnabled) { if (_wastedScaleformMsg != null) { this.timeStarted = RAGE.Game.Misc.GetGameTimer(); PlayerHelper.WastedStart(_wastedTimeScale); Events.Tick -= OnTick; Events.Tick += OnTick; } } else { Events.CallRemote("WastedScreenFinished"); } }
/// <summary> /// Registers the <see cref="Events.Tick"/> to show money on the screen. /// </summary> /// <param name="cancel"></param> protected virtual void PlayerSpawned(Events.CancelEventArgs cancel) { Chat.Output("Player spawned"); SetTickRender(); }
/// <summary> /// Unregisters the <see cref="Events.Tick"/> to show money /// </summary> /// <param name="player"></param> /// <param name="reason"></param> /// <param name="killer"></param> /// <param name="cancel"></param> protected virtual void PlayerDeath(RAGE.Elements.Player player, uint reason, RAGE.Elements.Player killer, Events.CancelEventArgs cancel) { Events.Tick -= Render; }
private void OnPlayerChat(string text, Events.CancelEventArgs cancel) { Events.CallRemote("srv_TestEvent", text); }