Raised This Month: $12 Target: $400
 3% 

[CS:GO] Giveaways manager (v1.0, 2017-08-07)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
ShawnCZek
Member
Join Date: Mar 2017
Location: Czech Republic
Plugin ID:
5749
Plugin Version:
1.0
Plugin Category:
Fun Stuff
Plugin Game:
Counter-Strike: GO
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Manage all giveaways for skins and add entries. There is only 1 possible running giveaway at the same moment.
    Old 08-07-2017 , 10:25   [CS:GO] Giveaways manager (v1.0, 2017-08-07)
    Reply With Quote #1

    Description
    Manage all giveaways for skins and add entries. There is only 1 possible running giveaway at the same moment. Entries are based on Steam Auth ID.

    Feature list/plans
    At the moment nothing.

    Admin commands
    • sm_giveaway_create - creates tables for giveaways and entries.
    • sm_giveaway_add <deadline> <type> <skin> <description> - creates a new giveaway. Type can be 0, 1 or 2. 0 = everyone, 1 = for Steam group members, 2 = for players with reserved slots (usually VIPs).
      Quote:
      Example:
      sm_giveaway_add 2017-08-13 0 "Galil AR | Cerberus (FT)" "Float value: 0.25357672. It's very nice skin, I hope you will like it!"
    • sm_giveaway_draw - draws a winner of ended giveaways.
    • sm_giveaway_winner <giveawayID> - gets the winner of a giveaway + info about the giveaway.
    Commands
    • sm_giveaway - writes information about running giveaway.
    • sm_giveaway_enter - enters in the running giveaway.

    Variables
    Spoiler


    Changelog
    Quote:
    2017-08-07 (v1.0)

    * Initial release.
    Dependencies
    • You must have SourceMod connected with database.
    • You need extension SteamWorks.
    • If you want to compile, you need Colors.

    Installation instructions
    1. Download the extension SteamWorks and upload it on the server.
    2. Restart the server.
    3. Download the plugin and upload it on the server.
    4. Create tables for giveaways and entries (sm_giveaway_create).
    Attached Files
    File Type: smx Giveaway.smx (18.1 KB, 372 views)
    File Type: sp Get Plugin or Get Source (Giveaway.sp - 482 views - 13.8 KB)
    ShawnCZek is offline
    leeter
    Member
    Join Date: Jun 2015
    Old 08-08-2017 , 05:25   Re: [CS:GO] Giveaways manager (v1.0, 2017-08-07)
    Reply With Quote #2

    Im getting this Error:

    Quote:
    L 08/08/2017 - 11:24:01: [SM] Exception reported: Invalid database Handle 0 (error: 4)
    L 08/08/2017 - 11:24:01: [SM] Blaming: Giveaway.smx
    L 08/08/2017 - 11:24:01: [SM] Call stack trace:
    L 08/08/2017 - 11:24:01: [SM] [0] SQL_FastQuery
    L 08/08/2017 - 11:24:01: [SM] [1] Line 101, C:\Users\Shawn\Dropbox\Server\addons\sourcemo d\scripting\Giveaway.sp::CMD_GiveawayCreate

    Last edited by leeter; 08-08-2017 at 05:47.
    leeter is offline
    nguyenbaodanh
    AlliedModders Donor
    Join Date: Jun 2007
    Location: HCMC, Vietnam
    Old 08-08-2017 , 22:33   Re: [CS:GO] Giveaways manager (v1.0, 2017-08-07)
    Reply With Quote #3

    Can you make a website with this one? Would be great !!!
    __________________
    nguyenbaodanh is offline
    ShawnCZek
    Member
    Join Date: Mar 2017
    Location: Czech Republic
    Old 08-09-2017 , 08:42   Re: [CS:GO] Giveaways manager (v1.0, 2017-08-07)
    Reply With Quote #4

    Quote:
    Originally Posted by leeter View Post
    Im getting this Error:
    Do you have setted the database? I am not sure if you are connected. Check /csgo/addons/sourcemod/configs/databases.cfg, if you have login data there.

    Quote:
    Originally Posted by nguyenbaodanh View Post
    Can you make a website with this one? Would be great !!!
    I don't know what you mean. Can you describe it more, please?
    ShawnCZek is offline
    michaelrw
    Senior Member
    Join Date: Jul 2017
    Old 03-22-2018 , 00:35   Re: [CS:GO] Giveaways manager (v1.0, 2017-08-07)
    Reply With Quote #5

    i dont understand how to config the database for this.. whats the title of the databases.cfg entry for this plugin? I looked through the code and dont see anything.. im not familiar with the SQL_DefConnect
    Are you trying to use sqlite storage-local ?

    Error when I load plugin via console:
    [GIVEAWAY] Could not connect: [2003]: Can't connect to MySQL server on 'localhost' (10061)

    Error it SM logs:
    Exception reported: Invalid database Handle 0 (error: 4)
    Blaming: giveaway.smx
    Call stack trace:
    [0] SQL_Query
    [1] Line 374, C:\Users\Shawn\Dropbox\Server\addons\sourcemo d\scripting\Giveaway.sp::GetGiveawayInfo
    [2] Line 92, C:\Users\Shawn\Dropbox\Server\addons\sourcemo d\scripting\Giveaway.sp::OnMapStart
    __________________

    michaelrw is offline
    michaelrw
    Senior Member
    Join Date: Jul 2017
    Old 03-22-2018 , 01:58   Re: [CS:GO] Giveaways manager (v1.0, 2017-08-07)
    Reply With Quote #6

    i edited the database connection code, simplified all of the AutoExecConfig functions into a single line, and other small stuff. I tracked down the include file needed for compile (see attached files)

    - create a database where you want the tables for this plugin to be stored (or use an existing one)
    - make an entry in databases.cfg for "giveaway" and fill out the info, like so:
    Code:
    	"giveaway"
    	{
    		"driver"			"mysql"
    		"host"				"myhost.com"
    		"database" 			"database_giveaway"
    		"user"				"username"
    		"pass"				"password"
    		"port"				"3306"
    	}
    if you manually load the plugin via console, you should see a message print to console saying "[GIVEAWAY] Connection successful"

    Youll also probably see an error about missing table(s)
    To 'fix' this, run the command sm_giveaway_create which willmake the two tables you need in your database

    should be good to go
    Attached Files
    File Type: sp Get Plugin or Get Source (giveaway.sp - 357 views - 14.3 KB)
    File Type: inc hexstocks.inc (14.5 KB, 335 views)
    File Type: smx giveaway.smx (17.0 KB, 325 views)
    __________________


    Last edited by michaelrw; 03-22-2018 at 02:00.
    michaelrw is offline
    ShawnCZek
    Member
    Join Date: Mar 2017
    Location: Czech Republic
    Old 03-22-2018 , 13:27   Re: [CS:GO] Giveaways manager (v1.0, 2017-08-07)
    Reply With Quote #7

    Hello,
    thank you very much for your help! Honestly I have made some changes, but I will also use this and upload a new version. But firstly I will change the thing with Steam group, it does not work.
    Once more thank you and I hope this plugin has helped you.
    ShawnCZek is offline
    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

    Forum Jump


    All times are GMT -4. The time now is 18:49.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode