31.01.2017, 11:55
This is my codes
The codes:
In Server after time its not showing any thing i use Mysql R41-2 what's the problem?
PHP код:
//OnGameModeInIt
SetTimer("RandBotMsgs", 8000, 1);
PHP код:
new bmsgTDswitch;
function RandBotMsgs()
{
bmsgTDswitch ++;
switch(bmsgTDswitch)
{
case 1: Topscore();
}
bmsgTDswitch = 0;
return true;
}
function Topscore()
{
new query[1303];
format(query, sizeof(query), "SELECT Username,Score FROM players WHERE ID ORDER BY Score DESC LIMIT 1;");
mysql_tquery(mysql , "ShowBestScore", "", "");
return true;
}
new g_SQL_handle = 1;
#define MySQL_getInt(%0,%1) cache_get_value_index_int(%0,%1,g_SQL_handle)
function ShowBestScore()
{
new rows;
cache_get_row_count(rows);
if(rows)
{
new playername[35];
new playerscore;
new str[1303];
cache_get_value_index(0, 0, playername);
playerscore = MySQL_getInt(0, 1);
format(str, sizeof(str), "Player with the most score is %s with %d score!", playername, playerscore);
SendClientMessageToAll(0xFF0000FF,str);
}
return 1;
}