help strcat
#1

why (Hey) not showing ?



Код:
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;
}
Reply
#2

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.

pawn Код:
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;
}
Reply
#3

pawn Код:
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;
}
...
Reply
#4

There's no reason to use strcat, just put it in the format.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)