Raised This Month: $32 Target: $400
 8% 

[REQ] Round chooser


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
j1gg
Senior Member
Join Date: Dec 2015
Old 12-16-2018 , 08:10   [REQ] Round chooser
Reply With Quote #1

Every 3 rounds there is a vote for the round type. A vote will be displayed and players will choose what will be the next round.
round types:
- only noscope
- low gravity
- high gravity
- autobh + noscope
__________________
j1gg is offline
Brum Brum
Junior Member
Join Date: Mar 2017
Old 12-21-2018 , 12:27   Re: [REQ] Round chooser
Reply With Quote #2

PHP Code:
#include <sdktools>

#pragma semicolon 1
#pragma newdecls required

#define MOD_TAG "\x01\x0B★ \x07[Round Chooser]\x04 "
#define WATER_LEVEL_FEET_IN_WATER 1

char RoundName[][] = 
{
    
"ONLY NOSCOPE""LOW GRAVITY""HIGH GRAVITY""AUTOBH + ONLY NOSCOPE"
};
char WeaponList[][] = 
{
    
"weapon_glock""weapon_usp_silencer""weapon_deagle""weapon_tec9""weapon_hkp2000""weapon_p250""weapon_fiveseven""weapon_elite""weapon_cz75a""weapon_galilar""weapon_famas""weapon_ak47""weapon_m4a1""weapon_m4a1_silencer""weapon_ssg08""weapon_aug""weapon_sg556""weapon_awp""weapon_scar20""weapon_g3sg1""weapon_nova""weapon_xm1014""weapon_mag7""weapon_m249""weapon_negev""weapon_mac10""weapon_mp9""weapon_mp7""weapon_ump45""weapon_p90""weapon_bizon""weapon_mp5sd""weapon_sawedoff""weapon_knife""weapon_flashbang""weapon_hegrenade""weapon_smokegrenade""weapon_healthshot""weapon_decoy""weapon_molotov""weapon_incgrenade""weapon_tagrenade""weapon_taser"
};

ConVar FreezetimeLowGravityHighGravity;

int Roundgame = -1;
bool nslghgabhns;

public 
Plugin myinfo 
{
    
name "Round Chooser"
    
author "Brum Brum"
    
description "Player choose round type"
    
version "1.0"
    
url "StudioADEPT.net/Forum"
}

public 
void OnPluginStart()
{
    
Freezetime FindConVar("mp_freezetime");
    
LowGravity CreateConVar("sm_lowgravity""0.15""Low gravity");
    
HighGravity CreateConVar("sm_highgravity""2.5""High gravity");
    
AutoExecConfig(true"RoundChooser");
    
HookEvent("round_start"Event_RoundStart);
    
HookEvent("round_end"Event_RoundEnd);
}

public 
Action Event_RoundStart(Event event, const char[] namebool dontBroadcast)
{
    if (!
IsWarmup())
    {
        
Round++;
        
GetRound();
        if (
Round == 1)
        {
            
ChooseRound();
        }
        else if (
Round == 3)Round 0;
    }
}

public 
Action Event_RoundEnd(Event event, const char[] namebool dontBroadcast)
{
    for (
int i 1MaxClientsi++)
    {
        if (
IsValidClient(i))
        {
            
SetEntityGravity(i1.0);
        }
    }
}

void ChooseRound()
{
    
int freeze Freezetime.IntValue;
    
Menu menu = new Menu(VoteMenu_Handler);
    
menu.SetTitle("Choose round gamemode");
    
menu.AddItem("""Only NoScope");
    
menu.AddItem("""Low Gravity");
    
menu.AddItem("""High Gravity");
    
menu.AddItem("""AutoBH + NoScope");
    
menu.ExitButton false;
    
menu.DisplayVoteToAll(freeze);
}

public 
int VoteMenu_Handler(Menu menuMenuAction actionint clientint item)
{
    if (
action == MenuAction_Select)
    {
        switch (
item)
        {
            case 
0:
            {
                
ns true;
                
game 0;
                
GiveAWP();
            }
            case 
1:
            {
                
lg true;
                
game 1;
                
Gravity();
            }
            case 
2:
            {
                
hg true;
                
game 2;
                
Gravity();
            }
            case 
3:
            {
                
abhns true;
                
game 3;
                
GiveAWP();
            }
        }
        
PrintToChatAll("%s The current round will be\x07 %s!"MOD_TAGRoundName[game]);
    }
}

public 
Action OnPlayerRunCmd(int clientint &buttonsint &impulsefloat vel[3], float angles[3], int &weapon)
{
    if (
ns)
    {
        if (
buttons IN_ATTACK2)
        {
            
buttons buttons &= ~IN_ATTACK2;
            return 
Plugin_Changed;
        }
    }
    else if (
lg)
    {
        
float lowgravity LowGravity.FloatValue;
        if (
GetEntityGravity(client) != lowgravity)
        {
            
SetEntityGravity(clientlowgravity);
        }
    }
    else if (
hg)
    {
        
float highgravity HighGravity.FloatValue;
        if (
GetEntityGravity(client) != highgravity)
        {
            
SetEntityGravity(clienthighgravity);
        }
    }
    else if (
abhns)
    {
        
int index GetEntProp(clientProp_Data"m_nWaterLevel");
        
int water EntIndexToEntRef(index);
        if (
water != INVALID_ENT_REFERENCE)
        {
            if (
buttons IN_JUMP)
            {
                if (!(
Client_GetWaterLevel(client) > WATER_LEVEL_FEET_IN_WATER))
                {
                    if (!(
GetEntityMoveType(client) & MOVETYPE_LADDER))
                    {
                        
SetEntPropFloat(clientProp_Send"m_flStamina"0.0);
                        if (!(
GetEntityFlags(client) & FL_ONGROUND))
                        {
                            
buttons &= ~IN_JUMP;
                        }
                    }
                }
            }
        }
        if (
buttons IN_ATTACK2)
        {
            
buttons buttons &= ~IN_ATTACK2;
            return 
Plugin_Changed;
        }
    }
    return 
Plugin_Continue;
}

void Gravity()
{
    
float lowgravity LowGravity.FloatValue;
    
float highgravity HighGravity.FloatValue;
    for (
int i 1MaxClientsi++)
    {
        if (
IsValidClient(i) && IsPlayerAlive(i))
        {
            if (
lg)SetEntityGravity(ilowgravity);
            else if (
hg)SetEntityGravity(ihighgravity);
        }
    }
}

void GiveAWP()
{
    
RemoveWeapons();
    for (
int i 1MaxClientsi++)
    {
        if (
IsValidClient(i) && IsPlayerAlive(i))
        {
            
GivePlayerItem(i"weapon_knife");
            
GivePlayerItem(i"weapon_awp");
        }
    }
}

void GetRound()
{
    if (
Round == 1)
    {
        
ns false;
        
lg false;
        
hg false;
        
abhns false;
    }
    else if (
Round && Round <= 3)
    {
        if (
ns || abhns)
        {
            
GiveAWP();
        }
        else if (
lg || hg)
        {
            
Gravity();
        }
        
PrintToChatAll("%s The current round will be\x07 %s!"MOD_TAGRoundName[game]);
    }
}

int Client_GetWaterLevel(int client)
{
    
    return 
GetEntProp(clientProp_Send"m_nWaterLevel");
}

public 
bool IsValidClient(int client)
{
    if (!(
<= client <= MaxClients) || !IsClientInGame(client) || !IsClientConnected(client) || IsFakeClient(client) || IsClientSourceTV(client))
        return 
false;
    
    return 
true;
}

stock void RemoveWeapons()
{
    for (
int i 0sizeof(WeaponList); i++)
    {
        
int ent = -1;
        while ((
ent FindEntityByClassname(entWeaponList[i])) != -1)
        {
            
AcceptEntityInput(ent"Kill");
        }
    }
}

stock bool IsWarmup()
{
    
int warmup GameRules_GetProp("m_bWarmupPeriod"40);
    if (
warmup == 1)return true;
    else return 
false;

Brum Brum is offline
j1gg
Senior Member
Join Date: Dec 2015
Old 12-23-2018 , 09:13   Re: [REQ] Round chooser
Reply With Quote #3

It is not working.
Every round is noscope

It should work like that:
All players every 3rd round have vote for next round type.
__________________
j1gg is offline
aykocity
Member
Join Date: Sep 2017
Old 12-24-2018 , 02:28   Re: [REQ] Round chooser
Reply With Quote #4

@Brum Brum do you add editable config file?
aykocity is offline
Brum Brum
Junior Member
Join Date: Mar 2017
Old 12-24-2018 , 04:48   Re: [REQ] Round chooser
Reply With Quote #5

Quote:
Originally Posted by j1gg View Post
It is not working.
Every round is noscope

It should work like that:
All players every 3rd round have vote for next round type.
After all, this is how it works. When I tested it worked, make sure that no other plug-in interferes with it.

Quote:
Originally Posted by aykocity View Post
@Brum Brum do you add editable config file?
if you mean autoexec then yes, you have information about it in the 37th line.
Brum Brum is offline
j1gg
Senior Member
Join Date: Dec 2015
Old 01-25-2019 , 06:50   Re: [REQ] Round chooser
Reply With Quote #6

I ment that this plugin should work like 3 normal rounds then 1 round from 1st post.
__________________
j1gg is offline
flashing
Senior Member
Join Date: Jul 2019
Location: India
Old 02-08-2020 , 14:19   Re: [REQ] Round chooser
Reply With Quote #7

Quote:
Originally Posted by Brum Brum View Post
After all, this is how it works. When I tested it worked, make sure that no other plug-in interferes with it.



if you mean autoexec then yes, you have information about it in the 37th line.
can remove voting and instead make it so that there should be 1 custom round after each x no. of rounds
also can you add players hp customization and knife damage customization
flashing 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 05:25.


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