Ulysses

Ulysses Stuff => General Chat & Help and Support => Topic started by: Sc00by22 on May 11, 2008, 11:24:05 AM

Title: Addons for Group X
Post by: Sc00by22 on May 11, 2008, 11:24:05 AM
Ok, I have this fairy addon, and I want to make it donators/admins only, I know there is adminspawnable thing in the lua code which i have set, but now i need to let donators use it,

   if (Settings.SpawnWithPlayer and gmod.GetGamemode().Name == "Sandbox") and (Ply:IsAdmin() or Ply:IsDonator() or Settings.SpawnWithPlayerAdminOnly) then

I tried this but It doesn't work, I'm not very good :S

I'm using UTeam
Title: Re: Addons for Group X
Post by: JamminR on May 11, 2008, 04:10:42 PM
As you've probably already discovered, and gotten errors on, there is no such thing as "Ply:IsDonator()"
We've written ULib to use Garry's IsUserGroup. So all you'd have to add to whatever admin check it does now is add
Code: [Select]
... or Ply:IsUserGroup( "donator" ) ...
The three periods ... aren't going to actually be there...they just show where you would insert that code into the other checks.
Groupnames are case sensitive. ULX addgroup is written so that it turns all groupnames stored in groups.txt to lowercase.
If you've manually edited them, you'll need to use whatever case you added in.
Title: Re: Addons for Group X
Post by: Sc00by22 on May 12, 2008, 07:54:40 AM
Thanks so much! Now I can start adding more addons and insert this :D

Hmm, It didn't work, I checked the cases and everything, Here is my line of code

   if (Settings.SpawnWithPlayer and gmod.GetGamemode().Name == "Sandbox") and (Ply:IsAdmin() or Ply:IsUserGroup( "donator" ) or Settings.SpawnWithPlayerAdminOnly) then
Title: Re: Addons for Group X
Post by: MrPresident on May 12, 2008, 12:43:32 PM
You are really botching up that line of code... What are you trying to achieve?

I THINK this is what you want.. Try this...

if (Settings.SpawnWithPlayer and gmod.GetGamemode().Name == "Sandbox") and (Ply:IsAdmin() or Ply:IsUserGroup( "donator" )) and Settings.SpawnWithPlayerAdminOnly then
Title: Re: Addons for Group X
Post by: Sc00by22 on May 12, 2008, 01:13:47 PM
I'm trying to make it so my Admins and my Donators get the thing that i want :) It's normally admins only but i wanted them to have this addon
Title: Re: Addons for Group X
Post by: Sc00by22 on May 12, 2008, 01:52:46 PM
Ok, They can see it in there list, But they still can't spawn it :(