Dialog won't open, strcat issue I think.
#2

So basically you want Pdialogstring[playerid] to store the text of dialogstring but you insert the text to the old one. You need to reset Pdialogstring[playerid] first and then use strcat; although a macro is easier:
pawn Код:
#define strcpy(%0,%1,%2) strcat((%0[0] = '\0', %0), %1, %2)
and change:
pawn Код:
if(n == 0)
{
    format(dialogstring, sizeof(dialogstring), ""#COL_WHITE"CRIME: "#COL_RED"%s", PlayerArrests[n][ar_cr]);
    strcat(Pdialogstring[playerid], dialogstring, 200);
}
else
{
    format(dialogstring, sizeof(dialogstring), "%s\n"#COL_WHITE"CRIME: "#COL_RED"%s", dialogstring, PlayerArrests[n][ar_cr]);
    strcat(Pdialogstring[playerid], dialogstring, 200);
}
to:
pawn Код:
if(n == 0) format(dialogstring, sizeof(dialogstring), ""#COL_WHITE"CRIME: "#COL_RED"%s", PlayerArrests[n][ar_cr]);
else format(dialogstring, sizeof(dialogstring), "%s\n"#COL_WHITE"CRIME: "#COL_RED"%s", dialogstring, PlayerArrests[n][ar_cr]);
strcpy(Pdialogstring[playerid], dialogstring, 200);
Reply


Messages In This Thread
Dialog won't open, strcat issue I think. - by Dokins - 30.03.2014, 19:25
Re: Dialog won't open, strcat issue I think. - by Konstantinos - 30.03.2014, 20:02
Re: Dialog won't open, strcat issue I think. - by Dokins - 30.03.2014, 20:04

Forum Jump:


Users browsing this thread: 1 Guest(s)