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

req automatic vote hs


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Neon123
Senior Member
Join Date: Jan 2016
Old 07-27-2017 , 14:10   req automatic vote hs
Reply With Quote #1

hi , please need a plugin to run a vote once per map , to activate head only mode , example on a map starting after 30 seconds run a vote "activate head only?" "yes" "no" if win yes server execute cvar sm_headshotonly_enabled 1

If the vote is tied do nothing

Last edited by Neon123; 07-27-2017 at 15:27.
Neon123 is offline
stephen473
Senior Member
Join Date: Jan 2017
Location: somewhere on earth
Old 07-28-2017 , 17:55   Re: req automatic vote hs
Reply With Quote #2

You can add me on steam for this
__________________
Also known as Hardy`.

Feel free to contact me if you have a private plugin request!

My Steam Profile | Discord: Hardy`#3792
stephen473 is offline
vortex.
AlliedModders Donor
Join Date: Jan 2017
Location: OnGameFrame()
Old 07-28-2017 , 18:28   Re: req automatic vote hs
Reply With Quote #3

Quote:
Originally Posted by stephen473 View Post
You can add me on steam for this
This is a very simple request. This is a forum. It's not a special request platform.

_________________


Here, I'm writed a few lines for you.

PHP Code:
#pragma semicolon 1 

#define PLUGIN_AUTHOR "Vortéx!" 
#define PLUGIN_VERSION "1.0" 

#include <sourcemod> 

#pragma newdecls required 

public Plugin myinfo =  

    
name "Only Head Vote"
    
author PLUGIN_AUTHOR
    
version PLUGIN_VERSION
    
url "https://forums.alliedmods.net/showthread.php?t=299840" 
}; 

public 
void OnMapStart()
{
    
CreateTimer(60.0sendvote); // Wait 60 seconds when map start for ALL PLAYERS WAITING FOR VOTE :p
}

public 
Action sendvote(Handle timer)
{
    
DoVoteMenu(); // After 60 seconds
}

public 
int Handle_VoteMenu(Menu menuMenuAction actionint param1,int param2)
{
    if (
action == MenuAction_End)
    {
        
/* This is called after VoteEnd */
        
delete menu;
    } else if (
action == MenuAction_VoteEnd) {
        
/* 0=yes, 1=no */
        
if (param1 == 0)
        {
            
ServerCommand("sm_headshotonly_enabled 1"); // if dont work change to ServerCommand("sm_cvar sm_headshotonly_enabled 1");
        
}
    }
}
 
void DoVoteMenu()
{
    if (
IsVoteInProgress())
    {
        return;
    }
 
    
Menu menu = new Menu(Handle_VoteMenu);
    
menu.SetTitle("Active Head Only?");
    
menu.AddItem("yes""Yes");
    
menu.AddItem("no""No");
    
menu.ExitButton false;
    
menu.DisplayVoteToAll(20);

@Neon123, if you dont understand this, you can look: https://wiki.alliedmods.net/Menu_API...d)#Simple_Vote
__________________

Last edited by vortex.; 07-28-2017 at 18:39.
vortex. is offline
Neon123
Senior Member
Join Date: Jan 2016
Old 07-28-2017 , 20:34   Re: req automatic vote hs
Reply With Quote #4

thank you vortex
Neon123 is offline
vortex.
AlliedModders Donor
Join Date: Jan 2017
Location: OnGameFrame()
Old 07-28-2017 , 20:37   Re: req automatic vote hs
Reply With Quote #5

You're welcome
__________________
vortex. is offline
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 11:15.


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