public PayDay() { foreach(Player, i) { if(IsPlayerConnected(i) && gPlayerLogged[i] == 1) { if(PlayerInfo[i][pPayDay] < 5) return 1; new coordstring[64], coordstring1[32], coordstring2[50], coordstring3[45], coordstring4[80], coordstring5[45], coordstring6[50], coordstring7[48]; new coordstring8[80], coordstring9[35], coordstring10[50], coordstring11[72], coordstring12[50], coordstring13[45], coordstring15[75], payday[830]; ...
public PayDay() { new coordstring[64], coordstring1[32], coordstring2[50], coordstring3[45], coordstring4[80], coordstring5[45], coordstring6[50], coordstring7[48]; new coordstring8[80], coordstring9[35], coordstring10[50], coordstring11[72], coordstring12[50], coordstring13[45], coordstring15[75], payday[830]; foreach(Player, i) { if(IsPlayerConnected(i) && gPlayerLogged[i] == 1) { if(PlayerInfo[i][pPayDay] < 5) return 1; ...
Well, in my opinion it's depending on how you will use those string variables, i'd go with option 2. But i'm wondering what kind of string you are trying to save with that a lot numbers and how you use it? Also you don't need IsPlayerConnected() when using foreach() function
|
format(coordstring, sizeof(coordstring)," {FFFFFF}|___{00FFFF}BANKARSKI IZVESTAJ{FFFFFF}___|"); format(coordstring1, sizeof(coordstring1),"\n{00FFFF}Plata: {FFFFFF}$%d", checks); format(coordstring2, sizeof(coordstring2),"\n{00FFFF}Steceni interes: {FFFFFF}$%d",interes); format(coordstring3, sizeof(coordstring3),"\n{00FFFF}Kamatna stopa: {FFFFFF}0.%d posto",kamatnastopa); format(coordstring4, sizeof(coordstring4),"\n\n {FFFFFF}|---------------- {00FFFF}Racuni {FFFFFF}----------------|"); format(coordstring5, sizeof(coordstring5),"\n{00FFFF}Racun za struju: {FFFFFF}$%d",struja); format(coordstring6, sizeof(coordstring6),"\n{00FFFF}Racun za vodu: {FFFFFF}$%d",voda); format(coordstring7, sizeof(coordstring7),"\n{00FFFF}Racun za komunalije: {FFFFFF}$%d",komunalije); format(coordstring8, sizeof(coordstring8),"\n\n {FFFFFF}|---------------- {00FFFF}Porezi {FFFFFF}----------------|"); format(coordstring9, sizeof(coordstring9),"\n{00FFFF}Rent: {FFFFFF}%d",rent); format(coordstring10, sizeof(coordstring10),"\n{00FFFF}Porez na bogatstvo: {FFFFFF}$%d",porezbogastvo); format(coordstring11, sizeof(coordstring11),"\n\n {FFFFFF}|-----------------------------------------------|"); format(coordstring12, sizeof(coordstring12),"\n{00FFFF}Staro Stanje: {FFFFFF}$%d{FFFFFF}", PlayerInfo[i][pAccount] - checks - interes + (porezbogastvo + struja + voda + komunalije)); format(coordstring13, sizeof(coordstring13),"\n{00FFFF}Novo Stanje: {FFFFFF}$%d",PlayerInfo[i][pAccount]); format(coordstring15, sizeof(coordstring15),"\n\n {FFFFFF}|-----------------------------------------------|"); format(payday, sizeof(payday)," %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",coordstring,coordstring1,coordstring2,coordstring3,coordstring4,coordstring5,coordstring6,coordstring7,coordstring8,coordstring9,coordstring10,coordstring11,coordstring12,coordstring13,coordstring15); ShowPlayerDialog(i, PLATA, DIALOG_STYLE_MSGBOX, "Bankarski izvestaj gradjana", payday , "U redu", "");
public PayDay()
{
new payday[830];
foreach(Player, i)
{
if(IsPlayerConnected(i) && gPlayerLogged[i] == 1)
{
format(payday, sizeof(payday)," {FFFFFF}|___{00FFFF}BANKARSKI IZVESTAJ{FFFFFF}___|");
format(payday, sizeof(payday),"%s\n{00FFFF}Plata: {FFFFFF}$%d", payday, checks);
format(payday, sizeof(payday),"%s\n{00FFFF}Steceni interes: {FFFFFF}$%d", payday,interes);
format(payday, sizeof(payday),"%s\n{00FFFF}Kamatna stopa: {FFFFFF}0.%d posto", payday,kamatnastopa);
format(payday, sizeof(payday),"%s\n\n {FFFFFF}|---------------- {00FFFF}Racuni {FFFFFF}----------------|",payday);
format(payday, sizeof(payday),"%s\n{00FFFF}Racun za struju: {FFFFFF}$%d", payday,struja);
format(payday, sizeof(payday),"%s\n{00FFFF}Racun za vodu: {FFFFFF}$%d", payday,voda);
format(payday, sizeof(payday),"%s\n{00FFFF}Racun za komunalije: {FFFFFF}$%d", payday,komunalije);
format(payday, sizeof(payday),"%s\n\n {FFFFFF}|---------------- {00FFFF}Porezi {FFFFFF}----------------|",payday);
format(payday, sizeof(payday),"%s\n{00FFFF}Rent: {FFFFFF}%d",payday,rent);
format(payday, sizeof(payday),"%s\n{00FFFF}Porez na bogatstvo: {FFFFFF}$%d",payday,porezbogastvo);
format(payday, sizeof(payday),"%s\n\n {FFFFFF}|-----------------------------------------------|",payday);
format(payday, sizeof(payday),"%s\n{00FFFF}Staro Stanje: {FFFFFF}$%d{FFFFFF}",payday, PlayerInfo[i][pAccount] - checks - interes + (porezbogastvo + struja + voda + komunalije));
format(payday, sizeof(payday),"%s\n{00FFFF}Novo Stanje: {FFFFFF}$%d",payday,PlayerInfo[i][pAccount]);
format(payday, sizeof(payday),"%s\n\n {FFFFFF}|-----------------------------------------------|",payday);
ShowPlayerDialog(i, PLATA, DIALOG_STYLE_MSGBOX, "Bankarski izvestaj gradjana", payday , "U redu", "");
}
}
}
public Plata() { new bank = 1; foreach(Player, i) { if(gPlayerLogged[i] == 1) { if(PlayerInfo[i][pVip] > 1) bank = 5; GiveMoney(i, money*bank); ..
public Plata() { foreach(Player, i) { if(gPlayerLogged[i] == 1) { new bank = 1; if(PlayerInfo[i][pVip] > 1) bank = 5; GiveMoney(i, money*bank); ..
new string[500]; format(string, sizeof(string), "Big message with 490 characters"); ShowPlayerDialog(i, PLATA, DIALOG_STYLE_MSGBOX, "Bankarski izvestaj gradjana", string, "U redu", ""); format(string, sizeof(string), "Small message with 30 characters"); SendClientMessage(i, Color, string);
format(string, sizeof(string), "%sSmall message with 30 characters", string);
Instead of making those many strings, you can do it in one string..
PHP код:
|
#define strcat_format(%0,%1,%2) format(%0[strlen(%0)], %1 - strlen(%0), %2)
public Plata() { new bank = 1; foreach(Player, i) { if(gPlayerLogged[i] == 1) { bank = 1; // this if(PlayerInfo[i][pVip] > 1) bank = 5; GiveMoney(i, money*bank); ..