Raised This Month: $ Target: $400
 0% 

[Request] Read steam id's and compare them


Post New Thread Reply   
 
Thread Tools Display Modes
Furchee
Member
Join Date: Aug 2010
Old 10-07-2013 , 20:58   Re: [Request] Read steam id's and compare them
Reply With Quote #11

Quote:
Originally Posted by Powerlord View Post
FindStringInArray doesn't return a boolean, it returns the position number in the array or -1 if the string isn't in the array.
I -think- I understand.
Thanks !

Anyone willing to explain why the returned value of Arr_SteamIDs is } though ?
Furchee is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 10-07-2013 , 21:48   Re: [Request] Read steam id's and compare them
Reply With Quote #12

You'd have to post your code for us to check
__________________
View my Plugins | Donate
TnTSCS is offline
Furchee
Member
Join Date: Aug 2010
Old 10-08-2013 , 05:27   Re: [Request] Read steam id's and compare them
Reply With Quote #13

Using your previous post as an example, I have this currently running as a test plugin :
Spoiler


From what I've gathered (or at least I think) I believe steam id's are not being read from the given file (there or not), I do not receive an error if it's there or not either and running sm_test always returns "You cannot use this command" but I assume that's due to problem #1.

Last edited by Furchee; 10-08-2013 at 05:29.
Furchee is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 10-08-2013 , 09:09   Re: [Request] Read steam id's and compare them
Reply With Quote #14

Well.


If you really need to interface with steam ids and admins, you should probably just modify sourcemods sql admins, or just use that as it is, since thats-what-its-for
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.

Last edited by friagram; 10-08-2013 at 09:09.
friagram is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 10-08-2013 , 10:17   Re: [Request] Read steam id's and compare them
Reply With Quote #15

Yes, I still believe using the SM groups and group permissions is the best way to handle what you want, but here...

Using the below code, here's what I got:

With no test.txt (in cstrike root folder since we didn't add any other folder structure in the code), I received an error:
error


Once I put test.txt in my cstrike folder, it successfully loaded and I received log entries stating it.

test.txt


log


Attached is the slightly modified plugin.

------------------------------------

BTW, I still believe using the method Bacardi posted (here) is your best option.

Following that post, you would add your players to the admins.cfg to your special group (ex. "your group"). Then in the admin_groups.cfg, setup your command you want those players to be able to access and set it to "allow". Viola, done. If you want only your special group to be able to use that command, set all other groups access to that command to "deny".

An example with the attached plugin (taking out all of the stuff pertaining to adding steamid's and just keeping the commands), you could do this (which would grant access to those in the MyBuds group access to the sm_test command, but no one else (except players with "z" flag have access)).

admins.cfg


admin_groups.cfg
Attached Files
File Type: sp Get Plugin or Get Source (steam_id_test.sp - 231 views - 2.1 KB)
__________________
View my Plugins | Donate

Last edited by TnTSCS; 10-08-2013 at 10:36.
TnTSCS is offline
Furchee
Member
Join Date: Aug 2010
Old 10-08-2013 , 10:37   Re: [Request] Read steam id's and compare them
Reply With Quote #16

Quote:
Originally Posted by TnTSCS View Post
Yes, I still believe using the SM groups and group permissions is the best way to handle what you want, but here...

BTW, I still believe using the method Bacardi posted (here) is your best option.

Following that post, you would add your players to the admins.cfg to your special group (ex. "your group"). Then in the admin_groups.cfg, setup your command you want those players to be able to access and set it to "allow". Viola, done. If you want only your special group to be able to use that command, set all other groups access to that command to "deny".
I understand that the special group would be the easiest to do. In fact, that's exactly how my plugin worked prior to this.
However what I have in mind requires it to be -outside- of the admin section completely.
I believe that having a separate file to list steam id's that are allowed to use my commands is much better for me.
Thank you very much for the detailed response. I'll be letting you know fairly soon whether I get the same results on my side using / adding this into my own code.
Once again, thank you very much. I'm learning very quickly.
If I'm able, I'll be sure to give you a "thumbs up" or at least some sort of rep boost.

Edit:
Inputting my steam id into the text file with the plugin you've posted still returns "You cannot use this command" and not "I love myself!". Is it actually reading/comparing the ID's ?
I do however see a change in the fact that when the text file is missing now, it doesn't load the plugin. (That's a step forward!)

Last edited by Furchee; 10-08-2013 at 11:00.
Furchee is offline
Marcus101RR
Veteran Member
Join Date: Aug 2009
Location: Tampa, FL
Old 10-08-2013 , 13:24   Re: [Request] Read steam id's and compare them
Reply With Quote #17

There is no need for outside plugins to permit special commands, be advised that any additional plugins you use for you server would include custom commands as well. How do you suppose they are validated then? You would have code this all yourself.

As TnTSCS stated,

Using Admins.cfg is suffice for your problem. Ignore the fact that it says Admins on it, it can be used for VIPs, Donators, etc, just use special groups, give the group the list of commands they are allowed to use. Done.

Works as intended.
__________________
Marcus101RR is offline
Send a message via AIM to Marcus101RR Send a message via Skype™ to Marcus101RR
Furchee
Member
Join Date: Aug 2010
Old 10-08-2013 , 13:33   Re: [Request] Read steam id's and compare them
Reply With Quote #18

Quote:
Originally Posted by Marcus101RR View Post
There is no need for outside plugins to permit special commands, be advised that any additional plugins you use for you server would include custom commands as well. How do you suppose they are validated then? You would have code this all yourself.

As TnTSCS stated,

Using Admins.cfg is suffice for your problem. Ignore the fact that it says Admins on it, it can be used for VIPs, Donators, etc, just use special groups, give the group the list of commands they are allowed to use. Done.

Works as intended.
How many times have I stated that I'm completely familiar with this ?
It's not however what I want, so I'll politely ask you to quit throwing it in my face after I say "No."


EDIT:
Let the topic die, I had a friend help me and I managed to get it working with his code which seems to be much more clean and compact.
Thanks to TnTSCS for the great amount of help. <3

Last edited by Furchee; 10-08-2013 at 15:01.
Furchee is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 10-09-2013 , 07:41   Re: [Request] Read steam id's and compare them
Reply With Quote #19

The bottom line is you dont understand how sourcemod works, how admins work, or how command access works.

Heres a quick lesson.
Amins have flags, stores as bits, shifted in, if you are not an admin, youll have say 0

All these plugins that make you an admin, donator, whatever do is give yu flag bits, so you can use said command with said bit.

If you have no bits, and flatfile has a by your name, it ors in the bits for the a flag, then you can use commands for the a flag. This is how commands work.

http://docs.sourcemod.net/api/index....d=show&id=416&

So, just use the sourcemod admin system, thats what it is for. If for some reason you need something different because you are trying to do something shady (sell admin, expiracy, donation bots, whatever) it changes nothing, just use sql admins, and drop them from your table when time expires, but still give them said flags.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.

Last edited by friagram; 10-09-2013 at 07:44.
friagram is offline
Wazman
AlliedModders Donor
Join Date: Oct 2012
Location: Unknown place ????
Old 10-09-2013 , 14:49   Re: [Request] Read steam id's and compare them
Reply With Quote #20

You know, I really didn't even see a benefit of the whole idea of "steam id connected to the command's permission",
you can just make a custom admin group, override command access to that group, add that user to the group, and boom, you're done.

Last edited by Wazman; 10-09-2013 at 14:51.
Wazman is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:11.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode