Thread: [Solved] I need help with my plugin
View Single Post
lnteresting
Junior Member
Join Date: Jan 2019
Old 01-18-2019 , 14:32   Re: I need help with my plugin
Reply With Quote #5

Quote:
Originally Posted by Cruze View Post
PHP Code:
#pragma semicolon 1
#pragma newdecls required

#define PLUGIN_AUTHOR ""
#define PLUGIN_VERSION "1.0"

#include <sourcemod>
#include <sdktools>

public Plugin myinfo 
{
    
name "Vote No Spread",
    
author PLUGIN_AUTHOR,
    
description "Voting for No Spread",
    
version PLUGIN_VERSION,
    
url "http://steamcommunity.com/profiles/76561198132924835"
};

public 
void OnPluginStart()
{
    
RegAdminCmd("sm_votenp"Command_VoteNPADMFLAG_VOTE);
}

public 
int Handle_VoteMenu(Menu menuMenuAction actionint param1int param2)
{
    if (
action == MenuAction_End)
    {
        
delete menu;
    }
    else if (
action == MenuAction_VoteEnd)
    {
        
/* 0=yes, 1=no */
        
if (param1 == 0)
        {
            
ServerCommand("weapon_accuracy_nospread 1");
        }
    }
}

public 
Action Command_VoteNP(int clientint args)
{
    if(
IsVoteInProgress())
    {
        return 
Plugin_Handled;
    }
    
DoVoteMenu();
    return 
Plugin_Handled;
}

void DoVoteMenu()
{
    
Menu menu = new Menu(Handle_VoteMenu);
    
menu.SetTitle("Enable NoSpread?");
    
menu.AddItem("""Yes");
    
menu.AddItem("""No");
    
menu.ExitButton false;
    
menu.DisplayVoteToAll(20);

Thank you very much!
lnteresting is offline