PDA

View Full Version : X is the richest player


PowerF
06/05/2016, 04:10 AM
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."

KevinReinke
06/05/2016, 05:06 AM
With a SQL statement.

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

Get the result and send a message.

PowerF
06/05/2016, 08:56 AM
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);

CalvinC
06/05/2016, 08:59 AM
%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)

PowerF
06/05/2016, 09:05 AM
It's using FormatNumber,I missed that,because it's just an example.
and yes,i still confuse.

PowerF
06/05/2016, 09:33 AM
bump

Luis-
06/05/2016, 09:34 AM
Can't really do much without any codes and the error message(s).

PowerF
06/05/2016, 09:39 AM
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.
`name`, `money` FROM `accounts` ORDER BY `money` DESC LIMIT 1
SendClientMessageToAll(playerid, COLOR_WHITE "%s is the most richest player with $%d on bank account." name, money);

biker122
06/05/2016, 09:54 AM
Which version of MySQL are you using?

PowerF
06/05/2016, 10:47 AM
2.1.1