Getting kicked players - 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: Getting kicked players (
/showthread.php?tid=635182)
Re: Getting kicked players -
Jefff - 04.06.2017
pawn Code:
// save
format(query,sizeof(query),"UPDATE `serverinfo` SET `Total_Kicked` = %d", ++totalkicked);
mysql_tquery(mysql,query);
// load
new Cache:result = mysql_query(mysql, "SELECT `Total_Kicked` FROM `serverinfo`");
new tk = cache_get_row_int(0, 0, mysql);
cache_delete(result, mysql);
format(string,sizeof(string),"%s\nTotal kicked players: %d", string, tk);
Re: Getting kicked players -
Loinal - 05.06.2017
Quote:
Originally Posted by Jefff
pawn Code:
// save format(query,sizeof(query),"UPDATE `serverinfo` SET `Total_Kicked` = %d", ++totalkicked); mysql_tquery(mysql,query);
// load new Cache:result = mysql_query(mysql, "SELECT `Total_Kicked` FROM `serverinfo`"); new tk = cache_get_row_int(0, 0, mysql); cache_delete(result, mysql); format(string,sizeof(string),"%s\nTotal kicked players: %d", string, tk);
|
ok same
my database
Re: Getting kicked players -
Jefff - 05.06.2017
total kicked and banned must be with _ not space
pawn Code:
CREATE TABLE `serverinfo` (
`Total_Kicked` int(11) NOT NULL,
`Total_Banned` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Re: Getting kicked players -
Loinal - 05.06.2017
Quote:
Originally Posted by Jefff
total kicked and banned must be with _ not space
pawn Code:
CREATE TABLE `serverinfo` ( `Total_Kicked` int(11) NOT NULL, `Total_Banned` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
same
Re: Getting kicked players -
Jefff - 05.06.2017
pawn Code:
CREATE TABLE `serverinfo` (`Total_Kicked` INT(11) UNSIGNED NOT NULL, `Total_Banned` INT(11) UNSIGNED NOT NULL);
INSERT INTO `serverinfo` ( `Total_Kicked` , `Total_Banned` ) VALUES ( 0, 0 );
// save
pawn Code:
mysql_tquery(mysql,"UPDATE `serverinfo` SET `Total_Kicked` = `Total_Kicked` + 1");
load in previous post
see also
https://dev.mysql.com/doc/refman/5.7...duplicate.html
Re: Getting kicked players -
Loinal - 06.06.2017
Quote:
Originally Posted by Jefff
pawn Code:
CREATE TABLE `serverinfo` (`Total_Kicked` INT(11) UNSIGNED NOT NULL, `Total_Banned` INT(11) UNSIGNED NOT NULL); INSERT INTO `serverinfo` ( `Total_Kicked` , `Total_Banned` ) VALUES ( 0, 0 );
// save
pawn Code:
mysql_tquery(mysql,"UPDATE `serverinfo` SET `Total_Kicked` = `Total_Kicked` + 1");
load in previous post
see also
https://dev.mysql.com/doc/refman/5.7...duplicate.html
|
Thanks , also my own codes was good but i didn't insert