Jump to content

Question

Posted

Salut!

Cum pot schimba afisarea banilor (stats, sume la bunuri) sa nu se mai vada 1000000$, ca nu prea se poate citi, sa pot sa fac sa apara un punct sau o virgule, de exemplu 1000000$ sa se veda 1.000.000$.

+1 Ce-i care ma ajuta!

Multumesc anticipat!

3 answers to this question

Recommended Posts

  • 0
Posted (edited)

Salut! In primul rand incluzi in scriptul tau stock-ul asta:

stock FormatMoney(Float:amount, delimiter[2]=".")
{
	#define MAX_MONEY_STRING 16
	new txt[MAX_MONEY_STRING];
	format(txt, MAX_MONEY_STRING, "%d", floatround(amount));
	new l = strlen(txt);
	if (amount < 0) {
	    if (l > 5) strins(txt, delimiter, l-3);
		if (l > 8) strins(txt, delimiter, l-6);
		if (l > 11) strins(txt, delimiter, l-9);
	}
	else {
		if (l > 4) strins(txt, delimiter, l-3);
		if (l > 7) strins(txt, delimiter, l-6);
		if (l > 10) strins(txt, delimiter, l-9);
	}
	return txt;
}

Dupa mergi la comanda ta de /stats. Aici iti voi arata un exemplu daca nu-l intelegi posteaza comanda ta de stats si o sa tio fac eu:

new string[ 256 ] ;
format( string, sizeof string, "Bani: [$%s]", FormatMoney( GetPlayerMoney ) ) ;
SendClientMessage( playerid, -1, string ) ;
Edited by andy47
  • 0
Posted

 

    GetPlayerName(targetid, name, sizeof(name));

        GetPlayerHealth(targetid,health);

        new Float:px,Float:py,Float:pz;

        GetPlayerPos(targetid, px, py, pz);

        new coordsstring[128];//era 256

        SendClientMessage(playerid, COLOR_NICERED,"_____________________________________________________________________________________________");

        format(coordsstring, sizeof(coordsstring),"*** %s ***",name);

        SendClientMessage(playerid, COLOR_LIGHTBLUE,coordsstring);

        format(coordsstring, sizeof(coordsstring), "Level:[%d] Sex:[%s] Age:[%d] Origin:[%s] SpawnHealth:[%.1f] Cash:[$%d] Bank:[$%d] Ph:[%d]", level,atext,age,otext,shealth+50, cash FormatMoney( GetPlayerMoney ), account FormatMoney( GetPlayerMoney ), pnumber);

        SendClientMessage(playerid, COLOR_WHITE,coordsstring);

        format(coordsstring, sizeof(coordsstring), "DonateRank:[%s] MarriedTo:[%s] PlayingHours:[%d] LottoNr:[%d] Job:[%s] Rob:[%d/15]", drank,married,ptime,lotto,jtext,robstat);

        SendClientMessage(playerid, COLOR_LIGHTBLUE,coordsstring);

        format(coordsstring, sizeof(coordsstring), "FishesCaught:[%d] BiggestFish:[%d] CrimesCommited:[%d] TimesArrested:[%d] WantedDeaths:[%d]", fishes,bigfish,crimes,arrests,warrests );

        SendClientMessage(playerid, COLOR_WHITE,coordsstring);

        format(coordsstring, sizeof(coordsstring), "Kills:[%d] War Kills:[%d] Deaths:[%d] NextLevel:[$%d] Respect:[%d/%d] WantedLevel:[%d] Family:[%s]",kills,warkills,deaths,costlevel,exp,expamount,wanted,f2text);

        SendClientMessage(playerid, COLOR_LIGHTBLUE,coordsstring);

        format(coordsstring, sizeof(coordsstring), "Drugs:[%d] Materials:[%d] Team:[%s] Disease:[%s] Organisation:[%s] Rank:[%s]",drugs,mats,ttext,dtext,ftext,rtext);

        SendClientMessage(playerid, COLOR_WHITE,coordsstring);

        format(coordsstring, sizeof(coordsstring), "Club:[%s] Club Rank:[%s] Club Warns:[%d/3] Bounty Points:[%d] Spawn Location:[%s]",xtext,ytext,clubwarns,bounty,wtext);

        SendClientMessage(playerid, COLOR_LIGHTBLUE,coordsstring);

        format(coordsstring, sizeof(coordsstring), "SafeMats:[%d] SafeDrugs:[%d] Warns:[%d/5] Acces Warns:[%d/4] Faction Warns:[%d/3] DD Manager:[%d] DDH Manager:[%d]",matss,drugss,warns,awarns,facwarn,drights,ddhrights);

        SendClientMessage(playerid, COLOR_WHITE,coordsstring);

        format(coordsstring, sizeof(coordsstring), "House key [%d] Bizz key [%d] HireKey [%d] CarKey1:[%d] CarKey2:[%d] Int:[%d] Vw:[%d] Local:[%d]", housekey,bizkey,HireCar[targetid],PlayerInfo[targetid][pCar],PlayerInfo[targetid][pCar2],intir,virworld,PlayerInfo[targetid][pLocal]);

        SendClientMessage(playerid, COLOR_LIGHTBLUE,coordsstring);

Ute Statusul, dar vreau sa apara si la Cash si la Bank,

  • 0
Posted
format(coordsstring, sizeof(coordsstring), "Level:[%d] Sex:[%s] Age:[%d] Origin:[%s] SpawnHealth:[%.1f] Cash:[$%s] Bank:[$%s] Ph:[%d]", level,atext,age,otext,shealth+50,FormatMoney( cash ),FormatMoney( account), pnumber);

Inlocuieste prima linie cu ce ti-am dat mai sus.

  • Upvote 1
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.