Raised This Month: $ Target: $400
 0% 

Change roundtime plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Michciu94
Junior Member
Join Date: Nov 2016
Old 08-01-2019 , 15:20   Change roundtime plugin
Reply With Quote #1

Welcome,
I try to write simple plugin to cs go when I can change roundtime, but this not working for me..
Anyone can help?


#pragma semicolon 1
#include <sourcemod>

public Plugin:myinfo =
{
name = "change Round Time",
author = "Michu",
version = "1.0"
};

public Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
new Handle:hCvar = FindConVar("mp_roundtime");
SetConVarBounds(hCvar, ConVarBound_Upper, true, 120.0);
CloseHandle(hCvar);
}
Michciu94 is offline
PorcusorulMagic
Member
Join Date: Dec 2018
Location: Romania
Old 08-01-2019 , 19:06   Re: Change roundtime plugin
Reply With Quote #2

Untested
PHP Code:
#include <sourcemod>

public OnPluginStart() 

    
HookEvent("round_start"OnRoundStartEventHookMode_PostNoCopy); 


public 
OnRoundStart(Handle:event, const String:name[], bool:dontBroadcast

    
ServerCommand("mp_roundtime 120");

__________________
Steam - https://steamcommunity.com/id/porcusorulmagic
Discord - PorcusorulMagic#4908
PorcusorulMagic is offline
farawayf
Senior Member
Join Date: Jan 2019
Old 08-02-2019 , 09:44   Re: Change roundtime plugin
Reply With Quote #3

from BotoX's RoundTime plugin.
PHP Code:
#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <sdktools>

public Plugin myinfo =
{
    
name "RoundTime",
    
author "BotoX",
    
description "Change roundtime instantly and remove limit.",
    
version "1.0",
    
url ""
}

ConVar g_CVar_mp_roundtime;

public 
void OnPluginStart()
{
    
g_CVar_mp_roundtime FindConVar("mp_roundtime");
    
g_CVar_mp_roundtime.SetBounds(ConVarBound_Uppertrue546.0); // empirically determined
    
g_CVar_mp_roundtime.AddChangeHook(OnConVarChanged);
}

public 
void OnConVarChanged(ConVar convar, const char[] oldValue, const char[] newValue)
{
    
GameRules_SetProp("m_iRoundTime"StringToInt(newValue) * 60);

farawayf 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 10:38.


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