PDA

View Full Version : help strcat


AgusZ
13/01/2015, 09:55 AM
why (Hey) not showing ?

https://fbcdn-sphotos-h-a.akamaihd.net/hphotos-ak-xpf1/v/t34.0-12/10934191_652801694828674_1257691674_n.jpg?oh=90052 a999ac5569c4abb0c5fbfa8ac10&oe=54B75D9E&__gda__=1421315022_120a8da122e68675762691d927b35e0 1

CMD:credits( playerid, params[ ] )
{
new strtext[900];
new string[128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName,sizeof(pName));
strcat(string, "Hey/n");
strcat(string, "\n");
strcat(string, "\n");
format(string, 128, "***your name %s.", pName);
strcat(strtext, string);
ShowPlayerDialog(playerid, DIALOG_CREDITS, DIALOG_STYLE_MSGBOX, "{F81414}Credits", strtext, "Ok", "");
PlayerPlaySound(playerid, 1183, 0, 0, 0);
return 1;
}

JuanStone
13/01/2015, 10:05 AM
A string for the final format and another for the local format, perhaps that is the mistake, even-i have my doubts because the format you've done in the end, this should work.

CMD:credits(playerid, params[])
{
new string[55], format[39], pName[24];
GetPlayerName(playerid, pName, 24);
format(format, sizeof(format), "***your name %s.", pName);

strcat(string, "Hey\n");
strcat(string, "\n");
strcat(string, "\n");
strcat(string, format);
ShowPlayerDialog(playerid, DIALOG_CREDITS, DIALOG_STYLE_MSGBOX, "{F81414}Credits", string, "Ok", "");
PlayerPlaySound(playerid, 1183, 0, 0, 0);
return true;
}

Threshold
13/01/2015, 10:34 AM
CMD:credits(playerid, params[])
{
new string[55], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "Hey\n\n\n***your name %s.", pName);
ShowPlayerDialog(playerid, DIALOG_CREDITS, DIALOG_STYLE_MSGBOX, "{F81414}Credits", string, "Ok", "");
PlayerPlaySound(playerid, 1183, 0, 0, 0);
return true;
}
...

CalvinC
13/01/2015, 10:37 AM
There's no reason to use strcat, just put it in the format.