This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Run a server command for 5 rounds


Post New Thread Reply   
 
Thread Tools Display Modes
cold-serenity
Member
Join Date: Sep 2009
Old 03-19-2012 , 18:19   Re: Run a server command for 5 rounds
Reply With Quote #21

Haha thanks man, I actually figured that one out myself I just came back now to delete my post. I finally understand hooks lol feels good. This is a big step for me believe it or not.

Last edited by cold-serenity; 03-19-2012 at 18:19.
cold-serenity is offline
r3v
Senior Member
Join Date: Feb 2016
Location: Lithuania, Vilnius
Old 11-28-2016 , 07:21   Re: Run a server command for 5 rounds
Reply With Quote #22

Hello. I edited script to reset round counter (mp_restartgame or Round Draw) on CS:S and i want unrestrict sniper weapons, but .cfg on 4 round not executing... Can someone help me, please?

PHP Code:
#include <sourcemod>
#include <sdktools>
#include <cstrike>

new Rounds;
new 
Handle:CvarRestartGame

public Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast) if(++Rounds == 3ServerCommand("exec sourcemod/3sniperson.cfg"); 

public 
OnPluginStart()
{
    
HookEvent("round_start"round_startEventHookMode_PostNoCopy);
    
CvarRestartGame FindConVar("mp_restartgame");
    
HookConVarChange(CvarRestartGameChange_RestartGame);
}

public 
Change_RestartGame(Handle:convar, const String:oldValue[], const String:newValue[])
{
    if (
StringToInt(newValue) > 0)
    {
        
Rounds 0;
    }
}

public 
Action CS_OnTerminateRound(&Float:delay, &CSRoundEndReason:reason)
{
    if(
reason == CSRoundEnd_Draw)
        {
            
Rounds 0;
        }
        
    else if(
reason == CSRoundEnd_GameStart)
        {
            
Rounds 0;
        }
}

public 
OnMapStart() Rounds 0;
public 
round_start(Handle:event, const String:name[], bool:dontBroadcastRounds++; 

Last edited by r3v; 11-28-2016 at 08:30.
r3v 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 21:01.


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