SA-MP Forums Archive
Characters problem. - 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: Characters problem. (/showthread.php?tid=587418)



Characters problem. - norton2 - 30.08.2015

Код HTML:
printf("Last Login to Safe: %s", Safes[hid][SafeLastLog]);
.Log:
Код HTML:
 [11:52:36] Last Login to Safe: 2##..*
I look strange characters, you would normally need to show me: 8/31/2015 11:48:29.


Re: Characters problem. - SpikY_ - 30.08.2015

Код:
printf("Last Login to Safe: %d", Safes[hid][SafeLastLog]);
Try like this?


Re: Characters problem. - Sjn - 30.08.2015

Make sure "Safes[hid][SafeLastLog]" variable is a string with specified length, also the timestamp field to hold the log time in your table needs to be varchar.


Re: Characters problem. - norton2 - 30.08.2015

Quote:
Originally Posted by SpikY_
Посмотреть сообщение
Код:
printf("Last Login to Safe: %d", Safes[hid][SafeLastLog]);
Try like this?
Код HTML:
Last Login to Safe: 50
Quote:
Originally Posted by Sjn
Посмотреть сообщение
Make sure "Safes[hid][SafeLastLog]" variable is a string with specified length, also the timestamp field to hold the log time in your table needs to be varchar.
I checked and everything is ok.


Re: Characters problem. - Sjn - 30.08.2015

Show the code where you fetch the string into your var.


Re: Characters problem. - norton2 - 30.08.2015

Код HTML:
orm_addvar_string(ormid, Safes[r][SafeLastLog], 64, "SafeLastLog");



Re: Characters problem. - norton2 - 30.08.2015

Anyone?


Re: Characters problem. - SpikY_ - 30.08.2015

have a look on this wiki example :

Код:
new hour, minute, second, string[32];
gettime(hour, minute, second);
 
format(string, sizeof(string), "The time is %02d:%02d:%02d.", hour, minute, second); // will output something like 09:45:02
SendClientMessage(playerid, -1, string);



Re: Characters problem. - norton2 - 30.08.2015

Not work.