Можешь показать хук restrict_physgun
?
Это скорее всего из-за него.
Найди его в файлах через CTRL+F
(либо напиши это в консоль чтобы узнать в каком файле он находится):
lua_run print(debug.getinfo(hook.GetTable()['PhysgunPickup']['restrict_physgun']).short_src)
local allowed = {
["superadmin"] = true,
["iventer"] = true,
["Sled"] = true,
["Support"] = true,
["qmenu"] = true,
["sudoroot"] = true, -- и т.д.
}
hook.Add("PhysgunPickup", "restrict_physgun", function(ply, ent)
if((ply:Team() != TEAM_ADMINS || !allowed[ply:GetUserGroup()]) && ent:GetOwner() != ply)then return end
return true
end)
Это код из того файла
Да, это из-за него.
Замени этот фрагмент:
local allowed = {
["superadmin"] = true,
["iventer"] = true,
["Sled"] = true,
["Support"] = true,
["qmenu"] = true,
["sudoroot"] = true, -- и т.д.
}
hook.Add("PhysgunPickup", "restrict_physgun", function(ply, ent)
if !ent:IsPlayer( ) then return end
if ply:Team( ) != TEAM_ADMINS and !allowed[ply:GetUserGroup()] then
return false
end
end)
Если я правильно понял, то этот код тут для того, чтобы админы не могли трогать физганом игроков в РП профе ( кроме некоторых привилегий ). Выше я реализовал его правильно
Если я не прав - то скажи зачем, и я пофикшу)
я теперь вообще не могу поднимать игроков
Удали тогда вообще этот код, и перезапусти сервер
всё равно не могу поднимать игроков
Напиши в консоль по очереди эти команды:
lua_run print(player.GetAll()[1]:GetInfo("cl_pickupplayers"))
lua_run FAdmin.Access.PlayerHasPrivilege(player.GetAll()[1], "PickUpPlayers", player.GetAll()[1])
У тебя в настройках (Q>Утилиты>Private Settings>I want to pick up players) отключена возможность поднимать игроков
Напиши себе в игровую консоль: cl_pickupplayers 1
( или измени в Q меню )
изменения применяются не моментально, там 5-10 секунд подождать надо
это все админы теперь должны прописывать?
Нет, я думаю это ты случайно себе выключил. По дефолту оно включено
другие админы просто тоже жаловались что не могут поднимать игроков
Не знаю, по дефолту у всех должно стоять 1, если ничего не трогать.
Хорошо, спасибо большое. А можно как-то сделать что бы на правую кнопку фризило кого я поднимаю?
Да можно. Что бы установить, создай файл sh_ulxphysfreze, вставь код, и положи этот файл в папку gamemode\lua\autorun.
`if CLIENT then return end; if not SERVER then return end
hook.Remove( “PhysgunDrop”, “ulxPlayerDrop”) – We don’t need this hook since we have a better hook here.
local function isPlayer(ent) return (IsValid(ent) && ent.GetClass && ent:GetClass() == “player”) end
local function playerPickup( ply, ent )
local access, tag = ULib.ucl.query( ply, “ulx physgunplayer” )
if isPlayer(ent) and access then
local restrictions = {}
ULib.cmds.PlayerArg.processRestrictions( restrictions, ply, {}, tag and ULib.splitArgs( tag )[ 1 ] )
if restrictions.restrictedTargets == false or (restrictions.restrictedTargets and not table.HasValue( restrictions.restrictedTargets, ent )) then
return false
end
return true
end
end
timer.Simple(0.01, function()
hook.Add(“PhysgunPickup”, “_ply_physgungrab”, function(ply, targ)
if IsValid(ply) and isPlayer(targ) then
if ply:query(“ulx physgunplayer”) and playerPickup( ply, targ ) then
local allowed = ULib.getUser( “@”, true, ply )
if isPlayer(allowed) then
if allowed.frozen && ply:query( “ulx unfreeze” ) then
allowed.phrozen = true;
allowed.frozen = false;
end
allowed._ulx_physgun = {p=targ:GetPos(), b=true, a=ply}
end
end
end
end, tonumber(HOOK_HIGH)-2); MsgAll('LOADED! 1')
end)
hook.Add(“PlayerSpawn”, “_ply_physgungrab”, function(ply)
timer.Simple(0.001, function()
if IsValid(ply) and ply._ulx_physgun then
local admin = ply._ulx_physgun.a
if ply._ulx_physgun.b and ply._ulx_physgun.p and IsValid(admin) then
ply:SetPos(ply._ulx_physgun.p);
ply:SetMoveType(MOVETYPE_NONE);
timer.Simple(0.001, function()
if not (IsValid(admin) and admin:KeyDown(IN_ATTACK)) then
ply:SetMoveType( MOVETYPE_WALK )
ply._ulx_physgun = nil
ply:Spawn()
end
end)
end
end
end)
end)
local function physgun_freeze( calling_ply, target_ply, should_unfreeze )
local v = target_ply
if v:InVehicle() then
v:ExitVehicle()
end
if not should_unfreeze then
v:Lock()
v.frozen = true
v.phrozen = true
ulx.setExclusive( v, "frozen" )
else
v:UnLock()
v.frozen = nil
v.phrozen = nil
ulx.clearExclusive( v )
end
v:DisallowSpawning( not should_unfreeze )
ulx.setNoDie( v, not should_unfreeze )
if v.whipped then
v.whipcount = v.whipamt -- Will make it remove
end
end
timer.Simple(0.01, function()
hook.Add(“OnPhysgunFreeze”, “_ulx_physgunfreeze”, function(pl, ent)
if isPlayer(ent) then
ent:SetMoveType( MOVETYPE_WALK )
ent._ulx_physgun = nil
end
end)
hook.Add(“PhysgunDrop”, “_ulx_physgunfreeze”, function(pl, ent)
if isPlayer(ent) then
ent:SetMoveType( MOVETYPE_WALK )
ent._ulx_physgun = nil
end
if IsValid(pl) and isPlayer(ent) then
if pl:query("ulx freeze") then
local isFrozen = ( ent:IsFrozen() or ent.frozen or ent.phrozen );
ent:SetMoveType(pl:KeyDown(IN_ATTACK2) and MOVETYPE_NONE or MOVETYPE_WALK);
timer.Simple(0.001, function()
if pl:KeyDown(IN_ATTACK2) and not isFrozen then
if pl:query( "ulx freeze" ) then
ent:SetVelocity(ent:GetVelocity()*-1);
ulx.freeze( pl, {ent}, false );
if ent.frozen then ent.phrozen = true end;
end
elseif pl:query( "ulx unfreeze" ) and isFrozen then
if pl:KeyDown(IN_ATTACK2) and pl:query( "ulx freeze" ) then
physgun_freeze(pl, ent, true)
timer.Simple(0.001, function() physgun_freeze(pl, ent, false) end);
else
ulx.freeze( pl, {ent}, true );
if not ent.frozen then ent.phrozen = nil end;
end
end
end);
else
ent:SetMoveType( MOVETYPE_WALK )
end
end
end); MsgAll('LOADED! 2')
end)`
Fadmin у меня
Замени хук на 15 строке в файле gamemodes/darkrp/gamemode/modules/fadmin/fadmin/pickupplayers/sv_init.lua на это:
hook.Add("PhysgunDrop", "FAdmin_PickUpPlayers", function(ply, ent)
if IsValid(ent) and ent:IsPlayer() and not ply:KeyDown(IN_ATTACK2) then
ent:SetMoveType(MOVETYPE_WALK)
ent:Freeze(false)
end
end)