16.01.2012, 19:56
(
Last edited by [FAT]Klabauter[LST]; 18/01/2012 at 11:52 PM.
)
Very simple... because i dunno how to do anything hard yet lol. This script will set each players game time to match their REAL time. All you have to do is change the servergmt value to the GMT of your server. I intentionally did it OnPlayerSpawn because in my TDM server players spawn constantly so I did not need to use a timer. If you want, you can put it on a timer yourself quite easily.
I tested, and am using this script on my server. No video since it would be pointless.
Requirements
-GeoIP plugin
-GeoIP include
Updates
- Fixed problem with sums that are less than zero or greater than 23
I tested, and am using this script on my server. No video since it would be pointless.
Requirements
-GeoIP plugin
-GeoIP include
Code:
// Player Time Zone by Klabauter_Mann // Please do not remove the credits or claim this script as your own // You must have GeoIP plugin to use this script // You must have GeoIP include to compile this script #include <a_samp> #include GeoIP_Plugin #define servergmt 0 // Set the GMT of your server, example: if your server is in New York City change 0 to -5 public OnFilterScriptInit() { print("\n-------------------------------------------------"); print(" Player Time Zone by Klabauter_Mann"); print("-------------------------------------------------\n"); return true; } public OnPlayerConnect(playerid) { SendClientMessage(playerid, 0xC071FFFF, "This server is using Player Time Zone"); SendClientMessage(playerid, 0xC071FFFF, "Made by Klabauter_Mann"); return true; } public OnPlayerSpawn(playerid) { new Hour, Minute, Second; gettime(Hour, Minute, Second); new gmt = GetPlayerGMT(playerid); new sum = Hour + gmt - servergmt; if(sum >= 24 && sum < 48) { SetPlayerTime(playerid, sum - 24, Minute); } if(sum >= 48) { SetPlayerTime(playerid, sum - 48, Minute); } if(sum < 0) { SetPlayerTime(playerid, sum + 24, Minute); } if(sum >= 0 && sum < 24) { SetPlayerTime(playerid, sum, Minute); } return true; }
- Fixed problem with sums that are less than zero or greater than 23