Nooo I'm pretty sure im missing something, HELP!
#4

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;
}
Much better code, really don't know why people use strlen, MAX_PLAYERS and 256 cells -.- *Looks at DJDHAN*

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.
Reply


Messages In This Thread
Nooo I'm pretty sure im missing something, HELP! - by Lorenc_ - 20.06.2010, 11:03
Re: Nooo I'm pretty sure im missing something, HELP! - by DJDhan - 20.06.2010, 11:17
Re: Nooo I'm pretty sure im missing something, HELP! - by ToPhrESH - 20.06.2010, 11:20
Re: Nooo I'm pretty sure im missing something, HELP! - by Joe_ - 20.06.2010, 11:29
Re: Nooo I'm pretty sure im missing something, HELP! - by DJDhan - 20.06.2010, 11:30
Re: Nooo I'm pretty sure im missing something, HELP! - by Lorenc_ - 20.06.2010, 21:11

Forum Jump:


Users browsing this thread: 2 Guest(s)