/stats dialog problem..
#1

i made a /stats dialog and i have a problem.. when i write /stats i get "SERVER: Unknown command."
Code:
new string3[256],string4[256],string5[256],string6[256],string7[256],string8[256],statsstring[2256];
		format(string3, sizeof string3, "Level:[%d] Sex:[%s] Age:[%d] Spawn:[%s] SpawnHealth:[%.1f] Cash:[$%d] Bank:[$%d] PhoneNumber:[%d]", level,atext,age,otext,shealth+50, cash, account, pnumber);
		format(string4, sizeof string4, "DonateRank:[%s] MarriedTo:[%s] PlayingHours:[%d] LottoNr:[%d] Job:[%s]", drank,married,ptime,lotto,jtext);
		format(string5, sizeof string5, "FishesCaught:[%d] BiggestFish:[%d] CrimesCommited:[%d] TimesArrested:[%d] WantedDeaths:[%d]", fishes,bigfish,crimes,arrests,warrests);
		format(string6, sizeof string6, "Kills:[%d] Deaths:[%d] NextLevel:[$%d] Respect:[%d/%d] WantedLevel:[%d] Family:[%s]",kills,deaths,costlevel,exp,expamount,wanted,f2text);
		format(string7, sizeof string7, "Drugs:[%d] Materials:[%d] Team:[%s] Disease:[%s] Organisation:[%s] Rank:[%s] Rob:[%d/15]",drugs,mats,ttext,dtext,ftext,rtext,robstat);
		format(string8, sizeof string8, "Warns:[%d] AdminLevel:[%d] HelperLevel: [%d] Crack:[%d]",warns,adminl,helperl,crack);
		format(statsstring, sizeof statsstring, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s",string3,string4,string5,string6,string7,string8,string8);
  		ShowPlayerDialog(playerid, DIALOG_STYLE_MSGBOX, 0, "Stats",statsstring,"Iesi", "");
where is the problem ?
Reply
#2

pawn Code:
new string3[256],string4[256],string5[256],string6[256],string7[256],string8[256],statsstring[2256];
        format(string3, sizeof string3, "Level:[%d] Sex:[%s] Age:[%d] Spawn:[%s] SpawnHealth:[%.1f] Cash:[$%d] Bank:[$%d] PhoneNumber:[%d]", level,atext,age,otext,shealth+50, cash, account, pnumber);
        format(string4, sizeof string4, "DonateRank:[%s] MarriedTo:[%s] PlayingHours:[%d] LottoNr:[%d] Job:[%s]", drank,married,ptime,lotto,jtext);
        format(string5, sizeof string5, "FishesCaught:[%d] BiggestFish:[%d] CrimesCommited:[%d] TimesArrested:[%d] WantedDeaths:[%d]", fishes,bigfish,crimes,arrests,warrests);
        format(string6, sizeof string6, "Kills:[%d] Deaths:[%d] NextLevel:[$%d] Respect:[%d/%d] WantedLevel:[%d] Family:[%s]",kills,deaths,costlevel,exp,expamount,wanted,f2text);
        format(string7, sizeof string7, "Drugs:[%d] Materials:[%d] Team:[%s] Disease:[%s] Organisation:[%s] Rank:[%s] Rob:[%d/15]",drugs,mats,ttext,dtext,ftext,rtext,robstat);
        format(string8, sizeof string8, "Warns:[%d] AdminLevel:[%d] HelperLevel: [%d] Crack:[%d]",warns,adminl,helperl,crack);
        format(statsstring, sizeof statsstring, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s",string3,string4,string5,string6,string7,string8,string8);
        ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Stats",statsstring,"Iesi", "");
Reply
#3

After:

Code:
public OnPlayerCommandText(playerid, cmdtext[])
In your gm and fs.

Code:
return 0;
Perhaps ?
Reply
#4

A tip

Arrays:
pawn Code:
new string[7][256];

format(string[0], sizeof(string), "");
Format:
pawn Code:
format(string, sizeof(string), "something");
format(string, sizeof(string), "%s cool", string);

string would now print "something cool"
Reply
#5

Code:
new string3[256],string4[256],string5[256],string6[256],string7[256],string8[256],statsstring[2256];
        format(string3, sizeof string3, "Level:[%d] Sex:[%s] Age:[%d] Spawn:[%s] SpawnHealth:[%.1f] Cash:[$%d] Bank:[$%d] PhoneNumber:[%d]", level,atext,age,otext,shealth+50, cash, account, pnumber);
        format(string4, sizeof string4, "DonateRank:[%s] MarriedTo:[%s] PlayingHours:[%d] LottoNr:[%d] Job:[%s]", drank,married,ptime,lotto,jtext);
        format(string5, sizeof string5, "FishesCaught:[%d] BiggestFish:[%d] CrimesCommited:[%d] TimesArrested:[%d] WantedDeaths:[%d]", fishes,bigfish,crimes,arrests,warrests);
        format(string6, sizeof string6, "Kills:[%d] Deaths:[%d] NextLevel:[$%d] Respect:[%d/%d] WantedLevel:[%d] Family:[%s]",kills,deaths,costlevel,exp,expamount,wanted,f2text);
        format(string7, sizeof string7, "Drugs:[%d] Materials:[%d] Team:[%s] Disease:[%s] Organisation:[%s] Rank:[%s] Rob:[%d/15]",drugs,mats,ttext,dtext,ftext,rtext,robstat);
        format(string8, sizeof string8, "Warns:[%d] AdminLevel:[%d] HelperLevel: [%d] Crack:[%d]",warns,adminl,helperl,crack);
        format(statsstring, sizeof statsstring, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s",string3,string4,string5,string6,string7,string8,string8);
        ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Stats",statsstring,"Iesi", "");
i edited statsstring[2256] to statsstring[256] and now i've got this
http://postimage.org/image/1g2r69dyc/
Reply
#6

It wouldn't show the rest as the string size is too low.
Reply
#7

and how i can make it bigger ?
Reply
#8

statsstring[256] to statsstring[1000] or statsstring[2000].
Reply
#9

now i get "Server: Unknown command"... WTF X(
Reply
#10

Show whole command
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)