money with "."
#1

I use this:
PHP код:
stock NumberWithSign(const number, const sign[2] = "'")
{
    new 
str[10 EOS];
    
format(strsizeof(str), "%i"number);
    for(new 
strlen(str)-30-= 3)
    {
        
strins(strsignj);
    }
    return 
str;
}
CMD:setmoney(playeridparams[])
{
    new 
pIDvalue;
    if(
PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, -1"{FF0000}EROARE: {FFFFFF}Nu ai acces la aceasta comanda.");
    else if(
sscanf(params"ui"pIDvalue)) return SendClientMessage(playeridCOLOR_GOLD"Foloseste: /setmoney [id] [suma]");
    else if(
pID == INVALID_PLAYER_ID) return SendClientMessage(playeridCOLOR_TOM"Jucatorul nu este conectat.");
    else
    {
        new 
string[100], target[MAX_PLAYER_NAME], pName[MAX_PLAYER_NAME];
        
GetPlayerName(playeridpNamesizeof(pName));
        
GetPlayerName(pIDtargetsizeof(target));
        
format(stringsizeof(string), "I-ai setat lui "COL_YELLOW"%s "COL_GY"suma de "COL_GREEN"%i$."target,value);
        
SendClientMessage(playeridCOLOR_GYELLOWstring);
        
format(stringsizeof(string), "Ai primit suma de "COL_GREEN"%i$ "COL_GY"de la "COL_YELLOW"%s."valuepName);
        
SendClientMessage(pIDCOLOR_GYELLOWstring);
        
PlayerInfo[pID][pCash] = value;
        
SetPlayerMoney(pIDPlayerInfo[pID][pCash]);
    }
    return 
1;

What i have to change to money look like 200000$ = 200.000$ ?
Reply
#2

NumberWithSign(value);

And in the format, change %i or %d to %s.
Reply
#3

NumberWithSign(value) change in stock? or string?
Reply
#4

Check your PM ..
Reply
#5

pawn Код:
stock NumberFormat(integer, const separator[] = ",")
{
    new string[16];
    valstr(string, integer);

    if(integer >= 1000)
    {
        for(new i = (strlen(string) - 3); i > 0; i -= 3)
        {
            strins(string, separator, i);
        }
    }
    return string;
}
Reply
#6

It's done. Thank Dayrion.
Reply
#7

Quote:
Originally Posted by GabiXx
Посмотреть сообщение
It's done. Thank Dayrion.
He should be banned for breaking the forum rule 'this is a community'.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)