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

[L4D2] How to remove spectators from counting as potential voters?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
philipjfry
Junior Member
Join Date: Sep 2019
Location: Somewhere in europe
Old 09-28-2020 , 18:45   [L4D2] How to remove spectators from counting as potential voters?
Reply With Quote #1

Hello,

Any help on how to remove spectator players from counting as potential voters and filling the vote hud?
I figured i have to hook "callvote" command and fire "vote_changed" event and change the 'PotentialVotes' value but doesn't seem to work.
philipjfry is offline
BRU7US
Member
Join Date: Jul 2020
Location: Tatarstan, Kazan
Old 09-30-2020 , 17:49   Re: [L4D2] How to remove spectators from counting as potential voters?
Reply With Quote #2

I think you can hook this "callvote" by AddCommandListener and swap native callvote by custom vote created via NativeVotes which can set every player on server who will can vote.

Example:

PHP Code:
public OnPluginStart()
{
    
AddCommandListener(Cmd_Callvote"callvote");
}
 
public 
Action:Cmd_Callvote(client, const String:command[], args)
{
    
char votearg1[64];
    
GetCmdArg(1votearg1sizeof(votearg1));
 
    if (
StrContains(votearg1"kick"false) != -1//kick as example. It maybe other
    
{
        
//do action you need
    
}

    return 
Plugin_Continue;


Last edited by BRU7US; 09-30-2020 at 17:51.
BRU7US 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 23:57.


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