SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 02/12/2015, 05:02 PM   #1
Lenon
Little Clucker
 
Lenon's Avatar
 
Join Date: Feb 2014
Posts: 28
Reputation: 3
Default gettime() help

Why I can't store gettime? I make it like this:

Code:
PlayerInfo[id][pTime] = gettime();
Lenon is offline   Reply With Quote
Old 02/12/2015, 05:13 PM   #2
AbyssMorgan
Banned
 
Join Date: Apr 2015
Location: Poland
Posts: 1,209
Reputation: 352
Default Re: gettime() help

Wtf
PHP Code:
native gettime(&hour,&minute,&second); 
AbyssMorgan is offline   Reply With Quote
Old 02/12/2015, 05:29 PM   #3
Vince
Spam Machine
 
Vince's Avatar
 
Join Date: Sep 2007
Location: Belgium
Posts: 10,068
Reputation: 2658
Default Re: gettime() help

Quote:
Originally Posted by AbyssMorgan View Post
Wtf
PHP Code:
native gettime(&hour,&minute,&second); 
If you took the time to look up the wiki page, you should've also noted that:
Quote:
Return Values:
The function itself returns a Unix Timestamp, however if arguments are specified then the hours, minutes and seconds for the current time are returned.
OP's code is perfectly valid syntax, assuming that pTime is an integer.
__________________
Vince is offline   Reply With Quote
Old 03/12/2015, 10:12 AM   #4
Lenon
Little Clucker
 
Lenon's Avatar
 
Join Date: Feb 2014
Posts: 28
Reputation: 3
Default Re: gettime() help

Here is saving and loading using YINI

enum pTime

load
Code:
INI_Int("Time",PlayerInfo[playerid][pTime]);
save
Code:
INI_WriteInt(File,"Time",PlayerInfo[playerid][pTime]);
and still can't save it, value in .ini file is 0
Lenon is offline   Reply With Quote
Old 03/12/2015, 03:02 PM   #5
Lenon
Little Clucker
 
Lenon's Avatar
 
Join Date: Feb 2014
Posts: 28
Reputation: 3
Default Re: gettime() help

bump
Lenon is offline   Reply With Quote
Old 03/12/2015, 05:18 PM   #6
TwinkiDaBoss
Gangsta
 
Join Date: Jul 2014
Posts: 798
Reputation: 51
Default Re: gettime() help

Whats ID supposted to represent?
pawn Code:
PlayerInfo[id][pTime] = gettime(); //ID? other player? inside a command?
TwinkiDaBoss is offline   Reply With Quote
Old 03/12/2015, 08:53 PM   #7
Lenon
Little Clucker
 
Lenon's Avatar
 
Join Date: Feb 2014
Posts: 28
Reputation: 3
Default Re: gettime() help

Yes. Solved, was an issue with y_ini.inc
Lenon 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Gettime Carxi Scripting Help 4 28/03/2014 10:58 AM
GetTime feartonyb Scripting Help 6 17/11/2013 09:45 AM
[Ajuda] Gettime Ban .ThePro Português/Portuguese 3 20/05/2013 08:28 PM
[Ajuda] GetTime s4kuL Português/Portuguese 1 30/08/2012 02:43 AM
gettime bug? SomebodyAndMe Scripting Help 14 28/05/2012 07:10 PM


All times are GMT. The time now is 03:15 AM.


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