im new to code so dont hate help instead! code might betotally off YOU HAVE BEEN WARNED!!!
so im trying to create a simple script that automaticly assigns F9 Bound to “say /calladmin” for All players on the server as default(when they join)
function GM:PlayerBindPress( ply, bind, pressed )
if ( string.find( bind, "load quick" ) ) then return true
if (true then (ply concommand.Run ("bind F9 "say /calladmin"") end
end
please reply with a more accurate solution if you know one!
I wouldn’t force them to directly BIND the key, but to automaticly make them say ‘CallAdmin’ instead, its way better than fucking up their bindings.
local antispam = false -- Dont edit c:
local time = 60 -- Set your anti spam time here
hook.Add("Think", "Call_Admin_Thingy", function()
if input.IsKeyDown(KP_F9) and antispam == false then
antispam = true -- Enables antispam, doesn't make them like say it 5000 times a second lol
LocalPlayer():ConCommand("say /calladmin") -- makes them say the command
timer.Simple(time, function() -- This part resets the antispam, making it re-useable after _N_ seconds.
antispam = false
end)
end
end)
nice im making it be that way because of my f4 menu i got added support tabs and one is calladmin,
but the F9 bind connected to the tab button won’t execute the command and instead directs to the Q bind
Hello. I am working with the above poster in making a DarkRP server using your script. We are unsure where to place the lua file in the server directory. We are also unsure what would be an appropriate name for it, is ‘calladmindlc.lua’ okay? Thanks in advance.
[editline]5th April 2016[/editline]
Hello. I am working with the above poster in making a DarkRP server using your script. We are unsure where to place the lua file in the server directory. We are also unsure what would be an appropriate name for it, is ‘calladmindlc.lua’ okay? Thanks in advance.