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

[ANY] Giveaways (Sep 5, 2022)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
ratawar
BANNED
Join Date: Dec 2017
Location: GB
Plugin ID:
8158
Plugin Version:
1.2
Plugin Category:
All
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    4 
    Plugin Description:
    This plugin is aimed at server admins that want to make giveaways.
    Old 08-18-2022 , 23:24   [ANY] Giveaways (Sep 5, 2022)
    Reply With Quote #1

    ABOUT

    This plugin is aimed at server admins that want to make giveaways.
    When a giveaway is created, the countdown time and the prize (if specified) will be detailed.
    When a giveaway ends, the winner will be displayed.
    Both announcements will be made in a center text and in chat to all players.


    CVARS

    sm_giveaways_version - Plugin version
    sm_giveaways_sounds - Whether the plugin should play sounds upon starting, entering, leaving, canceling and ending a giveaway (Default: 1)
    sm_giveaways_time - Countdown in seconds before plugin stops the giveaway and announces the winner (Default: 60)
    sm_giveaways_winner_cooldown - Amount of giveaways that must pass before the winner of a giveaway has the chance to win again (Default: 1 giveaways)
    sm_giveaways_countdown - Enable or disable a 5 second countdown message with sound effects (Default: 1)
    sm_giveaways_winner_sendmenu - Send an in-game menu (panel) to the winner with customizable details (in translations file) (Default: 1)


    COMMANDS

    Admin Commands

    sm_gstart [item] - Start a giveaway, first argument is optional (to specify the prize)
    sm_gstop - To manually stop the giveaway to announce the winner
    sm_gcancel - To cancel the giveaway and announce no winners whatsoever
    sm_gparticipants - To see the participants of the current giveaway


    User commands

    sm_enter - Enter the giveaway
    sm_leave - Leave the giveaway

    FORWARDS

    PHP Code:
    /*
    * Called when a giveaway is about to start
    *
    * @param client            The creator of the giveaway
    * @param prize             The specified prize
    * @return                 Plugin_Continue to allow the giveaway to start, Plugin_Handled otherwise
    */
    forward Action Giveaways_OnGiveawayStart(int client, const char[] prize);


    /*
    * Called when a giveaway has ended
    *
    * @param creator        The creator of the giveaway
    * @param winner         The winner of the giveaway
    * @param prize             The specified prize
    * @noreturn                 
    */
    forward void Giveaways_OnGiveawayEnded(int creatorint winnerint participants, const char[] prize);


    /*
    * Called when a user enters the giveaway
    *
    * @param client            The participant
    * @return                 Plugin_Continue to allow the user to participate, Plugin_Handled otherwise
    */
    forward Action Giveaways_OnClientEnter(int client);

    /*
    * Called when a user leaves the giveaway
    *
    * @param client            The participant
    * @return                 Plugin_Continue to allow the user to leave, Plugin_Handled otherwise
    */
    forward Action Giveaways_OnClientLeave(int client);

    /*
    * Called when a giveaway gets canceled
    *
    * @param creator        The creator of the giveaway
    * @param cancelator        The user that wants to cancel the giveaway
    * @return                 Plugin_Continue to allow the giveaway to get canceled, Plugin_Handled otherwise
    */
    forward Action Giveaways_OnGiveawayCancel(int creatorint cancelator); 
    Plugin and source code here

    NOTES
    • Messages, colors and plugin tag can be customized via the translations file.
    • The repo comes with predetermined sounds for every ceremony of the giveaway, you can use your own, just make sure to respect the naming and encoding, and make them downloadable to your users properly.
    • To compile you will need AutoExecConfig by Impact and MoreColors by Bara.

    Last edited by ratawar; 09-06-2022 at 12:03.
    ratawar is offline
    Send a message via ICQ to ratawar Send a message via AIM to ratawar Send a message via Yahoo to ratawar Send a message via Skype™ to ratawar
    Ic3dM4n
    Junior Member
    Join Date: Aug 2012
    Old 11-01-2022 , 17:30   Re: [ANY] Giveaways (Sep 5, 2022)
    Reply With Quote #2

    prnt.sc/DTBTgOyN_Cpm

    Incredible, my players love it.

    It works very well in csgo, but the colors don't think so :C

    Last edited by Ic3dM4n; 11-01-2022 at 17:31.
    Ic3dM4n is offline
    ratawar
    BANNED
    Join Date: Dec 2017
    Location: GB
    Old 11-01-2022 , 22:19   Re: [ANY] Giveaways (Sep 5, 2022)
    Reply With Quote #3

    Quote:
    Originally Posted by Ic3dM4n View Post
    prnt.sc/DTBTgOyN_Cpm

    Incredible, my players love it.

    It works very well in csgo, but the colors don't think so :C
    Oh shit I have no idea why that happens
    ratawar is offline
    Send a message via ICQ to ratawar Send a message via AIM to ratawar Send a message via Yahoo to ratawar Send a message via Skype™ to ratawar
    Reply



    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 01:37.


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