MSK Scripts
TebexGithubDiscordMusiker15
  • MSK Scripts
    • Welcome
  • Common Issues
    • Keymaster
  • Miscellaneous
    • Change Notifications
  • Scripts
    • MSK Core
      • Installation
      • Functions
        • Client
          • Ace Permission
          • Commands
          • Coords
          • Player
          • Points
          • Request
          • Scaleform
          • UI
            • Input
            • Numpad
            • Progressbar
            • TextUI
          • Vehicle
        • Shared
          • String
          • Math
          • Table
          • Timeout
          • Vector
        • Server
          • Ace Permission
          • Ban System
          • Commands
          • Player
          • Scaleform
          • UI
            • Input
            • Numpad
            • Progressbar
            • TextUI
    • MSK Banking
      • Installation
        • Paycheck Transaction
      • Config
      • Exports
        • Client
        • Server
      • Events
        • Client
        • Server
      • Server Callbacks
    • MSK EngineToggle
      • Guides
      • Exports
        • Client
      • Event Handler
        • Client
        • Server
    • MSK Fuel
      • Config
      • Exports
        • Client
    • MSK Garage
      • Config
      • Exports
        • Client
    • MSK Handcuffs
      • Guides
        • General Edits for Jobs
        • Jaksam Job Creator
        • Multichar
        • ox_inventory
      • Config
      • Admin Commands
      • Exports
        • Client
        • Server
      • Events
        • Client
        • Server
      • Event Handlers
    • MSK Radio
      • Config
      • Exports
        • Client
        • Server
      • Events
        • Server
    • MSK Simcard
      • Installation
        • Config.Database
      • Config
    • MSK VehicleKeys
      • Guides
        • Installation
        • Integrations
      • Config
      • Admin Commands
      • Exports
        • Client
        • Server
    • MSK Whitelist
      • Config
      • Exports
        • Client
        • Server
    • MSK Weaponammo
Powered by GitBook
On this page
  • Installation
  • ESX Ambulancejob
  1. Scripts
  2. Deathcounter

Installation

Last updated 11 months ago

CFX Forum Post:

Installation

This version is using NativeUI_Reloaded

SQL

Run this command at your database

ALTER TABLE `users` ADD COLUMN IF NOT EXISTS `deaths` TINYINT NULL DEFAULT 0;

myMultichar Edits

Go to client.lua and search for this:

if char.isDead == 1 then
    character_sub = NativeUI.CreateItem('~c~' .. char.firstname .. ' ' .. char.lastname, '~b~')
    mainMenu:AddItem(character_sub)
    character_sub:SetRightBadge(BadgeStyle.Lock)
else
    character_sub = _menuPool:AddSubMenu(mainMenu, char.firstname .. ' ' .. char.lastname, '~b~')
end

Then replace it with this:

if char.isDead == 1 then
    character_sub = NativeUI.CreateItem('~c~' .. char.firstname .. ' ' .. char.lastname, '~r~Max Deaths reached. Please contact support') -- Maximale Tode erreicht, bitte im Support melden
    mainMenu:AddItem(character_sub)
    character_sub:SetRightBadge(BadgeStyle.Lock)
else
    character_sub = _menuPool:AddSubMenu(mainMenu, char.firstname .. ' ' .. char.lastname, '~g~Your Character died ' .. char.deaths .. ' times') -- Dein Charakter ist bereits ' .. char.deaths .. ' mal gestorben
end

ESX Ambulancejob

If you set Config.countDeath = false then do the following:

Go to esx_ambulancejob/client/main.lua and search for

function RemoveItemsAfterRPDeath()

In this function search for

RespawnPed(PlayerPedId(), RespawnCoords, ClosestHospital.heading)

and replace it with

RespawnPed(PlayerPedId(), RespawnCoords, ClosestHospital.heading, true)

Below that you will find this function:

function RespawnPed(ped, coords, heading)

Replace it with this:

function RespawnPed(ped, coords, heading, isDied)
  SetEntityCoordsNoOffset(ped, coords.x, coords.y, coords.z, false, false, false)
  NetworkResurrectLocalPlayer(coords.x, coords.y, coords.z, heading, true, false)
  SetPlayerInvincible(ped, false)
  ClearPedBloodDamage(ped)

  TriggerServerEvent('esx:onPlayerSpawn')
  TriggerEvent('esx:onPlayerSpawn')
  TriggerEvent('playerSpawned') -- compatibility with old scripts, will be removed soon

  if isDied then
    TriggerServerEvent('msk_deathcounter:countDeaths')
  end
end

Now restart your server and have fun :)

https://forum.cfx.re/t/esx-msk-deathcounter-integrated-in-mymultichar/4863428