/stats command in dialog
#1

Hi!
I use the zGaming gamemode, and I can't make the /stats command show in dialog, it only show one line, and I don't know why...Please help me guys..
Код:
new coordsstring[256];
	new string2[200];
	format(coordsstring, sizeof(coordsstring), "Szint: [%d] - Nem: [%s] - Kor: [%d] - Kйszpйnz: [%d$] - Bankszбmla egyenleg: [%d$] - Йleterő: [%0.1f] - Golyубllу mellйny[%0.1f]\n", PlayerInfo[playerb][pLevel], gender, PlayerInfo[playerb][pAge], PlayerInfo[playerb][pMoney], PlayerInfo[playerb][pBank], H, A);
    strcat(string2,coordsstring);
	format(coordsstring, sizeof(coordsstring), "Telefonszбm: [%d] - Jбtszott уrбk: [%d] - Kцvetkező szint: [%d/%d] - Kцvetkező szint бra: [%d$] - Tapasztalat pontok [%d]\n", PlayerInfo[playerb][pNumber], PlayerInfo[playerb][pHours], exp, expamount, costlevel, PlayerInfo[playerb][pExp]);
    strcat(string2,coordsstring);
	format(coordsstring, sizeof(coordsstring), "Foglalkozбs: [%s] - Kцrцzйsi szint: [%d] - Elkцvetett bűncselekmйny: [%d] - Letartуztatva: [%dx] - Gyilkossбg: [%d] - Halбl: [%d]\n", RPJN(playerb), PlayerInfo[playerb][pWanted], PlayerInfo[playerb][pCrimes], PlayerInfo[playerb][pArrested], PlayerInfo[playerb][pKill], PlayerInfo[playerb][pDeath]);
    strcat(string2,coordsstring);
	format(coordsstring, sizeof(coordsstring), "Frakciу: [%s] - Frakciу rang: [%s] - Banda: [%s] - Banda rang: [%s]\n", org, rank, org2, rank2);
    strcat(string2,coordsstring);
	format(coordsstring, sizeof(coordsstring), "Ьzlet: [%s] - Hбz: [%s] - Garбzs: [%s]\n", RBT(PlayerInfo[playerb][pBiz]), RPHK(playerb), RPGK(playerb), RVN(GetVehicleModel(PlayerInfo[playerb][pVeh])), PlayerInfo[playerb][pVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVeh])), PlayerInfo[playerb][pVVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVVeh])), PlayerInfo[playerb][pVVVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVVVeh])), PlayerInfo[playerb][pVVVVeh]);
    strcat(string2,coordsstring);
	format(string2, sizeof(string2), "Jбrművek: 1=%s - 2=%s - 3=%s - 4=%s", RVN(PlayerInfo[playerb][vModel]), RVN(PlayerInfo[playerid][vVModel]), RVN(PlayerInfo[playerb][vVVModel]), RVN(PlayerInfo[playerb][vVVVModel]));
	ShowPlayerDialog(playerid,DIALOG_STATS,DIALOG_STYLE_MSGBOX, "Adataid", string2,"Bezбrбs","");
That's all, what is the problem?
Reply
#2

PHP код:
format(string2sizeof(string2), "Jбrművek: 1=%s - 2=%s - 3=%s - 4=%s"RVN(PlayerInfo[playerb][vModel]), RVN(PlayerInfo[playerid][vVModel]), RVN(PlayerInfo[playerb][vVVModel]), RVN(PlayerInfo[playerb][vVVVModel])); 
The problem is that you finished concatenating the strings but you formatted it right away. Formatting deletes the string value as far as I know, hence only the above will display in the dialog.
Reply
#3

So, what I have to do?
Reply
#4

Either remove the last format or change the output string for coordstring and concatenate it to string2
Reply
#5

PHP код:
    new string[6000];
    
strcat(string"Szint: [%d] - Nem: [%s] - Kor: [%d] - Kйszpйnz: [%d$] - Bankszбmla egyenleg: [%d$] - Йletero: [%0.1f] - Golyубllу mellйny[%0.1f]\n");
    
format(string,sizeof(string), stringPlayerInfo[playerb][pLevel], genderPlayerInfo[playerb][pAge], PlayerInfo[playerb][pMoney], PlayerInfo[playerb][pBank], HA);
    
strcat(string"Telefonszбm: [%d] - Jбtszott уrбk: [%d] - Kцvetkezo szint: [%d/%d] - Kцvetkezo szint бra: [%d$] - Tapasztalat pontok [%d]\n");
    
format(stringsizeof(string), stringPlayerInfo[playerb][pNumber], PlayerInfo[playerb][pHours], expexpamountcostlevelPlayerInfo[playerb][pExp]);
    
strcat(string,"Foglalkozбs: [%s] - Kцrцzйsi szint: [%d] - Elkцvetett buncselekmйny: [%d] - Letartуztatva: [%dx] - Gyilkossбg: [%d] - Halбl: [%d]\n");
    
format(string,sizeof(string), stringRPJN(playerb), PlayerInfo[playerb][pWanted], PlayerInfo[playerb][pCrimes], PlayerInfo[playerb][pArrested], PlayerInfo[playerb][pKill], PlayerInfo[playerb][pDeath]);
    
strcat(string"Frakciу: [%s] - Frakciу rang: [%s] - Banda: [%s] - Banda rang: [%s]\n");
    
format(string,sizeof(string), stringorgrankorg2rank2);
    
strcat(string"Ьzlet: [%s] - Hбz: [%s] - Garбzs: [%s]\n");
    
format(string,sizeof(string), stringRBT(PlayerInfo[playerb][pBiz]), RPHK(playerb), RPGK(playerb), RVN(GetVehicleModel(PlayerInfo[playerb][pVeh])), PlayerInfo[playerb][pVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVeh])), PlayerInfo[playerb][pVVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVVeh])), PlayerInfo[playerb][pVVVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVVVeh])), PlayerInfo[playerb][pVVVVeh]);
    
strcat(string"Jбrmuvek: 1=%s - 2=%s - 3=%s - 4=%s");
    
fromat(stringsizeof(string), stringRVN(PlayerInfo[playerb][vModel]), RVN(PlayerInfo[playerid][vVModel]), RVN(PlayerInfo[playerb][vVVModel]), RVN(PlayerInfo[playerb][vVVVModel]));
    
ShowPlayerDialog(playerid,DIALOG_STATS,DIALOG_STYLE_MSGBOX"Adataid"string,"Bezбrбs",""); 
Reply
#6

Quote:
Originally Posted by iMaxy
Посмотреть сообщение
PHP код:
new string[6000]; 
1 No need for such an exaggerated string size.
2 That code will face the same problem OP's code is facing.
Reply
#7

Quote:
Originally Posted by iMaxy
Посмотреть сообщение
PHP код:
    new string[6000];
    
strcat(string"Szint: [%d] - Nem: [%s] - Kor: [%d] - Kйszpйnz: [%d$] - Bankszбmla egyenleg: [%d$] - Йletero: [%0.1f] - Golyубllу mellйny[%0.1f]\n");
    
format(string,sizeof(string), stringPlayerInfo[playerb][pLevel], genderPlayerInfo[playerb][pAge], PlayerInfo[playerb][pMoney], PlayerInfo[playerb][pBank], HA);
    
strcat(string"Telefonszбm: [%d] - Jбtszott уrбk: [%d] - Kцvetkezo szint: [%d/%d] - Kцvetkezo szint бra: [%d$] - Tapasztalat pontok [%d]\n");
    
format(stringsizeof(string), stringPlayerInfo[playerb][pNumber], PlayerInfo[playerb][pHours], expexpamountcostlevelPlayerInfo[playerb][pExp]);
    
strcat(string,"Foglalkozбs: [%s] - Kцrцzйsi szint: [%d] - Elkцvetett buncselekmйny: [%d] - Letartуztatva: [%dx] - Gyilkossбg: [%d] - Halбl: [%d]\n");
    
format(string,sizeof(string), stringRPJN(playerb), PlayerInfo[playerb][pWanted], PlayerInfo[playerb][pCrimes], PlayerInfo[playerb][pArrested], PlayerInfo[playerb][pKill], PlayerInfo[playerb][pDeath]);
    
strcat(string"Frakciу: [%s] - Frakciу rang: [%s] - Banda: [%s] - Banda rang: [%s]\n");
    
format(string,sizeof(string), stringorgrankorg2rank2);
    
strcat(string"Ьzlet: [%s] - Hбz: [%s] - Garбzs: [%s]\n");
    
format(string,sizeof(string), stringRBT(PlayerInfo[playerb][pBiz]), RPHK(playerb), RPGK(playerb), RVN(GetVehicleModel(PlayerInfo[playerb][pVeh])), PlayerInfo[playerb][pVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVeh])), PlayerInfo[playerb][pVVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVVeh])), PlayerInfo[playerb][pVVVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVVVeh])), PlayerInfo[playerb][pVVVVeh]);
    
strcat(string"Jбrmuvek: 1=%s - 2=%s - 3=%s - 4=%s");
    
fromat(stringsizeof(string), stringRVN(PlayerInfo[playerb][vModel]), RVN(PlayerInfo[playerid][vVModel]), RVN(PlayerInfo[playerb][vVVModel]), RVN(PlayerInfo[playerb][vVVVModel]));
    
ShowPlayerDialog(playerid,DIALOG_STATS,DIALOG_STYLE_MSGBOX"Adataid"string,"Bezбrбs",""); 
It's still not working.
Reply
#8

Quote:
Originally Posted by Troydere
Посмотреть сообщение
Either remove the last format or change the output string for coordstring and concatenate it to string2
I did something what you said, but I don't know what did you mean exactly..
PHP код:
new coordsstring[1024];
    new 
string2[1024];
    
format(coordsstringsizeof(coordsstring), "Szint: [%d] - Nem: [%s] - Kor: [%d] - Kйszpйnz: [%d$] - Bankszбmla egyenleg: [%d$] - Йleterő: [%0.1f] - Golyубllу mellйny[%0.1f]\n"PlayerInfo[playerb][pLevel], genderPlayerInfo[playerb][pAge], PlayerInfo[playerb][pMoney], PlayerInfo[playerb][pBank], HA);
    
strcat(string2,coordsstring);
    
format(coordsstringsizeof(coordsstring), "\nTelefonszбm: [%d] - Jбtszott уrбk: [%d] - Kцvetkező szint: [%d/%d] - Kцvetkező szint бra: [%d$] - Tapasztalat pontok [%d]\n"PlayerInfo[playerb][pNumber], PlayerInfo[playerb][pHours], expexpamountcostlevelPlayerInfo[playerb][pExp]);
    
strcat(string2,coordsstring);
    
format(coordsstringsizeof(coordsstring), "\nFoglalkozбs: [%s] - Kцrцzйsi szint: [%d] - Elkцvetett bűncselekmйny: [%d] - Letartуztatva: [%dx] - Gyilkossбg: [%d] - Halбl: [%d]\n"RPJN(playerb), PlayerInfo[playerb][pWanted], PlayerInfo[playerb][pCrimes], PlayerInfo[playerb][pArrested], PlayerInfo[playerb][pKill], PlayerInfo[playerb][pDeath]);
    
strcat(string2,coordsstring);
    
format(coordsstringsizeof(coordsstring), "\nFrakciу: [%s] - Frakciу rang: [%s] - Banda: [%s] - Banda rang: [%s]\n"orgrankorg2rank2);
    
strcat(string2,coordsstring);
    
format(coordsstringsizeof(coordsstring), "\nЬzlet: [%s] - Hбz: [%s] - Garбzs: [%s]\n"RBT(PlayerInfo[playerb][pBiz]), RPHK(playerb), RPGK(playerb), RVN(GetVehicleModel(PlayerInfo[playerb][pVeh])), PlayerInfo[playerb][pVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVeh])), PlayerInfo[playerb][pVVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVVeh])), PlayerInfo[playerb][pVVVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVVVeh])), PlayerInfo[playerb][pVVVVeh]);
    
strcat(string2,coordsstring);
    
format(coordsstringsizeof(coordsstring), "\nJбrművek: 1=%s - 2=%s - 3=%s - 4=%s"RVN(PlayerInfo[playerb][vModel]), RVN(PlayerInfo[playerid][vVModel]), RVN(PlayerInfo[playerb][vVVModel]), RVN(PlayerInfo[playerb][vVVVModel]));
    
ShowPlayerDialog(playerid,DIALOG_STATS,DIALOG_STYLE_MSGBOX"Adataid"coordsstring,"Bezбrбs",""); 
Reply
#9

Yeah, you're halfway there, now concatenate the just formatted coordsstring with your string2 string by using the strcat function, just like the line over the format function you just fixed.
Reply
#10

Quote:
Originally Posted by Troydere
Посмотреть сообщение
Yeah, you're halfway there, now concatenate the just formatted coordsstring with your string2 string by using the strcat function, just like the line over the format function you just fixed.
Still not working perfect :/
PHP код:
new coordsstring[1024];
    new 
string2[1024];
    
format(coordsstringsizeof(coordsstring), "Szint: [%d] - Nem: [%s] - Kor: [%d] - Kйszpйnz: [%d$] - Bankszбmla egyenleg: [%d$] - Йleterő: [%0.1f] - Golyубllу mellйny[%0.1f]\n"PlayerInfo[playerb][pLevel], genderPlayerInfo[playerb][pAge], PlayerInfo[playerb][pMoney], PlayerInfo[playerb][pBank], HA);
    
strcat(coordsstring,coordsstring);
    
format(coordsstringsizeof(coordsstring), "\nTelefonszбm: [%d] - Jбtszott уrбk: [%d] - Kцvetkező szint: [%d/%d] - Kцvetkező szint бra: [%d$] - Tapasztalat pontok [%d]\n"PlayerInfo[playerb][pNumber], PlayerInfo[playerb][pHours], expexpamountcostlevelPlayerInfo[playerb][pExp]);
    
strcat(coordsstring,coordsstring);
    
format(coordsstringsizeof(coordsstring), "\nFoglalkozбs: [%s] - Kцrцzйsi szint: [%d] - Elkцvetett bűncselekmйny: [%d] - Letartуztatva: [%dx] - Gyilkossбg: [%d] - Halбl: [%d]\n"RPJN(playerb), PlayerInfo[playerb][pWanted], PlayerInfo[playerb][pCrimes], PlayerInfo[playerb][pArrested], PlayerInfo[playerb][pKill], PlayerInfo[playerb][pDeath]);
    
strcat(coordsstring,coordsstring);
    
format(coordsstringsizeof(coordsstring), "\nFrakciу: [%s] - Frakciу rang: [%s] - Banda: [%s] - Banda rang: [%s]\n"orgrankorg2rank2);
    
strcat(coordsstring,coordsstring);
    
format(coordsstringsizeof(coordsstring), "\nЬzlet: [%s] - Hбz: [%s] - Garбzs: [%s]\n"RBT(PlayerInfo[playerb][pBiz]), RPHK(playerb), RPGK(playerb), RVN(GetVehicleModel(PlayerInfo[playerb][pVeh])), PlayerInfo[playerb][pVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVeh])), PlayerInfo[playerb][pVVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVVeh])), PlayerInfo[playerb][pVVVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVVVeh])), PlayerInfo[playerb][pVVVVeh]);
    
strcat(coordsstring,coordsstring);
    
format(coordsstringsizeof(coordsstring), "\nJбrművek: 1=%s - 2=%s - 3=%s - 4=%s"RVN(PlayerInfo[playerb][vModel]), RVN(PlayerInfo[playerid][vVModel]), RVN(PlayerInfo[playerb][vVVModel]), RVN(PlayerInfo[playerb][vVVVModel]));
    
ShowPlayerDialog(playerid,DIALOG_STATS,DIALOG_STYLE_MSGBOX"Adataid"coordsstring,"Bezбrбs",""); 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)