SA-MP Forums Archive
Not showing - 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: Not showing (/showthread.php?tid=627699)



Not showing - Loinal - 31.01.2017

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?


Respuesta: Not showing - Eloy - 31.01.2017

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


Re: Not showing - Loinal - 31.01.2017

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


Re: Not showing - Loinal - 31.01.2017

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


Re: Not showing - SyS - 31.01.2017

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.


Re: Not showing - Loinal - 31.01.2017

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?


Re: Not showing - Loinal - 31.01.2017

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


Re: Not showing - Loinal - 31.01.2017

Something sorry for doubt

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


Re: Not showing - Loinal - 31.01.2017

Guys need help


Re: Not showing - tomacraft2011 - 31.01.2017

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

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