FreeWall 3 Odesláno: 23. Březen, 2011 Share Odesláno: 23. Březen, 2011 Čau. Už jsem dlouho něco nenapsal, tak sem hodim jednoduchej scriptík (pro zpřehlednění) na rozdělení čísla (nejčastěji peněz) podle řádů (po třech), nazval jsem jí SplitMoney. Snad se to bude někomu hodit. Jestli to tu už je tak sem jen zabil nudu Použití: SplitMoney(12053012) = "12 053 012" stock SplitMoney(money){ new d,string[14],string2[11]; format(string2,sizeof(string2),"%d",money); for(new i=strlen(string2)-1;i>=0;i--){ new string3[2]; strmid(string3,string2,i,i+1); if(d%3 == 0 && i != strlen(string2)-1) format(string,sizeof(string),"%s %s",string3,string); else format(string,sizeof(string),"%s%s",string3,string); d ++; } return string; } - parametr funkce je celé číslo (integer) - funkce vrací řetězec (string) Příklad: new penize = GetPlayerMoney(playerid); // hráč bude mít např. 12053012 $ new string[256]; format(string, sizeof(string), "U sebe máte %s dolarů", SplitMoney(penize)); SendClientMessage(playerid, COLOR_WHITE, string); řětezec string se nám promění v "U sebe máte 12 053 012 dolarů" Link to comment Share on other sites More sharing options...
Petr 44 Odesláno: 27. Březen, 2011 Share Odesláno: 27. Březen, 2011 Nikdo ti sem nepíše, tak abys nebyl smutnej, tak já budu 1. Je to pěkné, mohlo by se hodit pro nějáký ty RP ale já to neuvyužiju. Link to comment Share on other sites More sharing options...
MinecraftPlayer 0 Odesláno: 27. Březen, 2011 Share Odesláno: 27. Březen, 2011 aha už to chapu sem to nepochopil ze začátku je to dobré Link to comment Share on other sites More sharing options...
-SpiriX23- 0 Odesláno: 27. Březen, 2011 Share Odesláno: 27. Březen, 2011 Jako pawner mezi těma "lepšíma" bys měl přestat používat ty nesmyslný 256 čísla Link to comment Share on other sites More sharing options...
FreeWall 3 Odesláno: 27. Březen, 2011 Author Share Odesláno: 27. Březen, 2011 ":35cz4p7k]Jako pawner mezi těma "lepšíma" bys měl přestat používat ty nesmyslný 256 čísla nechtělo se mi to počítat, upraveno Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now