SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts

Reply
 
Thread Tools Display Modes
Old 13/10/2017, 06:37 PM   #1
Prokill911
Huge Clucker
 
Join Date: Jan 2015
Posts: 229
Reputation: 17
Lightbulb Donation System.

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.
Attached Files
File Type: rar DonateSys.rar (4.3 KB, 106 views)
Prokill911 is offline   Reply With Quote
Old 13/10/2017, 07:04 PM   #2
Fratello
Huge Clucker
 
Fratello's Avatar
 
Join Date: May 2016
Location: Howard University
Posts: 316
Reputation: 38
Default Re: Donation System.

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?
__________________
"It's not what you expect from life; But what life expect from you!"
Fratello is offline   Reply With Quote
Old 13/10/2017, 07:22 PM   #3
Prokill911
Huge Clucker
 
Join Date: Jan 2015
Posts: 229
Reputation: 17
Default Re: Donation System.

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
Prokill911 is offline   Reply With Quote
Old 14/10/2017, 10:31 AM   #4
Fratello
Huge Clucker
 
Fratello's Avatar
 
Join Date: May 2016
Location: Howard University
Posts: 316
Reputation: 38
Default Re: Donation System.

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.
__________________
"It's not what you expect from life; But what life expect from you!"
Fratello is offline   Reply With Quote
Old 19/10/2017, 04:49 PM   #5
Prokill911
Huge Clucker
 
Join Date: Jan 2015
Posts: 229
Reputation: 17
Default Re: Donation System.

Quote:
Originally Posted by Fratello View Post
Makes sense now. Thanks.
Okay
Prokill911 is offline   Reply With Quote
Old 09/02/2018, 07:12 PM   #6
William02
Little Clucker
 
Join Date: Jan 2018
Posts: 9
Reputation: 0
Default Re: Donation System.

I need a Donation System script, using include SII
William02 is offline   Reply With Quote
Old 11/02/2018, 10:20 AM   #7
Astralis
High-roller
 
Join Date: Sep 2009
Location: France
Posts: 3,210
Reputation: 448
Default Re: Donation System.

Quote:
Originally Posted by William02 View Post
I need a Donation System script, using include SII
http://forum.sa-mp.com/showthread.php?t=609026
__________________
http://samp4you.com
Hosted Tab 25/mo || 50 Slots 3/mo
PaySafeCard/Skrill/PayPal/Bank Accepted!
English Support & Anti-DDoS Protected

Astralis is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Donation System Gazzy Server Support 8 02/01/2016 06:12 AM
Question with donation system. k2168 Scripting Help 0 16/12/2015 01:58 PM
vip donation absolute Scripting Help 5 06/05/2013 03:20 PM
[Need] Donation Point System lewisno7 Help Archive 7 10/05/2010 07:46 PM
IDEA: Donation System Arsham7 Help Archive 4 11/03/2010 02:54 PM


All times are GMT. The time now is 02:04 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.