SA-MP Forums Archive
X is the richest player - 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: X is the richest player (/showthread.php?tid=606561)



X is the richest player - PowerF - 06.05.2016

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."


Re: X is the richest player - KevinReinke - 06.05.2016

With a SQL statement.

Quote:

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

Get the result and send a message.


Re: X is the richest player - PowerF - 06.05.2016

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);


Re: X is the richest player - CalvinC - 06.05.2016

%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)


Re: X is the richest player - PowerF - 06.05.2016

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


Re: X is the richest player - PowerF - 06.05.2016

bump


Re: X is the richest player - Luis- - 06.05.2016

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


Re: X is the richest player - PowerF - 06.05.2016

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); 



Re: X is the richest player - biker122 - 06.05.2016

Which version of MySQL are you using?


Re: X is the richest player - PowerF - 06.05.2016

2.1.1