Script Help
#1

Hello I am looking for a method to transfer a number from this Form : 10520950 To this one 10,520,950

any one can help ? Thanks
Reply
#2

https://sampwiki.blast.hk/wiki/AddCommas
Reply
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Thanks a lot
Reply
#4

CMD:mymoney(playerid, params[])
{
new string[120];
new account = PlayerInfo[playerid][pAccount];
format(string, sizeof(string),"your bank account:%d", account );
SendClientMessageEx(playerid, COLOR_GREEN, string);
return 1;

}
//PlayerInfo[playerid][pAccount] is how much palyer own in the bank for exemple let's say 8000000 i wanna see it in this format 8,000,000
// I have posted the stock AddCommas(number) but i don't know how to use it ,can anyone please try to make that on the cmd_mymoney ?



Thanks
Reply
#5

Just use %s and AddCommas with the number parameter:
pawn Код:
CMD:mymoney(playerid, params[])
{
    new string[120];
    format(string, sizeof(string),"your bank account:%s", AddCommas( PlayerInfo[playerid][pAccount] ) );
    SendClientMessageEx(playerid, COLOR_GREEN, string);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)