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

How to make vote to spesific team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pr0mers
Junior Member
Join Date: May 2020
Old 05-30-2020 , 09:17   How to make vote to spesific team
Reply With Quote #1

//i made voting i just need i want to show it to only t like ct cant see the vote


How can i make voting to only t players like

1 or 2
1
2

is vote
this vote will be shown only to t .ct's cant answer it

and how can i know 1 or 2 is chosen
like if answer is 1 do printtochatall("1 is answer")
else printtochatall("2 is asnwer");

and what happens if votes are 50% to 50%

Last edited by pr0mers; 05-30-2020 at 10:02.
pr0mers is offline
SSheriFF
AlliedModders Donor
Join Date: May 2020
Location: Israel
Old 06-02-2020 , 12:41   Re: How to make vote to spesific team
Reply With Quote #2

PHP Code:
#pragma semicolon 1

#define DEBUG
#pragma tabsize 0
#define PLUGIN_AUTHOR ""
#define PLUGIN_VERSION "0.00"

#include <sourcemod>
#include <sdktools>
#include <cstrike>

#pragma newdecls required
int Terrorists[MAXPLAYERS 1];
int counter 0;
public 
Plugin myinfo 
{
    
name "",
    
author PLUGIN_AUTHOR,
    
description "",
    
version PLUGIN_VERSION,
    
url ""
};

public 
void OnPluginStart()
{
    
RegConsoleCmd("sm_command"Command,"The command that opens the vote");//edit this
}

public 
Action Command(int clientint args)
{
    if (
IsVoteInProgress())
    {
        return 
Plugin_Handled;
    }
    
    
Menu menu = new Menu(MenuHandler_Vote);
    
menu.VoteResultCallback VoteResultCallback_Vote;
    
menu.SetTitle("Your Vote Title");//edit this
    
for (int i 1<= MaxClientsi++)
    {
        if(
IsClientInGame(i)&&!IsFakeClient(i)&&GetClientTeam(i)== CS_TEAM_T)
        {
            
Terrorists[counter] = i;
            
counter++;
        }
    }
    
    
menu.AddItem("option1""option1");//edit this
    
menu.AddItem("option2""option2");//edit this
    
    
menu.ExitButton false;
    
menu.DisplayVote(Terroristscounter15);//15 is the number of seconds the menu will be shown to the Terrorists. editable.
    
return Plugin_Handled;
}

public 
int MenuHandler_Vote(Menu menuMenuAction actionint param1int param2)
{
    if (
action == MenuAction_End)
    {
        
delete menu;
    }
}

public 
void VoteResultCallback_Vote(Menu menuint num_votesint num_clients, const int[][] client_infoint num_items, const int[][] item_info)
{
    
char item[65];
    
menu.GetItem(item_info[0][VOTEINFO_ITEM_INDEX], itemsizeof(item));
    
    if (
StrEqual(item"option1"false))//edit this
       
PrintToChatAll("%s is the answer",item);
    else if(
StrEqual(item"option2"false))//edit this
    
PrintToChatAll("%s is the answer",item);
    for (
int i 1<= MaxClientsi++)
    {
        if(
IsClientInGame(i)&&!IsFakeClient(i))
            
Terrorists[i] = 0;
    }
    
counter 0;

SSheriFF 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 09:35.


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