[QB] Stop Violence Against PEDS

A script by krane_rcc

No reviews yet.
[QB] Stop Violence Against PEDS main image

Full Description

https://i.imgur.com/xT9wmrW.png

Don’t get away with murder

This script will punish the user if he kills the PEDS from the street

for _, ped in pairs(QBCore.Functions.GetPeds({PlayerPedId()})) do
            if not table_has_element(last_peds_killed, ped) then
                if IsPedDeadOrDying(ped, 1) == 1 then
                    ...
                    for _, ACTIVE_PLAYER in pairs(GetActivePlayers()) do
                        if GetPlayerPed(ACTIVE_PLAYER) == ped then 
                            should_punish = false
                        end
                    end

                    if should_punish then
                         ...
                        QBCore.Functions.Notify('You have been punished for killing a person.', 'error', 7500)
                        TriggerServerEvent("krane-punish-ped-killin")
                        TriggerEvent("krane-punish-ped-killin")
                  end
              end
        end

As you can see in the detection algorithm, it will bypass all the PLAYERS from your server from this check, so they can murder each other because they have equal chances at roleplay, but peds have no way to revolt against you, so this script will punish you

Catch event

RegisterNetEvent("krane-punish-ped-killin")

to handle punishing from other scripts :smiley:

Download the script for free: https://krane.tebex.io/package/5206423
Direct link: GitHub - kranercc/qb-stop-violence: This is a free fivem resource

Updates

Update 1

Added integration for [QB] Skills ([QB] Skills - Modern Affordable)