• Make a whole addon admin only?
    7 replies, posted
How would I go about making an addon admin only? Do I have to make each individual prop/entity/weapon admin only?
Just put this inside your function if you want to restrict it to admins only. [code]if ply:IsAdmin() then --code end[/code]
[QUOTE=Netheous;47464900]Just put this inside your function if you want to restrict it to admins only. [code]if ply:IsAdmin() then --code end[/code][/QUOTE] He means the whole addon can only be used by admins, Assuming he is including things such as spawning them and using them.
[QUOTE=0V3RR1D3;47464910]He means the whole addon can only be used by admins, Assuming he is including things such as spawning them and using them.[/QUOTE] Putting this in SpawnFunction() will do just what I said.
[QUOTE=Netheous;47464947]Putting this in SpawnFunction() will do just what I said.[/QUOTE] So would I have to do that for every entity or do I put it in a certain lua file?
[QUOTE=AeroTrace;47464965]So would I have to do that for every entity or do I put it in a certain lua file?[/QUOTE] Actually use just what the guy said if it's meant not to even spawn for non-admin players. If you want to just disable certain functionality then use my code, otherwise: [code] ENT.AdminSpawnable = true SWEP.AdminSpawnable = true [/code]
[QUOTE=Netheous;47464979]Actually use just what the guy said if it's meant not to even spawn for non-admin players. If you want to just disable certain functionality then use my code, otherwise: [code] ENT.AdminSpawnable = true SWEP.AdminSpawnable = true [/code][/QUOTE] But do I have to do this for every entity in the addon or is there another way to do it?
[QUOTE=AeroTrace;47464997]But do I have to do this for every entity in the addon or is there another way to do it?[/QUOTE] Yes, Put it in the shared file of ever entity you wan to make admin on :P
Sorry, you need to Log In to post a reply to this thread.