[Help] Stats in Dialog
#1

Код:
new coordsstring[128];
        format(coordsstring, sizeof(coordsstring),"| %s (%d) |\n",name, targetid);
        format(coordsstring, sizeof(coordsstring), "| Level: %d | Spol: %s | Godine: %d | Novac: $%d | Banka: $%d | Ph: %d | Donator Rank: %s |\n",coordsstring, level,atext,age,cash,account,pnumber,drank);
        format(coordsstring, sizeof(coordsstring), "| Igra sati: %d | Igra minuta: %d | Igra sekunda: %d | Najveca riba: %d | Puta uhicen: %d |\n",coordsstring,(ptime / 3600), (ptime / 60), ptime,bigfish,arrests);
        format(coordsstring, sizeof(coordsstring), "| Respect: %d/%d | Smrti: %d | Droga: %d | Materiali: %d | Tim: %s | Rank: %s | Ubojstva: %d | Upozorenja: %d |\n",coordsstring,exp,expamount,Deaths,drugs,mats,ttext,rtext, Kills,warned);
        format(coordsstring, sizeof(coordsstring), "| Swat Rank: %s | Tactical Rank: %s | Forces Rank: %s | DD Manager: %d | LottoNr: %d | Pocinjeno zlocina: %d |\n",coordsstring,swatr,tacticalr,specialfr,drights,lotto,crimes);
        format(coordsstring, sizeof(coordsstring), "| Health: %.1f | Pancirka: %.1f | IP: %s | Ribe: %d | Zadnje odlazenje: %s | Banan s duznosti: %d |\n",coordsstring, health, armour, Playersip, fishes, PlayerInfo[targetid][pWhyLeft], dban);
        format(coordsstring, sizeof(coordsstring), "| Kljuc od kuce: %d | Kljuc od biza: %d | Najamni kljuc: %d | Interijer: %d | Virtual World: %d | Local: %d | Posao: %s |\n",coordsstring, housekey,bizkey,HireCar[targetid],intir,virworld,local,jtext);
        ShowPlayerDialog(playerid,841,DIALOG_STYLE_MSGBOX,"|----------| Zivot Igraca",coordsstring,"OK","Izadji");
Hello,i wanted to make a stats dialog but when i compile all is good without errors or warning,but when i go to ingame,and i write /stats its only show one of this stats.like this
Код:
format(coordsstring, sizeof(coordsstring), "| Kljuc od kuce: %d | Kljuc od biza: %d | Najamni kljuc: %d | Interijer: %d | Virtual World: %d | Local: %d | Posao: %s |\n",coordsstring, housekey,bizkey,HireCar[targetid],intir,virworld,local,jtext);
I dont know what is problem please help me,i am sorry coz mine grammar i aint good in grammar..
Thanks People!
Reply
#2

Format all of the stats in one huge string and to make it look better use a new line '\n' andor '\t'.
Reply
#3

i use \n not \t :S dont you see that mate..I dont know what is problem in mine script about dialog..
Reply
#4

ignorant dude.

pawn Код:
new coordsstring[500];
format(coordsstring, sizeof(coordsstring), "Level : %d, Rank : %d, Age : %d, Blah : %d, Blah2 : %d, Blah3 : %d", pLevel, pRank, pAge, Blah, Blah2, Blah3);
FORMAT ALL THE STUFF IN JUST ONE FORMAT / STRING instead of formatting it one by one.
Reply
#5

Quote:
Originally Posted by Retardedwolf
Посмотреть сообщение
ignorant dude.

pawn Код:
new coordsstring[500];
format(coordsstring, sizeof(coordsstring), "Level : %d, Rank : %d, Age : %d, Blah : %d, Blah2 : %d, Blah3 : %d", pLevel, pRank, pAge, Blah, Blah2, Blah3);
FORMAT ALL THE STUFF IN JUST ONE FORMAT / STRING instead of formatting it one by one.
He can't.
If input line is too long, pawncc will return an error.

Put %s in the start of every string, or use strcat instead.
Reply
#6

Quote:
Originally Posted by Retardedwolf
Посмотреть сообщение
ignorant dude.

pawn Код:
new coordsstring[500];
format(coordsstring, sizeof(coordsstring), "Level : %d, Rank : %d, Age : %d, Blah : %d, Blah2 : %d, Blah3 : %d", pLevel, pRank, pAge, Blah, Blah2, Blah3);
FORMAT ALL THE STUFF IN JUST ONE FORMAT / STRING instead of formatting it one by one.
Ok mate,i did that i put all in one but i got errors :S
Код:
C:\Users\Ultimate\Downloads\FOR SAMP !!!T\server\MOD NOVI\MOD NOVI\MOD NOVI\gamemodes\cile.pwn(4785) : warning 219: local variable "s" shadows a variable at a preceding level
C:\Users\Ultimate\Downloads\FOR SAMP !!!T\server\MOD NOVI\MOD NOVI\MOD NOVI\gamemodes\cile.pwn(5870) : warning 219: local variable "s" shadows a variable at a preceding level
C:\Users\Ultimate\Downloads\FOR SAMP !!!T\server\MOD NOVI\MOD NOVI\MOD NOVI\gamemodes\cile.pwn(7300) : warning 219: local variable "s" shadows a variable at a preceding level
C:\Users\Ultimate\Downloads\FOR SAMP !!!T\server\MOD NOVI\MOD NOVI\MOD NOVI\gamemodes\cile.pwn(10478) : warning 219: local variable "s" shadows a variable at a preceding level
C:\Users\Ultimate\Downloads\FOR SAMP !!!T\server\MOD NOVI\MOD NOVI\MOD NOVI\gamemodes\cile.pwn(10543) : warning 219: local variable "s" shadows a variable at a preceding level
C:\Users\Ultimate\Downloads\FOR SAMP !!!T\server\MOD NOVI\MOD NOVI\MOD NOVI\gamemodes\cile.pwn(11245) : warning 219: local variable "s" shadows a variable at a preceding level
C:\Users\Ultimate\Downloads\FOR SAMP !!!T\server\MOD NOVI\MOD NOVI\MOD NOVI\gamemodes\cile.pwn(11261) : warning 219: local variable "s" shadows a variable at a preceding level
C:\Users\Ultimate\Downloads\FOR SAMP !!!T\server\MOD NOVI\MOD NOVI\MOD NOVI\gamemodes\cile.pwn(11278) : warning 219: local variable "s" shadows a variable at a preceding level
C:\Users\Ultimate\Downloads\FOR SAMP !!!T\server\MOD NOVI\MOD NOVI\MOD NOVI\gamemodes\cile.pwn(11292) : warning 219: local variable "s" shadows a variable at a preceding level
C:\Users\Ultimate\Downloads\FOR SAMP !!!T\server\MOD NOVI\MOD NOVI\MOD NOVI\gamemodes\cile.pwn(11309) : warning 219: local variable "s" shadows a variable at a preceding level
C:\Users\Ultimate\Downloads\FOR SAMP !!!T\server\MOD NOVI\MOD NOVI\MOD NOVI\gamemodes\cile.pwn(11323) : warning 219: local variable "s" shadows a variable at a preceding level
C:\Users\Ultimate\Downloads\FOR SAMP !!!T\server\MOD NOVI\MOD NOVI\MOD NOVI\gamemodes\cile.pwn(11340) : warning 219: local variable "s" shadows a variable at a preceding level
C:\Users\Ultimate\Downloads\FOR SAMP !!!T\server\MOD NOVI\MOD NOVI\MOD NOVI\gamemodes\cile.pwn(11354) : warning 219: local variable "s" shadows a variable at a preceding level
C:\Users\Ultimate\Downloads\FOR SAMP !!!T\server\MOD NOVI\MOD NOVI\MOD NOVI\gamemodes\cile.pwn(11371) : warning 219: local variable "s" shadows a variable at a preceding level
C:\Users\Ultimate\Downloads\FOR SAMP !!!T\server\MOD NOVI\MOD NOVI\MOD NOVI\gamemodes\cile.pwn(11385) : warning 219: local variable "s" shadows a variable at a preceding level
C:\Users\Ultimate\Downloads\FOR SAMP !!!T\server\MOD NOVI\MOD NOVI\MOD NOVI\gamemodes\cile.pwn(11402) : warning 219: local variable "s" shadows a variable at a preceding level
C:\Users\Ultimate\Downloads\FOR SAMP !!!T\server\MOD NOVI\MOD NOVI\MOD NOVI\gamemodes\cile.pwn(11416) : warning 219: local variable "s" shadows a variable at a preceding level
C:\Users\Ultimate\Downloads\FOR SAMP !!!T\server\MOD NOVI\MOD NOVI\MOD NOVI\gamemodes\cile.pwn(11433) : warning 219: local variable "s" shadows a variable at a preceding level
C:\Users\Ultimate\Downloads\FOR SAMP !!!T\server\MOD NOVI\MOD NOVI\MOD NOVI\gamemodes\cile.pwn(11447) : warning 219: local variable "s" shadows a variable at a preceding level
C:\Users\Ultimate\Downloads\FOR SAMP !!!T\server\MOD NOVI\MOD NOVI\MOD NOVI\gamemodes\cile.pwn(11464) : warning 219: local variable "s" shadows a variable at a preceding level
C:\Users\Ultimate\Downloads\FOR SAMP !!!T\server\MOD NOVI\MOD NOVI\MOD NOVI\gamemodes\cile.pwn(11478) : warning 219: local variable "s" shadows a variable at a preceding level
C:\Users\Ultimate\Downloads\FOR SAMP !!!T\server\MOD NOVI\MOD NOVI\MOD NOVI\gamemodes\cile.pwn(16198) : warning 219: local variable "s" shadows a variable at a preceding level
C:\Users\Ultimate\Downloads\FOR SAMP !!!T\server\MOD NOVI\MOD NOVI\MOD NOVI\gamemodes\cile.pwn(16490) : warning 219: local variable "s" shadows a variable at a preceding level
C:\Users\Ultimate\Downloads\FOR SAMP !!!T\server\MOD NOVI\MOD NOVI\MOD NOVI\gamemodes\cile.pwn(18111) : error 075: input line too long (after substitutions)
C:\Users\Ultimate\Downloads\FOR SAMP !!!T\server\MOD NOVI\MOD NOVI\MOD NOVI\gamemodes\cile.pwn(18112) : error 037: invalid string (possibly non-terminated string)
C:\Users\Ultimate\Downloads\FOR SAMP !!!T\server\MOD NOVI\MOD NOVI\MOD NOVI\gamemodes\cile.pwn(18112) : error 017: undefined symbol "s"
C:\Users\Ultimate\Downloads\FOR SAMP !!!T\server\MOD NOVI\MOD NOVI\MOD NOVI\gamemodes\cile.pwn(18112) : error 017: undefined symbol "d"
C:\Users\Ultimate\Downloads\FOR SAMP !!!T\server\MOD NOVI\MOD NOVI\MOD NOVI\gamemodes\cile.pwn(18112) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
What i did wrong or ? Thanks mate anyway
Reply
#7

Код:
	new coordsstring[768],coordsstringA[128],coordsstringB[128],coordsstringC[128],coordsstringD[128],coordsstringE[128],coordsstringF[128],coordsstringG[128];
	format(coordsstringA, sizeof(coordsstringA),"| %s (%d) |",name, targetid);
	format(coordsstringB, sizeof(coordsstringB), "| Level: %d | Spol: %s | Godine: %d | Novac: $%d | Banka: $%d | Ph: %d | Donator Rank: %s |",level,atext,age,cash,account,pnumber,drank);
	format(coordsstringC, sizeof(coordsstringC), "| Igra sati: %d | Igra minuta: %d | Igra sekunda: %d | Najveca riba: %d | Puta uhicen: %d |",(ptime / 3600), (ptime / 60), ptime,bigfish,arrests);
	format(coordsstringD, sizeof(coordsstringD), "| Respect: %d/%d | Smrti: %d | Droga: %d | Materiali: %d | Tim: %s | Rank: %s | Ubojstva: %d | Upozorenja: %d |",exp,expamount,Deaths,drugs,mats,ttext,rtext, Kills,warned);
	format(coordsstringE, sizeof(coordsstringE), "| Swat Rank: %s | Tactical Rank: %s | Forces Rank: %s | DD Manager: %d | LottoNr: %d | Pocinjeno zlocina: %d |",swatr,tacticalr,specialfr,drights,lotto,crimes);
	format(coordsstringF, sizeof(coordsstringF), "| Health: %.1f | Pancirka: %.1f | IP: %s | Ribe: %d | Zadnje odlazenje: %s | Banan s duznosti: %d |", health, armour, Playersip, fishes, PlayerInfo[targetid][pWhyLeft], dban);
	format(coordsstringG, sizeof(coordsstringG), "| Kljuc od kuce: %d | Kljuc od biza: %d | Najamni kljuc: %d | Interijer: %d | Virtual World: %d | Local: %d | Posao: %s |", housekey,bizkey,HireCar[targetid],intir,virworld,local,jtext);
	format(coordsstring, sizeof(coordsstring), "%s\n%s\n%s\n%s\n%s\n%s\n%s",coordsstringA,coordsstringB,coordsstringC,coordsstringD,coordsstringE,coordsstringF);
	ShowPlayerDialog(playerid,841,DIALOG_STYLE_MSGBOX,"|----------| Zivot Igraca",coordsstring,"OK","Izadji");
Reply
#8

Quote:
Originally Posted by Babul
Посмотреть сообщение
Код:
	new coordsstring[768],coordsstringA[128],coordsstringB[128],coordsstringC[128],coordsstringD[128],coordsstringE[128],coordsstringF[128],coordsstringG[128];
	format(coordsstringA, sizeof(coordsstringA),"| %s (%d) |",name, targetid);
	format(coordsstringB, sizeof(coordsstringB), "| Level: %d | Spol: %s | Godine: %d | Novac: $%d | Banka: $%d | Ph: %d | Donator Rank: %s |",level,atext,age,cash,account,pnumber,drank);
	format(coordsstringC, sizeof(coordsstringC), "| Igra sati: %d | Igra minuta: %d | Igra sekunda: %d | Najveca riba: %d | Puta uhicen: %d |",(ptime / 3600), (ptime / 60), ptime,bigfish,arrests);
	format(coordsstringD, sizeof(coordsstringD), "| Respect: %d/%d | Smrti: %d | Droga: %d | Materiali: %d | Tim: %s | Rank: %s | Ubojstva: %d | Upozorenja: %d |",exp,expamount,Deaths,drugs,mats,ttext,rtext, Kills,warned);
	format(coordsstringE, sizeof(coordsstringE), "| Swat Rank: %s | Tactical Rank: %s | Forces Rank: %s | DD Manager: %d | LottoNr: %d | Pocinjeno zlocina: %d |",swatr,tacticalr,specialfr,drights,lotto,crimes);
	format(coordsstringF, sizeof(coordsstringF), "| Health: %.1f | Pancirka: %.1f | IP: %s | Ribe: %d | Zadnje odlazenje: %s | Banan s duznosti: %d |", health, armour, Playersip, fishes, PlayerInfo[targetid][pWhyLeft], dban);
	format(coordsstringG, sizeof(coordsstringG), "| Kljuc od kuce: %d | Kljuc od biza: %d | Najamni kljuc: %d | Interijer: %d | Virtual World: %d | Local: %d | Posao: %s |", housekey,bizkey,HireCar[targetid],intir,virworld,local,jtext);
	format(coordsstring, sizeof(coordsstring), "%s\n%s\n%s\n%s\n%s\n%s\n%s",coordsstringA,coordsstringB,coordsstringC,coordsstringD,coordsstringE,coordsstringF);
	ShowPlayerDialog(playerid,841,DIALOG_STYLE_MSGBOX,"|----------| Zivot Igraca",coordsstring,"OK","Izadji");
MATE thank you very much very much very i dont know how to thanks you..
Thanks Again i own you _o_
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)