I havent really used timers before. But id like to set up something like when someone says '!uprising'
it brings up a HUD (i will make) that has a 15 minute countdown for the uprising then ends for the next command
i dont wanna be spoonfed. Would just like knowledge.
Example chat-commands: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/chat_commands/chat_commands.lua.html[/url]
then, just make a console command to handle the functionality, and the timer...
[code]concommand.Add( "uprising", function( _p, _cmd, _args )
if ( !_p || !IsValid( _p ) ) then return; end
if ( !_p.__UprisingTimer || CurTime( ) - _p.__UprisingTimer > ( 60 * 15 ) ) then
_p.__UprisingTimer = CurTime( );
// Run your vgui stuff:
-- ...
else
// Delay
_p:PrintMessage( HUD_PRINTTALK, "You have " .. ( CurTime( ) - _p.__UprisingTimer ) .. " seconds left!" );
end
end );[/code]
Sorry, you need to Log In to post a reply to this thread.