-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.lua
More file actions
26 lines (21 loc) · 925 Bytes
/
server.lua
File metadata and controls
26 lines (21 loc) · 925 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
local VorpCore = {}
local VorpInv = {}
TriggerEvent("getCore", function(core)
VorpCore = core
end)
VorpInv = exports.vorp_inventory:vorp_inventoryApi()
RegisterServerEvent("giveWeaponFromMenu")
AddEventHandler("giveWeaponFromMenu", function(weaponHash)
local _source = source
local weaponName = weaponHash:gsub("WEAPON_", ""):gsub("_", " "):gsub("^%l", string.upper)
local Character = VorpCore.getUser(_source).getUsedCharacter
VorpCore.NotifyRightTip(_source, weaponName .." silah envanterinize eklendi.", 5000)
VorpInv.createWeapon(_source, weaponHash, {}, {})
end)
RegisterServerEvent("giveAmmoFromMenu")
AddEventHandler("giveAmmoFromMenu", function(ammoKey, ammoName)
local _source = source
local Character = VorpCore.getUser(_source).getUsedCharacter
VorpInv.addBullets(_source, ammoKey, 100)
VorpCore.NotifyRightTip(_source, ammoName .. " envanterinize eklendi.", 5000)
end)