SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 23/06/2011, 06:39 AM   #1
Fro1sha
Big Clucker
 
Fro1sha's Avatar
 
Join Date: Nov 2009
Posts: 168
Reputation: 32
Default GMT Timezone

Description:

This is Timezone plugin. You can set any timezone for your SA:MP server. And some useful function.
Small example.
How to use:
pawn Code:
// Auto replacement default pawn time function
#define AUTO_SETUP
#include <gmtime>

Natives:
pawn Code:
native gm_SetTimeZone(hour = 0, minute = 0);
native gm_gettime(&hour = 0, &minute = 0, &second = 0);
native gm_getdate(&year=0, &month = 0, &day = 0, &wday = 0);

native gm_strftime(const string[], dest[], size = sizeof(dest));
native gm_timestamp();
native gm_mktime(hour, minute, second, year, month, day);
native gm_timestamp_to_date(timestamp, &hour = 0, &minute = 0, &second = 0, &year = 0, &month = 0, &day = 0);

native gm_GetMonthDay(month, year = 1990);
native gm_ConvertSeconds(time, &hour = 0, &minute = 0, &second = 0, &year = 0, &month = 0, &day = 0);

Download:

Last edited by Fro1sha; 24/06/2011 at 07:38 AM.
Fro1sha is offline   Reply With Quote
Old 23/06/2011, 07:21 AM   #2
Fro1sha
Big Clucker
 
Fro1sha's Avatar
 
Join Date: Nov 2009
Posts: 168
Reputation: 32
Default Re: GMT Timezone

Set Timezone for mysql:
pawn Code:
stock MySQLSetTimeZone(MySQL:handle, hour = 0, minute = 0)
{
    new
        string  [ 64 ]
    ;
               
    if ( hour >= 0 ) format(string, sizeof string, "SET time_zone = '+%02d:%02d'", hour, minute);
    else format(string, sizeof string, "SET time_zone = '%02d:%02d'", hour, minute);
    mysql_query(string, -1, _, handle);
}
__________________
[Plugin] MultiThread
[Plugin] GMT Timezone
[Plugin] Regular expression

Development any plugins, for the money.
Разработка любых плагинов за деньги.
Fro1sha is offline   Reply With Quote
Old 23/06/2011, 07:30 AM   #3
Lorenc_
High-roller
 
Lorenc_'s Avatar
 
Join Date: Jan 2010
Location: Australia
Posts: 4,262
Reputation: 1137
Default Re: GMT Timezone

This is what i need, really useful for setting up clan wars :3 Nice job!
__________________
Join the best Cops And Robbers in SA-MP, today. svr.sfcnr.com:7777

Lorenc_ is online now   Reply With Quote
Old 23/06/2011, 08:07 AM   #4
HyperZ
High-roller
 
HyperZ's Avatar
 
Join Date: Aug 2009
Posts: 1,382
Reputation: 66
Default Re: GMT Timezone

Great job.
__________________
HyperZ is offline   Reply With Quote
Old 23/06/2011, 09:20 AM   #5
SpiderWalk
High-roller
 
SpiderWalk's Avatar
 
Join Date: Apr 2010
Location: Serbia
Posts: 1,104
Reputation: 26
Default Re: GMT Timezone

hmm i will test it but looks good
SpiderWalk is offline   Reply With Quote
Old 24/06/2011, 07:31 AM   #6
Fro1sha
Big Clucker
 
Fro1sha's Avatar
 
Join Date: Nov 2009
Posts: 168
Reputation: 32
Default Re: GMT Timezone

This is small example =)
__________________
[Plugin] MultiThread
[Plugin] GMT Timezone
[Plugin] Regular expression

Development any plugins, for the money.
Разработка любых плагинов за деньги.
Fro1sha is offline   Reply With Quote
Old 24/06/2011, 07:33 AM   #7
Skaizo
Gangsta
 
Skaizo's Avatar
 
Join Date: Sep 2010
Location: Romanian
Posts: 851
Reputation: 15
Default Re: GMT Timezone

Quote:
Originally Posted by Fro1sha View Post
This is small example =)
it is Russian and I do not understand
__________________
My works(Romanian)
Thanks To Jansish For Signature
[Tutorial]rezolvarea eroare pawno failed to set data for si File or function is not found
I am Russian?
No
You are Russian army fuck?
Yes but no Fuck
Lol )
Skaizo is offline   Reply With Quote
Old 24/06/2011, 07:39 AM   #8
Fro1sha
Big Clucker
 
Fro1sha's Avatar
 
Join Date: Nov 2009
Posts: 168
Reputation: 32
Default Re: GMT Timezone

Quote:
Originally Posted by Skaizo View Post
it is Russian and I do not understand
Ok in English http://pastebin.com/Aj3FUHAe
__________________
[Plugin] MultiThread
[Plugin] GMT Timezone
[Plugin] Regular expression

Development any plugins, for the money.
Разработка любых плагинов за деньги.
Fro1sha is offline   Reply With Quote
Old 24/06/2011, 05:28 PM   #9
GangsTa_
High-roller
 
GangsTa_'s Avatar
 
Join Date: May 2010
Location: Republic of Moldova
Posts: 1,125
Reputation: 51
Default Re: GMT Timezone

Russkie delayut vol6ebstvo

Nice work dude, looks pretty damn good to me.
__________________
i5-5200U @ 2.6 GHz
GTX 950M 2GB GDDR3 128-bit
8,00GB DDR3 RAM
128GB SSD, 1TB 5400RPM HDD
Windows 10 Pro x64
GangsTa_ is offline   Reply With Quote
Old 24/06/2011, 05:47 PM   #10
Fro1sha
Big Clucker
 
Fro1sha's Avatar
 
Join Date: Nov 2009
Posts: 168
Reputation: 32
Default Re: GMT Timezone

Quote:
Originally Posted by GangsTa_ View Post
Russkie delayut vol6ebstvo

Nice work dude, looks pretty damn good to me.
Thanks man
__________________
[Plugin] MultiThread
[Plugin] GMT Timezone
[Plugin] Regular expression

Development any plugins, for the money.
Разработка любых плагинов за деньги.
Fro1sha is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 01:06 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.