Monthly Target: $400 Donations: $140
 35% 

Notices

TF2 Critvote


Post New Thread Reply   
 
Thread Tools Display Modes
Author
r5053
SourceMod Donor
Join Date: May 2007
Location: Germany
Plugin ID:
728
Plugin Version:
1.0.0
Plugin Category:
Gameplay
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
    6 
    Plugin Description:
    Starts a critvote 20 sec after the first client is connected
    Old 01-18-2009 , 07:21   TF2 Critvote
    Reply With Quote #1

    This plugin starts a critvote 20 sec after the first client is connected.

    Changelog:
    v.1.0.0
    -initial release
    Attached Files
    File Type: sp Get Plugin or Get Source (critvote.sp - 2891 views - 1.5 KB)
    __________________
    Visit HLPortal.de (this is not my Page)


    r5053 is offline
    Send a message via ICQ to r5053 Send a message via Skype™ to r5053
    Sexual Harassment Panda
    Veteran Member
    Join Date: Dec 2008
    Location: San Diego, CA
    Old 01-26-2009 , 20:43   Re: TF2 Critvote
    Reply With Quote #2

    is this a vote for crits to be on with normal settings or completely off, or is it something else?
    __________________
    Sexual Harassment Panda is offline
    blissend
    Member
    Join Date: Mar 2008
    Old 01-27-2009 , 19:45   Re: TF2 Critvote
    Reply With Quote #3

    Quote:
    Originally Posted by Sexual Harassment Panda View Post
    is this a vote for crits to be on with normal settings or completely off, or is it something else?
    looking at the source it has...

    ServerCommand("tf_weapon_criticals 0");

    so yeah it seems to turn crits completely off depending on vote. though I'm not a programmer so don't quote me.
    blissend is offline
    sirmoe
    Senior Member
    Join Date: Mar 2008
    Old 01-28-2009 , 07:41   Re: TF2 Critvote
    Reply With Quote #4

    does this vote start every map change?
    sirmoe is offline
    DJ Tsunami
    DJ Post Spammer
    Join Date: Feb 2008
    Location: Netherlands
    Old 01-28-2009 , 10:15   Re: TF2 Critvote
    Reply With Quote #5

    Yes.
    __________________
    DJ Tsunami is offline
    liam12360
    Member
    Join Date: Jul 2008
    Old 01-28-2009 , 16:52   Re: TF2 Critvote
    Reply With Quote #6

    Woah looking at the source this could be edited to be almost anything.. Cheats vote, Alltalk, even toggling other plugins! Call me stupid but I find this a very valuable example as I'm not really a 'start from scratch' programmer. Thanks for this even if it dosent get approved! Rep+
    __________________

    Last edited by liam12360; 01-28-2009 at 17:40.
    liam12360 is offline
    r5053
    SourceMod Donor
    Join Date: May 2007
    Location: Germany
    Old 01-28-2009 , 17:50   Re: TF2 Critvote
    Reply With Quote #7

    __________________
    Visit HLPortal.de (this is not my Page)


    r5053 is offline
    Send a message via ICQ to r5053 Send a message via Skype™ to r5053
    noremac430
    Member
    Join Date: Mar 2009
    Old 03-27-2009 , 11:02   Re: TF2 Critvote
    Reply With Quote #8

    Hey man. Love the plugin. Our server runs nocrits all the time, so i tweaked the vote to reflect that. It now asks to enable crits instead of disabling them. I'll repost the updated code.

    Thanks again for all your work on this. It's a lifesaver!!

    Code:
    //Includes:
    #include <sourcemod>
    
    #define PLUGIN_VERSION "1.0.0"
    
    new bool:firstclientconnected = false
    
    public Plugin:myinfo = 
    {
        name = "TF2 Critvote",
        author = "R-Hehl",
        description = "TF2 Critvote",
        version = PLUGIN_VERSION,
        url = "http://HLPortal.de"
    };
    public OnPluginStart()
    {
        CreateConVar("sm_tf2_critvote_version", PLUGIN_VERSION, "TF2 Critvote", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
    }
    public OnMapStart()
    {
        firstclientconnected = false
    }
    public OnClientPostAdminCheck()
    {
        if (!firstclientconnected)
        {
        CreateTimer(30.0, StartVote)
        firstclientconnected = true
        }
    }
    public Action:StartVote(Handle:timer)
    {
        DoVoteMenu()
    }
    
    public Handle_VoteMenu(Handle:menu, MenuAction:action, param1, param2)
    {
        if (action == MenuAction_End)
        {
            /* This is called after VoteEnd */
            CloseHandle(menu);
        } else if (action == MenuAction_VoteEnd) {
            /* 0=yes, 1=no */
            if (param1 == 1)
            {
                ServerCommand("tf_weapon_criticals 0");
                PrintToChatAll("\x04[\x03TF2-Critvote\x04]\x01 Crits Disabled")
            }
            else
            {
                PrintToChatAll("\x04[\x03TF2-Critvote\x04]\x01 Crits Enabled")
                ServerCommand("tf_weapon_criticals 1");
            }
        }
    }
     
    DoVoteMenu()
    {
        if (IsVoteInProgress())
        {
            return;
        }
     
        new Handle:menu = CreateMenu(Handle_VoteMenu)
        SetMenuTitle(menu, "Enable Crits?")
        AddMenuItem(menu, "yes", "Yes")
        AddMenuItem(menu, "no", "No")
        SetMenuExitButton(menu, false)
        VoteMenuToAll(menu, 20);
    }
    noremac430 is offline
    Johnny_Napalm
    Member
    Join Date: Apr 2009
    Old 04-27-2009 , 19:41   Re: TF2 Critvote
    Reply With Quote #9

    I'm still a little new at all this, but could this be modified to allow it to be a client-triggered vote instead of automatic?
    Johnny_Napalm is offline
    retsam
    Veteran Member
    Join Date: Aug 2008
    Location: so-cal
    Old 04-27-2009 , 22:29   Re: TF2 Critvote
    Reply With Quote #10

    Quote:
    Originally Posted by Johnny_Napalm View Post
    I'm still a little new at all this, but could this be modified to allow it to be a client-triggered vote instead of automatic?

    Sourcemod can do anything. Remember that.
    retsam 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 01:52.


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