Hi, i am trying to do multiple things on my server and it dosen't work.
1 - Blocking Spawn menu for all players instead of Admins
It's either the players can and admins can't or both can or both cannot.
If i want to make it run, i need to reload the file. It dosen't run automaticly.
Here's the code:
function GAMEMODE:SpawnMenuOpen()
if ply:IsUserGroup("moderateur", "administrateur", "superadmin", "developpeur") then return true
else
return false
end
2 - Restricting physgun to certain rank and admin
"moderateur" dosen't have the physgun.
local GiveToGroups = {
['moderateur'] = true,
['donateur'] = true,
['superadmin'] = true,
['administrateur'] = true,
}
local WeaponsToGive = {
"weapon_physgun",
}
hook.Add( "PlayerSpawn", "GiveMeMyWeaponsThx", function (ply)
if GiveToGroups[ply:GetUserGroup()] then
for k,v in pairs(WeaponsToGive) do
ply:Give(v)
end
end
end)
3 - Context menu, works if i reload the file
function GAMEMODE:ContextMenuOpen()
return false
end
4 - I wan't to make people lose money on death, but without dropping it, if they are at 0, they go in negatives.
hook.Add("PlayerDeath","DropMoney", function(ply)
ply:addMoney(-700)
DarkRP.notify(ply, 2, 5, "Vous avez perdu 700 dû à votre mort.")
end)
5 - People can move world props. I don't have FPP since i disabled FAdmin. I add a code but it dosen't run automatic, i have to retransfer the file so it work. (basicly reload)
function AntiDoors( ply, ent )if ent:isDoor() then return false end end
hook.Add( "PhysgunPickup", "AntiDoors", AntiDoors )
6 - With VCMod, people can move VC Gas Pumps. I don't have FPP
Note: All the files are in lua/autorun OR cl_init of gamemode
Sorry, you need to Log In to post a reply to this thread.