20.06.2010, 11:29
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 0 && response)
{
if(inputtext[0] != '\0')
{
for(new i = 0, b = GetMaxPlayers(); i < b; i++)
{
new string[128];
format(string, sizeof(string), "OBJECTIVE: %s", inputtext);
ShowBriefMessageForPlayer(i, string, 5000); // its just a basic textdraw at the bottom of the screen shown for all!
}
return 1;
}
SendClientMessage(playerid, YOUR_COLOR, "Please enter an objective into the box.");
}
return 1;
}
Anyway, that should work.
Checked first char of inputtext to check if it's null, not the whole string.
GetMaxPlayers loop, Efficient, but a bit slower, due to MAX_PLAYERS being a constant, and GetMaxPlayers being a function-
Although I only called the function once and stored the result into the varible 'b'.
Changed 'string' lenght to 128 cells, the MAXIMUM text output, so 256 is a waste.