Author
|
|
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:
|
|
| |
Plugin Description:
|
This plugin is aimed at server admins that want to make giveaways.
|
|
|
08-19-2022
, 00:24
[ANY] Giveaways (Sep 5, 2022)
|
#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 creator, int winner, int 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 creator, int 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 13:03.
|
|
|
|