Ulysses
General => Developers Corner => Topic started by: Samg381 on March 21, 2013, 12:30:55 PM
-
Hey,
I need a code that will restrict some entities: WAC Aircraft, SCars
and some SWeps: CSS Realistic, Murderthon 9K
To the ULX Rank 'Donator'. I'm making an auto-donation system and this is important.
Thank you!
-
You could add this code to the entities and sweps to restrict them to donators.
if not ply:IsUserGroup("donator") then
return
end
You might also want to put some kind of message before the return informing the player that only donators are allowed to spawn those things.
-
Thanks. I just set 'Donator' to inherit from Admin, and than disallowed all admin commands from donator in the groups.cfg.
-
Samg, that's really not a good idea.
Though perhaps they won't be able to run ULX admin commands, Gmod will see them as an admin, which means any gamemode/mod/whatever that uses IsAdmin to check a player for any special access, they will have it.
-
Well, I know that, but at the moment it's my only option.
I need Donators to have access to admin only sweps and vehicles.
-
Solution?
-
Yes, Edit the spawn code with the snip I gave you earlier. Find where it says IsAdmin and add the above code in as well.
Also, take a look at the SWEP hooks. I assume you are running a gamemode that is based on Sandbox.
http://gmodwiki.net/Lua/Hooks/Sandbox
-
Please elaborate! I need help with the specifics.
-
[ERROR] addons/wac community 1/lua/entities/wac_hc_ah1z_viper_u/shared.lua:64: attempt to index global 'ply' (a nil value)
1. unknown - addons/wac community 1/lua/entities/wac_hc_ah1z_viper_u/shared.lua:64
2. include - [C]:-1
3. unknown - addons/wac community 1/lua/entities/wac_hc_ah1z_viper_u/cl_init.lua:1