SA-MP Forums Archive
string - 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: string (/showthread.php?tid=451516)



string - Captain_jeffree95 - 17.07.2013

how do u get commers to show in client messages .

e.g

Now
$16000

how we want it
$16,000

how do we get the money in the client messages to show up like this.


Re: string - Misiur - 17.07.2013

https://sampforum.blast.hk/showthread.php?tid=184328


Re: string - Income - 17.07.2013

PHP код:
stock FormatNumber(value) //RyDeR`
{
    new
        
string[24]
    ;
    
format(string, sizeof(string), "%d", value);
    
    for(new 
i = (strlen(string) - 3); i > (value < 0 ? 1 : 0) ; i -= 3)
    {
        
strins(string[i], ",", 0);
    }
    return 
string;
} 
Example:

PHP код:
new string[124];
format(string, sizeof(string),"$%s", FormatNumber(16000));
SendClientMessage(playerid, COLOR_GREY, string);