AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Execute CVAR with 1min timeleft (https://forums.alliedmods.net/showthread.php?t=184763)

csjesse 05-08-2012 18:00

Execute CVAR with 1min timeleft
 
Trying to write a very simple plugin

When the timeleft=1, OR when a round ends, I would like a certain cvar (sm_psay perhaps) to run.


I imagine this should be no more than 3-4 lines...

Any help is appreciated! :)

berni 05-08-2012 18:34

Re: Execute CVAR with 1min timeleft
 
I think it will be a bit more than 3-4 lines.

You have to setup a timer OnMapStart for mp_timeleft * 60.0.
Then you also have to react on when the cvar mp_timeleft changes.
You can use the forward OnMapTimeLeftChanged. Kill the timer and start it with the new value.

sm_psay is a command afaik, not a cvar. It's a bad thing to call commands from plugins. I think you can use PrintToChat() instead.


All times are GMT -4. The time now is 00:24.

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