Raised This Month: $ Target: $400
 0% 

[REQ] [ANY] exclude spectators from votes


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
stoneyschillhouse
Senior Member
Join Date: Nov 2012
Old 06-26-2016 , 06:01   [REQ] [ANY] exclude spectators from votes
Reply With Quote #1

Hi

I want this in any vote , the spectators will be excluded!

I have found something for the rtv.sp

I have replaced the lines 187 - 255

PHP Code:
AttemptRTV(client)
{
    if (!
g_RTVAllowed  || (g_Cvar_RTVPostVoteAction.IntValue == && HasEndOfMapVoteFinished()))
    {
        
ReplyToCommand(client"[SM] %t""RTV Not Allowed");
        return;
    }
        
    if (!
CanMapChooserStartVote())
    {
        
ReplyToCommand(client"[SM] %t""RTV Started");
        return;
    }
    
    if (
GetClientCount(true) < g_Cvar_MinPlayers.IntValue)
    {
        
ReplyToCommand(client"[SM] %t""Minimal Players Not Met");
        return;            
    }
    
    if (
g_Voted[client])
    {
        
ReplyToCommand(client"[SM] %t""Already Voted"g_Votesg_VotesNeeded);
        return;
    }    
    
    new 
String:name[64];
    
GetClientName(clientnamesizeof(name));
    
    
g_Votes++;
    
g_Voted[client] = true;
    
    
PrintToChatAll("[SM] %t""RTV Requested"nameg_Votesg_VotesNeeded);
    
    if (
g_Votes >= g_VotesNeeded)
    {
        
StartRTV();
    }    

with these

PHP Code:
AttemptRTV(client)
{
    if (!
g_RTVAllowed  || (g_Cvar_RTVPostVoteAction.IntValue == && HasEndOfMapVoteFinished()))
    {
        
ReplyToCommand(client"[SM] %t""RTV Not Allowed");
        return;
    }
        
    if (!
CanMapChooserStartVote())
    {
        
ReplyToCommand(client"[SM] %t""RTV Started");
        return;
    }
    
    if (
GetClientCount(true) < g_Cvar_MinPlayers.IntValue)
    {
        
ReplyToCommand(client"[SM] %t""Minimal Players Not Met");
        return;            
    }
    
    if (
g_Voted[client])
    {
        
ReplyToCommand(client"[SM] %t""Already Voted"g_Votesg_VotesNeeded);
        return;
    }    
    
    new 
String:name[64];
    
GetClientName(clientnamesizeof(name));
    
    if (
GetClientTeam(client) != 1)
    {
        
g_Votes++;
        
g_Voted[client] = true;
        
        new 
totalvalid 0;
        for (new 
1MaxClientsi++)
        {
            if (
IsClientInGame(i))
            {
                if (
GetClientTeam(i) > 1)
                {
                    
totalvalid++;
                }
            }
        }
        
        
// if we reached this far the minimum amount of players required has already been met..
        
new needed RoundToFloor(float(totalvalid) * GetConVarFloat(g_Cvar_Needed));
        
PrintToChatAll("[SM] %t""RTV Requested"nameg_Votesneeded);
        
        if (
g_Votes >= needed)
        {
            
StartRTV();
        }
    }
    else
    {
        
PrintToChat(client"Spectators aren't allowed to RTV.");
    }

This works grate - only clients on t + ct team are included for rtv
Spectators will get the massage....

Is there any way to handle this for all votes ? (kick, ban, mute with this plugin https://forums.alliedmods.net/showthread.php?t=72058 )

it does not matter if one by one or globaly for all.

the main thing is that it works properly
If one by one or globaly
__________________
SRY FOR MY BAD ENGLISH
I'm german

Last edited by stoneyschillhouse; 06-26-2016 at 09:15.
stoneyschillhouse 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 02:39.


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