X is the richest player
#1

how do i make a message that showing to all players,like
i'm using MySQL.

"X is the richest player with $2,000,000 money."
Reply
#2

With a SQL statement.

Quote:

SELECT `name`, `money` FROM `accounts` ORDER BY `money` DESC LIMIT 1

Get the result and send a message.
Reply
#3

Yes i know,but i confuse that what is the %s.
it will show an error if you do:
"%s is the most richest player with %s money on bank account", playerName, BankMoney);
Reply
#4

%s is for a string, which consists of characters (letters, numbers etc.)
Use %i for displaying the amount of money, which is for an integer (numbers)
Reply
#5

It's using FormatNumber,I missed that,because it's just an example.
and yes,i still confuse.
Reply
#6

bump
Reply
#7

Can't really do much without any codes and the error message(s).
Reply
#8

What code?
I think y'all doesn't need a code because I just want an example for showing a message to all players like:

"X is the most richest players with $ABCD on bank account"

as i said above,i confused with the playername and how much the money on his bank account.
i cannot do this.
PHP код:
`name`, `moneyFROM `accountsORDER BY `moneyDESC LIMIT 1 
 SendClientMessageToAll
(playeridCOLOR_WHITE "%s is the most richest player with $%d on bank account." namemoney); 
Reply
#9

Which version of MySQL are you using?
Reply
#10

2.1.1
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)