How to make %d say the amount of cash earnt - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to make %d say the amount of cash earnt (
/showthread.php?tid=181357)
How to make %d say the amount of cash earnt -
Haydz - 05.10.2010
Already so i'v been puzzled on this and really had no idea.
this is my code.
Код:
GivePlayerMoney(playerid,random(10000-5000)+5000);
SendClientMessage(playerid, COLOR_GREEN, "You've Earnt $%d");
The give random money works perfectly fine, i just need it to say you're earnt %d
Thanks in advance
Re: How to make %d say the amount of cash earnt -
Zamaroht - 05.10.2010
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);
Re: How to make %d say the amount of cash earnt -
samgreen - 05.10.2010
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);
Re: How to make %d say the amount of cash earnt -
[MKD]Max - 05.10.2010
just folow the way they give you dude i have maked my own rcon admin script like this