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

How can i disallow comand if mp_roundtime - currenttimeROUND > 5


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
maciasbarlinek
Senior Member
Join Date: May 2015
Old 07-31-2015 , 20:54   How can i disallow comand if mp_roundtime - currenttimeROUND > 5
Reply With Quote #1

Hello

How can i disallow comand if mp_roundtime - currenttimeROUND > 5?

Code:
if(....)
{
        ReplyToCommand(client, "It's too late to use this command..");
        return Plugin_Handled;
}


SourceMod:
1.7.2
__________________
cam0 & lingzhidiyu - The best users
maciasbarlinek is offline
maciasbarlinek
Senior Member
Join Date: May 2015
Old 08-01-2015 , 06:07   Re: How can i disallow comand if mp_roundtime - currenttimeROUND > 5
Reply With Quote #2

or if currenttimeRound < 10
__________________
cam0 & lingzhidiyu - The best users
maciasbarlinek is offline
shortguy
Member
Join Date: Jul 2009
Old 08-01-2015 , 21:22   Re: How can i disallow comand if mp_roundtime - currenttimeROUND > 5
Reply With Quote #3

Since I can't really find a game property to track current round time, you can use this snippet I created here:

https://gist.github.com/roflmuffin/bed001ee2d12cb49deff

It's in transitional syntax but it should be easy to understand. When the round starts we keep track of the time in a global variable, and when we want to know the time we just query the current time - when the round started.

I've put them in functions and included the example command for you. Just change 5 to however many seconds.
shortguy is offline
maciasbarlinek
Senior Member
Join Date: May 2015
Old 08-02-2015 , 06:45   Re: How can i disallow comand if mp_roundtime - currenttimeROUND > 5
Reply With Quote #4

nice!
It works ;)))

Thank you very much!
__________________
cam0 & lingzhidiyu - The best users
maciasbarlinek 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 00:20.


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