Save time game in MySQL
#8

Connect
pawn Код:
SetPVarInt(playerid, "GraszDzis", gettime());
Disconnect
pawn Код:
new str[128];
format(str,sizeof str,"UPDATE `Gracze` SET `Czas_gry_ogol` = `Czas_gry_ogol` + %d WHERE `Nick` = '%s'", (gettime()-GetPVarInt(playerid, "GraszDzis")), PlayerName(playerid));
mysql_query(str);
replace
pawn Код:
`Czas_gry_ogol` TIME NOT NULL COMMENT  'Łączny czas gry w ogуle',
to

pawn Код:
`Czas_gry_ogol` INT(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Łączny czas gry w ogуle',
then if you want to see how many hours you play use

http://www.w3resource.com/mysql/date...e-function.php

or some samp function to converting seconds
Reply


Messages In This Thread
Save time game in MySQL - by Kerth - 02.11.2013, 14:48
Re: Save time game in MySQL - by Jefff - 02.11.2013, 15:02
Re: Save time game in MySQL - by Kerth - 02.11.2013, 15:17
Re: Save time game in MySQL - by Jefff - 02.11.2013, 18:50
Re: Save time game in MySQL - by Kerth - 02.11.2013, 21:03
Re: Save time game in MySQL - by rappy93 - 02.11.2013, 21:16
Re: Save time game in MySQL - by Kerth - 02.11.2013, 21:28
Re: Save time game in MySQL - by Jefff - 02.11.2013, 21:32
Re: Save time game in MySQL - by Kerth - 02.11.2013, 21:51
Re: Save time game in MySQL - by rappy93 - 02.11.2013, 21:55

Forum Jump:


Users browsing this thread: 2 Guest(s)