Ulysses
Ulysses Stuff => General Chat & Help and Support => Topic started by: MrPresident on December 13, 2007, 08:07:12 PM
-
Is there a Ulib way to check to see if a certain player has a specific access in their allow table?
I've noticed how if you use something like.. ulx userallow <player> "blahblah1" it will add blahblah1 to their list of allows. I thought this would be a GREAT way to use flags in ULX. With a little bit of modification to a tool or Server Entity file, you could have it check for these flags before allowing them to use/spawn the entity/tool.
Right now, Im using IsUserGroup("blah") to do this, but it only will work for groups I set in there.. where this would be soo much better and could even be done dynamically.. while in game and to users as opposed to groups..
something like this...
**ply is assumed to be the player and already defined by the function you are modifying... This example would be to my Fairy ENT.**
If !ulib.hasaccess(ply,"fairy") then
ulib.tsay(ply,"Sorry, this entity is reserverd for donators and administrators only.", true)
return
end
then you could just add "fairy" to all the groups in your groups.txt file to the allows to give them access... This would also let you use the
ulx userallow
and
ulx userdeny
commands to give and revoke these flags in game and without editing any files at all.
I think there has to already be a function like this, because you have tools and commands that can be given to players in game that is saved to the users.txt file and some function has to check if they ahve these accesses.
right?
*crosses fingers*
-
Yes, allows and denies are essentially flags and your idea would be a perfectly legitimate use for them.
-
lol.. i was asking you what the ulib command for checking if a user had a flag was.. =) If there was one already.
-
ply:query( "flag" )
-
ply:query( "flag" )
sweet.. I actually just found it in the ULib files..
ulib.ucl.query(ply, access, hide)
but you say ply:query( "flag" ) will work?
Thanks a lot for your help Meg.. Im starting to do everything I've always wanted to be able to do with ULX.. it's a LOT more powerful than I had imagined previously.
::Edit::
Awesome.. it works just like I want.. even though it requires a little bit of editing inside the tools and entities config files.. this is a MUCH better method than ulx toolallow and ulx tooldeny.. because it will save accross sessions.. Thanks so much!
-
Thanks a lot for your help Meg.. Im starting to do everything I've always wanted to be able to do with ULX.. it's a LOT more powerful than I had imagined previously.
Spread the word! We've been mostly disappointed that other authors haven't caught on yet. It's a sweet deal offered with no strings attached (except you can't charge for it). ;)
Yes, ply:query() will work too because I stuck it in the player meta table a while back. You won't see me write any code with that version because I like to maintain consistency across the code, but there's no reason why you can't.
-
You see, I have extra "tools and ents" that are easliy abusable but mainly for fun installed.. well I do now. These are things that I provide to people who donate, but we also have a point system as you probably know because of our timespent script that you didn't like =) SO now, with this flag system I have a way to provide these non essential but fun tools and SENTs to people in exchange for their points they've won in competitions.
I've been wishing you guys would add this for a long time.. never actually knowing that it was already included.. even though, up until recently I wouldn't have known how to do it anyways.
This also gives me a way to deny a donating member a tool if they abuse it.. where as before since all it did was assign them by groups with IsUserGroup, I couldn't do that without changing their group.