Help - 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: Help (
/showthread.php?tid=622062)
Help -
bugmenotlol - 18.11.2016
hi all
i have a money command
so when i type it shows $100000
i want to make it like this : 1,00,000
How to do it with commas between digits ??
Re: Help - justice96 - 18.11.2016
Код:
stock FormatNumber(inum, const sizechar[] = ",") // RyDeR`
{
new string[16];
format(string, sizeof(string), "%d", inum);
for(new ilen = strlen(string) - 3; ilen > 0; ilen -= 3)
{
strins(string, sizechar, ilen);
}
return string;
}
Re: Help -
bugmenotlol - 18.11.2016
if (strcmp(cmd, "/jackpot", true) == 0)
{
new stringss[256];
format(stringss, sizeof(stringss), "[Lotto] The Lottery Jackpot is now at $%d. Type /lotto [Number] to purchase a lotto Ticket.", LottoJackpot);
SendClientMessage(playerid, COLOR_RED, stringss);
return 1;
}
how to make in this ?
Re: Help -
oMa37 - 18.11.2016
PHP код:
if (strcmp(cmd, "/jackpot", true) == 0)
{
new stringss[256];
format(stringss, sizeof(stringss), "[Lotto] The Lottery Jackpot is now at $%s. Type /lotto [Number] to purchase a lotto Ticket.", FormatNumber(LottoJackpot));
SendClientMessage(playerid, COLOR_RED, stringss);
return 1;
}
Re: Help - justice96 - 18.11.2016
Код:
stock FormatNumber(inum, const sizechar[] = ",") // RyDeR`
{
new string[16];
format(string, sizeof(string), "%d", inum);
for(new ilen = strlen(string) - 3; ilen > 0; ilen -= 3)
{
strins(string, sizechar, ilen);
}
return string;
}
if(strcmp(cmd, "/jackpot", true) == 0)
{
new stringss[256];
format(stringss, sizeof(stringss), "[Lotto] The Lottery Jackpot is now at $%s. Type /lotto [Number] to purchase a lotto Ticket.", FormatNumber(LottoJackpot));
SendClientMessage(playerid, COLOR_RED, stringss);
return 1;
}
Re: Help -
OneDay - 18.11.2016
https://sampforum.blast.hk/showthread.php?tid=184328 not does Indian 1,00,000 only 100,000