[FilterScript] Donation System.
#1

Hello, I made a quick and simple donator system which will automatically delete a donator from the table after their donator period has expired.
Please note, this does not set them to "donator" ingame, nor does this set any kind of perks.
This simply adds them too the table and it will automatically delete them when their donator expires according to the time set.
Don't know if anyone has any use for it, I made it for someone but I have no other use for it.
THIS IS AN INCLUDE WITH A FILTERSCRIPT
SQL Code
Code:
CREATE TABLE IF NOT EXISTS `"#PKDonator_TABLE"` ("\
			  "`DonatorID` int(6) NOT NULL AUTO_INCREMENT,"\
			  "`user_donator` varchar(24) NOT NULL,"\
			  "`user_donator_ip` varchar(15) NOT NULL,"\
			  "`user_who_gave` varchar(24) NOT NULL,"\
			  "`donation_reason` varchar(40) NOT NULL,"\
			  "`donation_timestamp` timestamp NOT NULL,"\
			  "`donate_time` int(10) NOT NULL,"\
			  "PRIMARY KEY (`DonatorID`)"\
Also comes with an example filterscript of the commands.
Please note; THIS IS AN INC, you put it into your pawno folder under includes..

As far as I'm aware, they're no bugs with this nor have any been given to me for fixing.
After you've used this, you will need too create code in your own script to call the table of lets say..
John_Smith, create a new query in your gm to submit an SQL query, EXAMPLE:
Code:
 

format(query, sizeof(query), "SELECT * FROM PKDonator_TABLE WHERE user_donator = %s", GetPlayerName(playerid));
IF they are in the table, obviously It'll return, if not it means their donator has expired..
Also if they are in the table, you'll need to assign what ever donator perks you give for donations as this does not do it.
Reply
#2

Good one.

I have one question in your SQL query.
HTML Code:
user_donator = %s", GetPlayerName(playerid)
why did you put user_donator (Name of the player) instead of Donator ID since it's Primary Key?
Reply
#3

Quote:
Originally Posted by Fratello
View Post
Good one.

I have one question in your SQL query.
HTML Code:
user_donator = %s", GetPlayerName(playerid)
why did you put user_donator (Name of the player) instead of Donator ID since it's Primary Key?
I made the ID the primary key so it can be inner joined at a later date if they so wish,
but as this function is called on player connect it needs to check if the player is donator still, if not then it'll delete them from the table.
But I guess it could be changed to ID it's pretty malleable code and can be changed to fit someones needs , I made it for a friend so there's a couple of things in there which would obviously need to be changed to the correct params required for those using
Reply
#4

Quote:
Originally Posted by Prokill911
View Post
I made the ID the primary key so it can be inner joined at a later date if they so wish,
but as this function is called on player connect it needs to check if the player is donator still, if not then it'll delete them from the table.
But I guess it could be changed to ID it's pretty malleable code and can be changed to fit someones needs , I made it for a friend so there's a couple of things in there which would obviously need to be changed to the correct params required for those using
Makes sense now. Thanks.
Reply
#5

Quote:
Originally Posted by Fratello
View Post
Makes sense now. Thanks.
Okay
Reply
#6

Quote:
Originally Posted by William02
View Post
I need a Donation System script, using include SII
https://sampforum.blast.hk/showthread.php?tid=609026
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)