OnPlayerDialogRespons problem
#1

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
  new family;
    if(dialogid == 1)
    {
    if(listitem == 0)
        {
          family = 1;
        }
        if(listitem == 1)
        {
          family = 2;
        }
        if(listitem == 2)
        {
          family = 3;
        }
        if(listitem == 3)
        {
          family = 4;
    }
        if(listitem == 4)
        {
          family = 5;
        }
        if(listitem == 5)
        {
          family = 6;
        }
        if(listitem == 6)
        {
          family = 7;
        }
        if(listitem == 7)
        {
          family = 8;
        }
        if(listitem == 8)
        {
          family = 9;
    }
        if(listitem == 9)
        {
          family = 10;
        }
        if(listitem == 10)
        {
          family = 11;
        }
        if(listitem == 11)
        {
          family = 12;
        }
        if(listitem == 12)
        {
          family = 13;
        }
        if(listitem == 13)
        {
          family = 14;
    }
    PlayerPlaySound(playerid, 1132, 0.0, 0.0, 0.0);
    ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Gang Creation - 2nd step","Please enter the name of the gang you want to create below.","Done","Cancel");
    }
    if(dialogid == 2)
  {
        if(!strlen(inputtext))
    {
      SendClientMessage(playerid, 0xFF0000FF, "Gang Creation setup canceled");
      return 1;
    }
    if(!response)
    {
        SendClientMessage(playerid, 0xFF0000FF, "Gang Creation setup canceled");
        return 1;
    }
        new idx;
        new length = strlen(inputtext);
        while ((idx < length) && (inputtext[idx] <= ' '))
        {
          idx++;
        }
        new offset = idx;
        new result[64];
        while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
        {
          result[idx - offset] = inputtext[idx];
          idx++;
        }
        result[idx - offset] = EOS;
        PlayerPlaySound(playerid, 1132, 0.0, 0.0, 0.0);
    strmid(FamilyInfo[family][FamilyName], result, 0, strlen(result), 255);
        SaveFamilies();
    SendClientMessage(playerid, COLOR_WHITE, "You've adjusted your Family's Name.");
    }
    return 1;
}
When I put the command /families which shows the families, the new family name always comes in the 1st slot no matter which slot I choose. Everything is ok except in this function.
Reply
#2

Please help me, it's very urgent.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)