Not showing
#1

This is my codes

PHP код:
//OnGameModeInIt
SetTimer("RandBotMsgs"80001); 
The codes:

PHP код:
new bmsgTDswitch;
function 
RandBotMsgs()
{
    
bmsgTDswitch ++;
    switch(
bmsgTDswitch)
    {
        case 
1Topscore();
      }
      
bmsgTDswitch 0;
    return 
true;
}
function 
Topscore()
{
    new 
query[1303];
    
format(querysizeof(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(00playername);
        
playerscore MySQL_getInt(01);
        
format(strsizeof(str), "Player with the most score is %s with %d score!"playernameplayerscore);
        
SendClientMessageToAll(0xFF0000FF,str);
    }
    return 
1;

In Server after time its not showing any thing i use Mysql R41-2 what's the problem?
Reply
#2

check if variable playerscore obtain data from database, debug printf in your console
Reply
#3

I don't mean this i mean when i connect to server there is no text to show
Reply
#4

It doesn't show also it doesn't work in onther mysql server
Reply
#5

You didn't pass query varaible but just an empty string...(also that much size is also needed for that variable)

Also the variable bmsgTDswitch will have 1 as value on each call because you resetting it to 0.
Reply
#6

Quote:
Originally Posted by Sreyas
Посмотреть сообщение
You didn't pass query varaible but just an empty string...(also that much size is also needed for that variable)

Also the variable bmsgTDswitch will have 1 as value on each call because you resetting it to 0.
I didn't understand can you please explain me in codes with red mark?
Reply
#7

Quote:
Originally Posted by Sreyas
Посмотреть сообщение
You didn't pass query varaible but just an empty string...(also that much size is also needed for that variable)

Also the variable bmsgTDswitch will have 1 as value on each call because you resetting it to 0.
it compile fine but not working in server
Reply
#8

Something sorry for doubt

it seems like its not R41-2 but it compile fine so i don't know whats the problem
Reply
#9

Guys need help
Reply
#10

Maybe this. this is what i have in my script.

PHP код:
    SetTimer("ShowARandomMessage"RANDOM_MESSAGETIMEINMINUTES*60000true); 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)