как сделать выдачу оружия через команду.
Кто сможет дать код:? пж
Мне не ответили, нашел решения.
Решения скачать 1 аддон из воркшопа:
Вот еще код, кому нужно пользуйтесь.
-- Подключение ULX
include("ulx/ulx_init.lua")
-- Определение новой команды giveweapon
if SERVER then
function ulx.giveweapon(calling_ply, target_ply, weapon_class)
local weapon = target_ply:Give(weapon_class)
if not IsValid(weapon) then
ULib.tsayError(calling_ply, "Invalid weapon class!")
return
end
target_ply:SelectWeapon(weapon:GetClass())
ulx.fancyLogAdmin(calling_ply, "#A Выдал #T a #s", target_ply, weapon:GetClass())
end
local giveweapon = ulx.command("Fun", "ulx giveweapon", ulx.giveweapon, "!giveweapon")
giveweapon:addParam{ type=ULib.cmds.PlayerArg }
giveweapon:addParam{ type=ULib.cmds.StringArg, hint="weapon class" }
giveweapon:defaultAccess(ULib.ACCESS_ADMIN)
giveweapon:help("Gives a weapon to the target player.")
end
вставлять
/addons/ulx/lua/ulx/modules/sh/giveweapon.lua