02.12.2016, 20:01
I use this:
What i have to change to money look like 200000$ = 200.000$ ?
PHP код:
stock NumberWithSign(const number, const sign[2] = "'")
{
new str[10 + EOS];
format(str, sizeof(str), "%i", number);
for(new j = strlen(str)-3; j > 0; j -= 3)
{
strins(str, sign, j);
}
return str;
}
CMD:setmoney(playerid, params[])
{
new pID, value;
if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, -1, "{FF0000}EROARE: {FFFFFF}Nu ai acces la aceasta comanda.");
else if(sscanf(params, "ui", pID, value)) return SendClientMessage(playerid, COLOR_GOLD, "Foloseste: /setmoney [id] [suma]");
else if(pID == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_TOM, "Jucatorul nu este conectat.");
else
{
new string[100], target[MAX_PLAYER_NAME], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
GetPlayerName(pID, target, sizeof(target));
format(string, sizeof(string), "I-ai setat lui "COL_YELLOW"%s "COL_GY"suma de "COL_GREEN"%i$.", target,value);
SendClientMessage(playerid, COLOR_GYELLOW, string);
format(string, sizeof(string), "Ai primit suma de "COL_GREEN"%i$ "COL_GY"de la "COL_YELLOW"%s.", value, pName);
SendClientMessage(pID, COLOR_GYELLOW, string);
PlayerInfo[pID][pCash] = value;
SetPlayerMoney(pID, PlayerInfo[pID][pCash]);
}
return 1;
}