Jump to content

[Help] outputChatBox New maps added in the server.


Recommended Posts

Dear guys,

I would like to create an script which drop a message about the new maps which have been added in 24 hours to the server.

-What is the main point of this topic ?

I would like to get the functions that i should/must use to do it.

I hope you can help me, thanks for your time.

Regards.

Link to comment

I'm not sure that theres a function for this.

However, is what you can do is create a table with all the server maps on, with the time that they were added.

Something like this:

local maps = { 
  
    { 
        name = 'Map 1', 
        month = 6, 
        day = 1, 
        year = 2015 
    }, 
    { 
        name = 'Map 2', 
        month = 5, 
        day = 10, 
        year = 2015 
    }, 
    { 
        name = 'Map 3', 
        month = 9, 
        day = 21, 
        year = 2016 
    }, 
    { 
        name = 'Map 4', 
        month = 6, 
        day = 1, 
        year = 2014 
    }, 
} 
  
  
  
function outputRecentMaps ( ) 
  
    local t = getRealTime ( ); 
    for _, i in ipairs ( maps ) do  
        if ( t.year+1900 == i.year  
        and t.month+1 == i.month  
        and t.monthday == i.day ) then  
             
            outputChatBOx ( tostring ( i.name ) ); 
             
        end  
    end 
end  
  
outputRecentMaps ( ) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...