gettime() crashes the server
#1

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?
Reply
#2

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

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

@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.
Reply
#5

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

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.
Reply
#7

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

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
Reply
#9

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)