Long Msgbox Problem
#1

Hi. I have made a line but it's too long so when I compile the gamemode, pawno has stopped running. In short;

pawn Код:
new STS_MSG[2048];
format(STS_MSG, sizeof STS_MSG,"{F7D358}(Name) {FFFFFF}%s;\n{F7D358}(Account) {FFFFFF}Language: {F7D358}English {FFFFFF}\n{F7D358}(Money) {FFFFFF}Cash in Pocket: {F7D358}%d {FFFFFF}| {FFFFFF}Bank: {F7D358}%d\n{F7D358}(Kills/Deaths) {FFFFFF}Kills: {F7D358}%d {FFFFFF}| Deaths: {F7D358}%d {FFFFFF}| Ratio:{F7D358} %0.2f {FFFFFF}\n{F7D358}(Experience) {FFFFFF}Level: {F7D358}%d {FFFFFF}| Upgrade Points: {F7D358}%d\n{F7D358}(Inventory) {FFFFFF}A_KEY: {F7D358}%d {FFFFFF}| B_KEY: {F7D358}%d\n",oyuncuismi,GetPlayerMoney(playerid),PlayerInfo[playerid][pBank],PlayerInfo[playerid][pKills],PlayerInfo[playerid][pDeaths],Float:PlayerInfo[playerid][pKills]/Float:PlayerInfo[playerid][pDeaths],GetPlayerScore(playerid),Float:PlayerInfo[playerid][pUP],Float:PlayerInfo[playerid][pAKEY],Float:PlayerInfo[playerid][pBKEY]);
ShowPlayerDialog(playerid, STATS_MSG, DIALOG_STYLE_MSGBOX,"Stats",STS_MSG,"OK","");
Can anyone solve this?
Reply
#2

Use strcat.

pawn Код:
new str[128];
strcat(str, "Item1 %s\n",oyuncuismi);
strcat(str, "Item2 %i\n",GetPlayerMoney(playerid));
ShowPlayerDialog(playerid, 29, DIALOG_STYLE_LIST, "Stats", str, "Ok", "");
And so on.
Reply
#3

Instead of strcat each line, just make like 4 options/until you run out of space,
and then use strcat .
Reply
#4

Had problem again

pawn Код:
D:\Documents\0.3e Server\gamemodes\gamemode.pwn(3988) : error 035: argument type mismatch (argument 3)
D:\Documents\0.3e Server\gamemodes\gamemode.pwn(3990) : warning 202: number of arguments does not match definition
D:\Documents\0.3e Server\gamemodes\gamemode.pwn(3991) : warning 202: number of arguments does not match definition
D:\Documents\0.3e Server\gamemodes\gamemode.pwn(3991) : warning 202: number of arguments does not match definition
D:\Documents\0.3e Server\gamemodes\gamemode.pwn(3992) : warning 202: number of arguments does not match definitio
D:\Documents\0.3e Server\gamemodes\gamemode.pwn(3993) : warning 213: tag mismatch
D:\Documents\0.3e Server\gamemodes\gamemode.pwn(3993) : warning 202: number of arguments does not match definition
pawn Код:
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new str[128];
strcat(str, "{F7D358}(Name) {FFFFFF}%s\n",name);
strcat(str, "{F7D358}(Account) {FFFFFF}Language: {F7D358}English {FFFFFF}\n");
strcat(str, "{F7D358}(Money) {FFFFFF}Cash in Pocket: {F7D358}%d {FFFFFF}| {FFFFFF}Bank: {F7D358}%d\n",GetPlayerMoney(playerid),PlayerInfo[playerid][pBank]);
strcat(str, "{F7D358}(Kills/Deaths) {FFFFFF}Kills: {F7D358}%d {FFFFFF}| Deaths: {F7D358}%d {FFFFFF}| Ratio:{F7D358} %0.2f {FFFFFF}\n",PlayerInfo[playerid][pKills],PlayerInfo[playerid][pDeaths],Float:PlayerInfo[playerid][pKills]/Float:PlayerInfo[playerid][pDeaths]);
strcat(str, "{F7D358}(Experience) {FFFFFF}Level: {F7D358}%d {FFFFFF}| Upgrade Points: {F7D358}%d\n",GetPlayerScore(playerid),Float:PlayerInfo[playerid][pUP]);
strcat(str, "{F7D358}(Inventory) {FFFFFF}A_KEY: {F7D358}%d {FFFFFF}| B_KEY: {F7D358}%d\n",Float:PlayerInfo[playerid][AKEY],Float:PlayerInfo[playerid][BKEY]);
ShowPlayerDialog(playerid, STATS_MSG, DIALOG_STYLE_MSGBOX,"Stats",str,"OK","");
Reply
#5

Post line 3988,3990,3991,3992 and 3993.
Reply
#6

pawn Код:
Float:PlayerInfo[playerid][pKills]/Float:PlayerInfo[playerid][pDeaths]
Why are you using Float: here?

pawn Код:
PlayerInfo[playerid][pKills]/PlayerInfo[playerid][pDeaths]
Same issue as above
pawn Код:
PlayerInfo[playerid][pUP]
Again, same issue as above
pawn Код:
PlayerInfo[playerid][AKEY],PlayerInfo[playerid][BKEY]
Reply
#7

pawn Код:
strcat(str, "{F7D358}(Name) {FFFFFF}%s\n",name);
Make this with format, and after use strcat

Ex:
pawn Код:
format(YourString, sizeof YourString, "{F7D358}(Name) {FFFFFF}%s\n",name);
strcat(str, YourString);
Reply
#8

Quote:
Originally Posted by Logitech90
Посмотреть сообщение
Post line 3988,3990,3991,3992 and 3993.
I did it already.


Quote:
Originally Posted by Pinguinn
Посмотреть сообщение
pawn Код:
Float:PlayerInfo[playerid][pKills]/Float:PlayerInfo[playerid][pDeaths]
Why are you using Float: here?

pawn Код:
PlayerInfo[playerid][pKills]/PlayerInfo[playerid][pDeaths]
Same issue as above
pawn Код:
PlayerInfo[playerid][pUP]
Again, same issue as above
pawn Код:
PlayerInfo[playerid][AKEY],PlayerInfo[playerid][BKEY]
If I don't use Float, Its bugging and I don't know why.


Quote:
Originally Posted by Viniborn
Посмотреть сообщение
pawn Код:
strcat(str, "{F7D358}(Name) {FFFFFF}%s\n",name);
Make this with format, and after use strcat

Ex:
pawn Код:
format(YourString, sizeof YourString, "{F7D358}(Name) {FFFFFF}%s\n",name);
strcat(str, YourString);
I have guess'd that format but I didn't know its can combine with strcat.

Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)