help strcat under ondialogresponse
#1

Hi. can someone please help me make strcat work on ondialogresponse? because the dialog I was making is too long so I had to use strcat.

If you noticed I've added new string after else


Код:
        }
  		else new str[256];
		strcat(str, ""CSERVER"• "CWHITE"Wide Option 1 \n"CSERVER"• "CWHITE"Wide Option 2 \n"CSERVER"• "CWHITE"Wide Option 3 \n"CSERVER"• "CWHITE"Wide Option 3 \n"CSERVER"• "CWHITE" Wide Option 4 \n");
		strcat(str, ""CSERVER"• "CWHITE"Wide Option 5 \n"CSERVER"• "CWHITE"Wide Option 6 \n"CSERVER"• "CWHITE"Wide Option 7");
		ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_LIST, ""CSERVER"Options", str, "Choose", "Close");
        return 1;
    }
After compiling
Quote:

error 003: declaration of a local variable must appear in a compound block
error 017: undefined symbol "str"
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
fatal error 107: too many error messages on one line

those errors are from this line

Quote:

else new str[256];

Reply
#2

wtf?
pawn Код:
else
new str[256];
Just use 1 strcat and add option 5, 6, 7 to the first one, It should work
Reply
#3

Quote:
Originally Posted by Rudy_
Посмотреть сообщение
wtf?
pawn Код:
else
new str[256];
Just use 1 strcat and add option 5, 6, 7 to the first one, It should work
Same line same errors showing.


Here is the what I did

Код:
else
new str[256];
strcat(str, ""CSERVER"• "CWHITE"Wide Option 1 \n"CSERVER"• "CWHITE"Wide Option 2 \n"CSERVER"• "CWHITE"Wide Option 3 \n"CSERVER"• "CWHITE"Wide Option 3 \n"CSERVER"• "CWHITE" Wide Option 4 \n""CSERVER"• "CWHITE"Wide Option 5 \n"CSERVER"• "CWHITE"Wide Option 6 \n"CSERVER"• "CWHITE"Wide Option 7");
ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_LIST, ""CSERVER"Options", str, "Choose", "Close");
thanks nvm i got it.

Quote:

else
{
new str[256];
strcat(str, ""CSERVER"• "CWHITE"Reset Weapons \n"CSERVER"• "CWHITE"Melee \n"CSERVER"• "CWHITE"Pistols \n"CSERVER"• "CWHITE"Sub-Machine Guns \n"CSERVER"• "CWHITE"Rifle's \n"CSERVER"• "CWHITE"Assault \n"CSERVER"• "CWHITE"Shotgun's \n"CSERVER"• "CWHITE"Misc");
ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_LIST, ""CSERVER"Weapon Menu", str, "Choose", "Close");
return 1;
}

Reply
#4

ok show a bit of more code, Upper part
Reply
#5

Quote:
Originally Posted by Rudy_
Посмотреть сообщение
ok show a bit of more code, Upper part
solved it thanks +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)