Someone requested an advert system that is stand-alone from ULX, so I decided to make GAS.
GAS is a stand-alone advert system designed for server owners. It allows for messages/adverts to be periodically displayed on the clients screen and temporary messages/adverts to be displayed once, each advert can be displayed for any length of time.
Adverts are queued while other adverts are currently being displayed, so that they don’t overlap or cancel.
Usage is simple:
AdvertSystem.TemporaryAdvert( message, length, type, [color], [ply] )
creates a new temporary advert of type type that will be displayed only once for length amount of seconds on ply’s screen, the color parameter and the ply parameter are optional (If nil, color will default to white and ply will default to all players.
AdvertSystem.NewAdvert( uniqueID, message, length, delay, type, [color], [ply] )
creates a periodic advert or type type with unique ID uniqueID, which will be displayed every delay seconds for length amount of seconds on ply’s screen, again, the color and ply parameters are optional (same behaviour as above).
AdvertSystem.DeleteAdvert( uID )
will delete the advert with unique ID uID, any adverts with this uniqueID that are queued will still display.
[lua]AdvertSystem.NewAdvert( “message1”, “This is shown every 20 seconds for 10 seconds”, 20, 10, GAS_MESSAGE)[/lua]
[lua]AdvertSystem.NewAdvert( “message1”, “This is a warning”, 20, 10, GAS_WARNING )[/lua]
[lua]AdvertSystem.NewAdvert( “message1”, “Welcome to my server :)”, 20, 10, GAS_INFORMATION)[/lua]
Note: The “[AdvertSystem]” prefix can be changed in “lua/autorun/ad_init.lua” and disabled using convar advert_prefix_enabled 0/1.
Adverts can be disabled by the server owner using “adverts_enabled 0” in the console and re-enabled with “adverts_enabled 1”.