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

Need: Vote Extend maptime


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NIELSAD
Junior Member
Join Date: Oct 2019
Location: Iceland
Old 11-27-2019 , 08:48   Need: Vote Extend maptime
Reply With Quote #1

I have been searching for a long time for a plugin that lets players start a vote by typing "!extend" or "!ve" and it would start a vote to extend the maptime of a KZ server by 10 minutes.

Can anybody link a plugin like this to me ? or even make one ?

Thank you in advance!

-Níels
NIELSAD is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 11-28-2019 , 08:06   Re: Need: Vote Extend maptime
Reply With Quote #2

PHP Code:

#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <sdktools>

public void OnPluginStart()
{
    
RegConsoleCmd("sm_ve"Command_ExtendMapTime);
    
RegConsoleCmd("sm_extend"Command_ExtendMapTime);
}

public 
Action Command_ExtendMapTime(int clientint args)
{
    if (
IsVoteInProgress())
    {
        return 
Plugin_Handled;
    }
    
    
Menu menu = new Menu(MenuHandler_ExtendMapTimeMENU_ACTIONS_ALL);
    
menu.VoteResultCallback VoteResultCallback_ExtendMapTime;
    
    
menu.SetTitle("Extend map time by 10 minutes?");
    
menu.AddItem("Yes""Yes");
    
menu.AddItem("No""No");
    
    
menu.ExitButton false;
    
menu.DisplayVoteToAll(15);
    
    return 
Plugin_Handled;
}

public 
int MenuHandler_ExtendMapTime(Menu menuMenuAction actionint param1int param2)
{
    if (
action == MenuAction_End)
    {
        
delete menu;
    }
}

public 
void VoteResultCallback_ExtendMapTime(Menu menuint num_votesint num_clients, const int[][] client_infoint num_items, const int[][] item_info)
{
    
char item[65];
    
menu.GetItem(item_info[0][VOTEINFO_ITEM_INDEX], itemsizeof(item));
    
    if (
StrEqual(item"Yes"false))
    {
        
ExtendMapTimeLimit(600);
        
PrintToChatAll("[SM] The current map has been extended with 10 minutes");
    }

__________________

Last edited by Ilusion9; 12-03-2019 at 08:39.
Ilusion9 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 06:41.


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