30.03.2014, 20:02
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:
and change:
to:
pawn Код:
#define strcpy(%0,%1,%2) strcat((%0[0] = '\0', %0), %1, %2)
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);
}
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);