[Need help] Check if connecting client's steamid is in database
Okey, lets jump right in to it.
Im kinda new to coding overall. (made some minecraft bukkit plugins(java) and also some kind of 2d java game about 6-8 moths ago.) And i started trying with sourcepawn about 1 month ago and after searching the forum, api and wiki, and whatching some youtube tuts I desided to ask for help. I think it is pretty simple, when client connect it checks if his steamid is in the database and if it is he gets the 2 admin flags, if not it checks if he got the 2 flags and if he do it removes them. (It's for Counter-Strike: Source) Here is what i currently got: PHP Code:
Code:
"VipPlugin" |
Re: [Need help] Check if connecting client's steamid is in database
Threaded querys is much better. Anyway try this one
PHP Code:
|
Re: [Need help] Check if connecting client's steamid is in database
Thx ecca!
Just some small problems, if the connecting client have other admin flags and is in the database the client only have those 2 flags untill he is not in the db anymore or untill a sm_reloadadmins. |
Re: [Need help] Check if connecting client's steamid is in database
This will just add some temporary flags i think, so try this one out instead.
PHP Code:
|
[Need help] Check if connecting client's steamid is in database
What's wrong with SourceMod's built-in admin system?
|
Re: [Need help] Check if connecting client's steamid is in database
Like ecca said, threaded queries are the best you can do, although i have some suggestions.
It's important that you don't pass clientindexes to asynchronous callbacks like this one. Either use getclientserial/getclientfromserial; getclientuserid/getclientofuserid or fetch the steamid in the callback and find the client with the steamid. If you only want to check if an row with this steamid exists i guess something like this is faster.
Spoiler
Yours sincerey Impact |
Re: [Need help] Check if connecting client's steamid is in database
Quote:
And i want my admins to be able to buy vip too, and with sourcebans they only have vip on the server they are admin on. Edit: Quote:
However the second code that ecca posted worked perfect and this is now solved if im not terrible wrong. |
Re: [Need help] Check if connecting client's steamid is in database
Hi,
I need help in creating a plugin. I am not a dev so anything that you ask me to do from a dev perspective will go over my head ! I am in particular looking at a plugin that will check if a connecting player STEAMID is in a DB and if not it disconnects him with a message. If the player's STEAMID is in DB it will further check if his subscription validity date is not expired (when I add the player on DB it will have date column with the "subscription valid till" date).So if the current date is beyond this expiry date it will again disconnect the player and show the message that his access is expired. I did come across this post, https://forums.alliedmods.net/showthread.php?t=280933 I guess the coding is in bits and pieces. Your plugin listed here is on same line. Would it be possible to guide me in getting this done correctly ? I tried doing some scripting with the available scripts (this post and the post I have linked to) & my very very limited knowledge of Sourcepawn ; I have and reached here PHP Code:
PHP Code:
I assume I have to create a mysql db and add the user details, manually for this plugin to connect to check & do its stuff. |
Re: [Need help] Check if connecting client's steamid is in database
is this like a pay to play on the server type plugin? just curious
|
Re: [Need help] Check if connecting client's steamid is in database
Quote:
|
All times are GMT -4. The time now is 16:49. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.