AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [CS:GO] Custom Votes [Panorama] (v2.0 | 9 August 2021) (https://forums.alliedmods.net/showthread.php?t=333839)

KoNLiG 08-09-2021 08:22

[CS:GO] Custom Votes [Panorama] (v2.0 | 9 August 2021)
 
Custom Votes

Description:
This plugin exposes the functionality of the internal CS:GO vote panels.


https://i.imgur.com/wADmoQG.jpeg

Features:

Quote:

• Customizable vote question text. (HTML supported)
• Customizable pass text. (HTML supported)
• Customizable panel icons.
• Custom votes can be canceled at any time and moment.
• Full control over player voting.
• Ability of blocking & modifying votes.
• Broadcast custom votes to any group of player you want.
Installation:

Quote:

1. Place 'customvotes.smx' in '/csgo/addons/sourcemod/plugins/'.
2. Load the plugin via the command line 'sm plugins load customvotes', map change or server restart.
3. Done!
ConVars:
Code:

// Sound file path that will be played once a client has voted no.
// -
// Default: "sound/ui/menu_invalid.wav"
custom_votes_negative_vote_sound "sound/ui/menu_invalid.wav"

// Sound file path that will be played once a client has voted yes.
// -
// Default: "sound/ui/menu_accept.wav"
custom_votes_positive_vote_sound "sound/ui/menu_accept.wav"

API:
Spoiler


Change Log:
Quote:

9 August, 2021 [1.0]
• Initial release.
Quote:

20 August, 2021 [2.0]
• API Expansion, added define to broadcast vote forever and small patches.
Quote:

21 August, 2021 [2.2]
• Additional patches related to the last release.
Corrections, suggestions and improvements are welcome!

To compile you have to use 1.10+ SourceMod compiler.

GitHub Repository
Latest Release

KoNLiG 08-09-2021 08:24

Re: [CS:GO] Custom Votes [Panorama] (v1.0 | 9 August 2021)
 
Code for the main thread example image:
PHP Code:

public void OnPluginStart()
{
    
RegConsoleCmd("sm_customvote"Command_CustomVote);
}

Action Command_CustomVote(int clientint args)
{
    if (
CustomVotes_IsVoteInProgress())
    {
        return 
Plugin_Handled;
    }
    
    
CustomVoteSetup setup;
    
    
setup.team CS_TEAM_NONE;
    
setup.initiator client;
    
setup.issue_id VOTE_ISSUE_UNPAUSEMATCH;
    
setup.dispstr "<font color='#FF5500' class='fontSize-xxxl'>Faceit?</font><br/><img src='https://pbs.twimg.com/profile_images/1349712390628270081/KpMEtOII.png'/>";
    
setup.disppass "<font color='#3df218'>Vote Passed!</font>";
    
    
CustomVotes_Execute(setup10);
    
    return 
Plugin_Handled;



Sarrus 08-09-2021 09:59

Re: [CS:GO] Custom Votes [Panorama] (v1.0 | 9 August 2021)
 
Looks really good! :bacon!::bacon!:

Cruze 08-09-2021 12:05

Re: [CS:GO] Custom Votes [Panorama] (v1.0 | 9 August 2021)
 
Damn, tested it and looks really good in-game! Thanks for sharing :bacon!: :bacon!: :bacon!:

Edit:
It would be really nice if you can add (if it's possible that is):

setup.Display = client;

instead of specific whole team because sometimes you may wanna display vote to a specific client only.

NanoC 08-09-2021 13:43

Re: [CS:GO] Custom Votes [Panorama] (v1.0 | 9 August 2021)
 
Amazing. Good job!

KoNLiG 08-10-2021 05:18

Re: [CS:GO] Custom Votes [Panorama] (v1.0 | 9 August 2021)
 
Thanks for the appreciation!

Quote:

Originally Posted by Cruze (Post 2754872)
Damn, tested it and looks really good in-game! Thanks for sharing :bacon!: :bacon!: :bacon!:

Edit:
It would be really nice if you can add (if it's possible that is):

setup.Display = client;

instead of specific whole team because sometimes you may wanna display vote to a specific client only.

This is possible by adding 'CustomVotes_ExecuteToClient' native to broadcast a custom vote for a single player, but it's not ideal for the reason that there is only one 'vote_controller' entity exists, which means that it's not possible to broadcast several custom votes at once.
This disadvantage can easily interrupt other plugins when broadcasting a custom vote to a single player.

If there will be a demand for this native, it'll be added.

digin 08-10-2021 07:42

Re: [CS:GO] Custom Votes [Panorama] (v1.0 | 9 August 2021)
 
wow nice plugins!

NanoC 08-10-2021 11:52

Re: [CS:GO] Custom Votes [Panorama] (v1.0 | 9 August 2021)
 
Would be possible that admins can make a custom vote using a simple command? Like !vote from sourcemod votes

KoNLiG 08-10-2021 14:00

Re: [CS:GO] Custom Votes [Panorama] (v1.0 | 9 August 2021)
 
Quote:

Originally Posted by NanoC (Post 2754976)
Would be possible that admins can make a custom vote using a simple command? Like !vote from sourcemod votes

Of course, it's possible to replicate SourceMod vote commands (!customvote, !cancelcustomvote), but it's not possible to create a multiple choice vote because the game only supports Yes/No votes.

kratoss1812 08-10-2021 16:08

Re: [CS:GO] Custom Votes [Panorama] (v1.0 | 9 August 2021)
 
Really really cool :bacon!: Can you control to who the vote is beeing displayed or it is just for everyone?


All times are GMT -4. The time now is 06:32.

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