/***************************************************************************/ /* Daylight Change */ /* by Downtown1 */ /***************************************************************************/ /* This plugin will read change lighting of the map according to the time */ /* on the server. . */ /* */ /* Come to 66.150.107.11 if you wish to see it in action first. */ /* */ /* Merely checks the time now, in future would be nice if it could somehow */ /* check a website to to check how high up the sun is and whether or not */ /* its blocked by clouds. */ /* */ /* ========================= Version History =================================== *** 1.0 - first version of plugin - changes lighting of map according to the time of the server */ #include #include #include public updatelights() { new szHours[2] new iHours new szLights[2] = "m" get_time("%H", szHours, 2) iHours = strtonum(szHours) switch(iHours) { case 1:szLights = "c" case 2:szLights = "d" case 3:szLights = "e" case 4:szLights = "g" case 5:szLights = "i" case 6:szLights = "k" case 7:szLights = "m" case 8:szLights = "o" case 9:szLights = "q" case 10:szLights = "s" case 11:szLights = "u" case 12:szLights = "w" case 13:szLights = "u" case 14:szLights = "s" case 15:szLights = "q" case 16:szLights = "o" case 17:szLights = "m" case 18:szLights = "k" case 19:szLights = "i" case 20:szLights = "g" case 21:szLights = "e" case 22:szLights = "d" case 23:szLights = "c" case 24:szLights = "b" default:szLights = "m" } SetLights(szLights) return PLUGIN_CONTINUE } public plugin_init() { register_plugin("Daylight Change","1.0","Downtown1") set_task(60.0, "updatelights", 0, "", 0, "b") return PLUGIN_CONTINUE }