SQL Plugin
Hello all,
I am new at AMX Mod X coding, and I would like to know how I would go about doing this; If say, a player came on, with a specific tag in front of their name (EG [Someone] Player), then a plugin would detect this and check in SQL if their SteamID can be found in a table. If it can find it, then it lets them in, and if not it kicks them. But if a player came on without the specified tag, nothing would happen, and all would continue. I have an OK knowledge of MySQL, but absolutely none with Small, and I would like to start learning. :) Thanks Again Saabir Salim (PS Sorry if this is in the wrong forum :)) |
Bump :)
Just asking for a nudge in the right direction, how to actually make it connect to SQL first of all. :D Thanks Saabir Salim |
dbi_connect
|
OK, thanks, this is what I got so far,
Code:
For some reason, It isn't compling, any ideas what went wrong? Also, am I going the right way? Thanks Saabir Salim |
dbi_query()
dbi_numrows() dbi_result() - dbi_field() dbi_close() dbi_error() Those are the functions for using a SQL server. |
Code:
|
Hmm, can you guys by any chance post a cleaned up version, i'd be most grateful :)
(Still learning Small lol, this is the 1st project that Ive worked on with Small :P) Thanks Saabir Salim |
Code:
I used a slightly different method of obtaining the data |
Use dbi_query(sql , "%s" , query) if you are going to do that...Someone didn't read BAILOPAN's post about proper use of formatting.
|
Thats how I was brought up to code SQL in AMXX, so how would you use your way?
|
| All times are GMT -4. The time now is 20:28. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.