How to make %d say the amount of cash earnt
#3

Quote:
Originally Posted by Zamaroht
Посмотреть сообщение
You need to create an array to use as a string, and format it:

pawn Код:
new money = random(10000-5000)+5000;
GivePlayerMoney(playerid, money);

new string[128];
format(string, sizeof(string), "You've Earnt $%d", money);
SendClientMessage(playerid, COLOR_GREEN, string);
Here is a little #define we use in my server that makes this vastly easier:

pawn Код:
stock bool:False = false;
#define SendClientMessageFormatted(%0,%1,%2,%3) do{new str[128];format(str,sizeof(str),(%2),%3);SendClientMessage((%0),(%1),str);}while(False)

// Example
SendClientMessageFormatted(playerid, COLOR_GREEN, "You've Earned $%d", money);
Reply


Messages In This Thread
How to make %d say the amount of cash earnt - by Haydz - 05.10.2010, 09:31
Re: How to make %d say the amount of cash earnt - by Zamaroht - 05.10.2010, 09:38
Re: How to make %d say the amount of cash earnt - by samgreen - 05.10.2010, 10:52
Re: How to make %d say the amount of cash earnt - by [MKD]Max - 05.10.2010, 11:46

Forum Jump:


Users browsing this thread: 1 Guest(s)