Security HUD
System Watchdog
×
Threads Scanned
-- / --
SYS. LOAD --%
AI SHIELD ACTIVE
DMCA Policy
×

📋 DMCA Compliance

This platform and community fully complies with the Digital Millennium Copyright Act (DMCA) and international copyright laws. We take all copyright protection seriously.

🛡️ Copyright Protection

If you believe a posted item belongs to you or violates your copyright, you may file a DMCA takedown request through our official channels. Upon receiving a valid claim, the infringing content will be removed within 24 hours.

What's new
×
Fiveguard

Request CAN ANYONE CONVERT THIS TO ESX?

ufukk123

RegisterNUICallback("GiveItem", function(data, cb)

local player, distance = GetClosestPlayer()

if player ~= -1 and distance < 2.5 then

local playerPed = GetPlayerPed(player)

local playerId = GetPlayerServerId(player)

local plyCoords = GetEntityCoords(playerPed)

local pos = GetEntityCoords(GetPlayerPed(-1))

local dist = GetDistanceBetweenCoords(pos.x, pos.y, pos.z, plyCoords.x, plyCoords.y, plyCoords.z, true)

if dist < 2.5 and givelock == true then

SetCurrentPedWeapon(PlayerPedId(),'WEAPON_UNARMED',true)

TriggerServerEvent("inventory:server:GiveItem", playerId, data.inventory, data.item, data.amount)

print(data.amount)

elseif givelock== false then

QBCore.Functions.Notify("İtemi Veremezsin!", "error")

else

QBCore.Functions.Notify("Yakında Kimse Yok!", "error")

end

else

QBCore.Functions.Notify("No one nearby!", "error")

end

end)
 

Xerarch#1801

Bronze Elite
Joined
May 7, 2021
Messages
6
Reaction score
2
Points
146
Seriously, there's 4 things to change... How are you even planning on being a server owner / developer if you don't know how to change such a simple thing.

PHP:
// Change this to what ever notification system you are using or to original ESX notification system
QBCore.Functions.Notify("No one nearby!", "error")
    
//  https://esx-framework.github.io/es_extended/client/functions/shownotification/

// Change this too the ESX function instead
local player, distance = GetClosestPlayer()

// https://esx-framework.github.io/es_extended/client/functions/game/getclosestplayer/

You could've literally just googled the function for ESX and you get a full document explaining all of it.
 

Skyllake

Silver Elite
Joined
Mar 20, 2021
Messages
26
Reaction score
5
Points
156
True, if you would just take a look at any kinds of Documentation or Wiki that come's with ESX, QBase, and almost every released framework.
 
Top