Mysql bug
#10

PHP код:
 Topscore()
{
    
mysql_tquery(mysql ,"SELECT Username,Score FROM players WHERE ID ORDER BY Score DESC LIMIT 1;""ShowBestScore","");
    return 
true;
}
forward ShowBestScore();
public 
ShowBestScore()
{
      new 
rows;
    
cache_get_row_count(rows);
    if(
rows)
    {
        new 
playername[35];
        new 
playerscore;
        new 
str[1303];
        
        
cache_get_value_index(00playername);
        
cache_get_value_name_int(0,"Score",playerscore);
        
cache_get_value_index_int(0,1playerscore);

        
format(strsizeof(str), "~b~~h~N~b~~h~e~b~~h~~h~w~b~~h~~h~s~w~: Player with the most score is~y~~h~ %s~w~ have (~r~%d~r~~h~ score~w~)~n~~n~"playernameplayerscore);
        
TextDrawSetString(Textdraw7,str);
        
TextDrawShowForAll(Textdraw7);
    }
    return 
1;
}
stock Topcash()
{
    
mysql_tquery(mysql ,"SELECT Username,Money FROM players WHERE ID ORDER BY Money DESC LIMIT 1;""ShowBestCash","");
    return 
true;
}
forward ShowBestCash();
public 
ShowBestCash()
{
      new 
rows;
    
cache_get_row_count(rows);
    if(
rows)
    {
        new 
playername[35];
        new 
playermoney;
        new 
str[1303];

        
cache_get_value_index(00playername);
        
cache_get_value_name_int(0,"Money",playermoney);
        
cache_get_value_index_int(0,1playermoney);

        
format(strsizeof(str), "~b~~h~N~b~~h~e~b~~h~~h~w~b~~h~~h~s~w~:~y~~h~%s~w~ Is the reachest player (~r~%d~r~~h~ cash~w~)~n~~n~"playernameplayermoney);
        
TextDrawSetString(Textdraw7,str);
        
TextDrawShowForAll(Textdraw7);
    }
    return 
1;

Not getting the higher score or the reachest one it only get the last one who registered
Reply


Messages In This Thread
Mysql bug - by Loinal - 10.02.2017, 22:05
Re: Mysql bug - by kloning1 - 10.02.2017, 22:14
Re: Mysql bug - by Vince - 10.02.2017, 23:30
Re: Mysql bug - by Loinal - 11.02.2017, 09:03
Re: Mysql bug - by Loinal - 11.02.2017, 11:06
Re: Mysql bug - by Loinal - 11.02.2017, 17:54
Re: Mysql bug - by Macronix - 11.02.2017, 22:01
Re: Mysql bug - by Loinal - 12.02.2017, 18:29
Re: Mysql bug - by Macronix - 12.02.2017, 18:38
Re: Mysql bug - by Loinal - 16.02.2017, 09:02

Forum Jump:


Users browsing this thread: 1 Guest(s)