SA-MP Forums Archive
gettime() crashes the server - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: gettime() crashes the server (/showthread.php?tid=489024)



gettime() crashes the server - xFuTuRe - 20.01.2014

Hello,

In my temporary ban function this small line seems to crash the server:

pawn Код:
unban_date = tb_days * 86400 + gettime();
The unban_date along other ban information gets queried to the mysql database using cache, however, when the callback is supposed to be called, it crashes the server.

Does anyone here have a clue why this happens?


Re: gettime() crashes the server - Eth - 20.01.2014

pawn Код:
new Hour, Minute, Second;
unban_date = tb_days * 86400 + gettime(Hour, Minute, Second);
there is nothing called gettime();


Re: gettime() crashes the server - iJumbo - 20.01.2014

Are you looking for this ? https://sampforum.blast.hk/showthread.php?tid=254915


Re: gettime() crashes the server - xFuTuRe - 20.01.2014

@Eth; The gettime(); returns only seconds without using variables to save other values in, this case hours, minutes, seconds.

@iJumbo; I do know how unix timestamps work, if you would of read my post entirely you could of seen I have a problem that crashes the server regarding this function.


Re: gettime() crashes the server - iJumbo - 20.01.2014

Are you sure that is the line of your error?
also try
pawn Код:
unban_date = (86400 + gettime()) * tb_days;



Re: gettime() crashes the server - xFuTuRe - 21.01.2014

Quote:
Originally Posted by iJumbo
Посмотреть сообщение
Are you sure that is the line of your error?
also try
pawn Код:
unban_date = (86400 + gettime()) * tb_days;
That would mean when a player gets a 2 day ban right at this moment; he will be banned for (86400 + 1390299819) = 1390386219 * 2, which is 2780772438, converting this to a date would mean a 2 day ban will result in an unban at Tue, 12 Feb 2058 20:47:18 GMT.


Re: gettime() crashes the server - Djole1337 - 21.01.2014

Quote:
Originally Posted by xFuTuRe
Посмотреть сообщение
Hello,
pawn Код:
unban_date = tb_days * 86400 + gettime();
That's not the issue.


Re: gettime() crashes the server - iJumbo - 21.01.2014

Quote:
Originally Posted by xFuTuRe
Посмотреть сообщение
That would mean when a player gets a 2 day ban right at this moment; he will be banned for (86400 + 1390299819) = 1390386219 * 2, which is 2780772438, converting this to a date would mean a 2 day ban will result in an unban at Tue, 12 Feb 2058 20:47:18 GMT.
Sorry i inverded something lol.. but that is not the issue try with crashdetect


Re: gettime() crashes the server - DobbysGamertag - 21.01.2014

use http://pastebin.ca/2064736

I do it, rather easy actually. If you're doing it right that is.

it becomes
pawn Код:
printf("%s days left",timec(tb_days)); //your variable used here
It returns a string. But if it isn't, CrashDetect is always (sometimes) the answer :P