cloud-dev

RTV Timer

Mar 2nd, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.49 KB | None | 0 0
  1. modules/sv_rtv.lua
  2. ---------------------------------------VARIABLES(Place in the second variable set)---------------------------------------------------
  3. RTV.VoteTime = 5 * 60 --5 is the amount of time in minutes until RTV can be used
  4. RTV.VotePossibleTime = RTV.MapInit + RTV.VoteTime --This will calculate when the vote can be used based on RTV.MapInit plus the RTV.VoteTime value
  5.  
  6. -------------------------------------------FUNCTION------------------------------------------------------------------------------------
  7. --Replace the first line of the RTV:Vote function with this whole bit here--
  8.     if CurTime() <= ( RTV.VotePossibleTime ) then --Checks if the current time is less than or equal to the RTV set time
  9.         local t,s = math.Round( ( RTV.VotePossibleTime - CurTime() ) / 60 ), "minutes" --Rounding values to display minutes left in chat
  10.         if t < 1 then t,s = math.Round( RTV.VotePossibleTime - CurTime() ), "seconds" end --If under a minute, this finds the seconds
  11.         if t == 1 then s = "second" end --Because I had a problem with the chat saying '1 seconds' instead of '1 second'
  12.         return Core:Send( ply, "Print", { "Notification", Lang:Get( "VoteNotPossible", { t .. " " .. s } ) } ) --Display RTV notification
  13.     elseif ply.RTVLimit and CurTime() - ply.RTVLimit < 60 then
  14.  
  15.  
  16. core_lang.lua
  17. --------------------------------------------NOTIFICATION--------------------------------------------------------------------------------
  18. Lang.VoteNotPossible = "Voting is not possible in this period (Please wait 1;)"
Advertisement
Add Comment
Please, Sign In to add comment