SQL Get column as cvar.
So I tryed for like one day and one night without figuring this how it works:
Code:
public MySql_Init() Code:
set_task(1.0, "MySql_Init")Code:
public_licenses |
Re: SQL Get column as cvar.
A licence system for AMXX is useless beucase it can be removed easily. Remember that you always have to provide the source code along the binaries you share.
|
Re: SQL Get column as cvar.
Quote:
Edit: I was thinking and I want to explain what exactly I want to do. The above script will check if the plugin is authorised by me so if it is (unlicensed = 0) then it will do other querry to put the server stats on my website (player kills, etc). So what is above for me is like a passcode to check if the plugin is authorised to post data on my website. So after checking if the server IP is the same as the IPs on the column then if there is, it will set unlicensed to 0 otherwise to 1 then if unlicensed is 0 then it will post data from server on my website and if unlicensed is 0 it will be a return plugin handled. |
Re: SQL Get column as cvar.
Can you show me how your table is designed? Your query can be made better.
SELECT '%s' FROM `licenses` WHERE 1 I would do something like SELECT * FROM tblLicenses WHERE ServerIP='%s' No results means unlicensed. Or if you have a column that holds a license status (0/1) for if you withdraw a license without deleting the record from the table you can then check that. Where does a cvar come into play? |
Re: SQL Get column as cvar.
Quote:
postimg . org/image/xr7zxuqbt/6d5156f3/ I set a variable "unlicensed = 1" at the beginning so the plugin will check if that variable is 1 and if it is 1 then it will say that the server is not authorised to use this plugin bla bla. However the script above should check at the beginning if the server IP is inside the table and if it is then it should set unlicensed to 0. |
Re: SQL Get column as cvar.
Edited code to use get_user_ip( 0 ..
The plugin will create the table automatically on its first load. The table has 2 columns: IPAddress and Licensed. If the query for the IP finds nothing OR if it finds the IPAddress and Licensed=0 then it is considered unlicensed. PHP Code:
|
Re: SQL Get column as cvar.
Quote:
Code:
#include <amxmodx> |
Re: SQL Get column as cvar.
I edited the above code to use get_user_ip( 0 ) and it's working fine for me. Just let the plugin create the table and use it. I don't know what you mean by 'all the columns would be server IP's'. You should have 1 column with rows of IP's.
|
Re: SQL Get column as cvar.
Quote:
Code:
#include <amxmodx> |
Re: SQL Get column as cvar.
What I gave you works why do you keep changing it
|
| All times are GMT -4. The time now is 18:07. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.