OnDialogRespone
#1

When i try to make this code i get 26 ERRORS, before i add
Код:
if(RegistrationStep[playerid] > 0)
	    {
	      if(RegistrationStep[playerid] == 1)
	      {
evrything was work fine, can somebody help me
pawn Код:
if(dialogid == 5510 && response)
  {
    switch(listitem)
    {
   
        case 0:
      {
      if(RegistrationStep[playerid] > 0)
        {
          if(RegistrationStep[playerid] == 1)
          {
        PlayerPlaySound(playerid, 1187, 0, 0, 10);
              PlayerInfo[playerid][pSex] = 1;
              ClearChatbox(playerid, 8);
              ShowPlayerDialog(playerid,5511,DIALOG_STYLE_LIST,"Koliko imas godina","13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30","Odaberi","Odustani");
              ClearChatbox(playerid, 2);
              new maleskin;
              maleskin = random(sizeof(CivMalePeds));
              SetPlayerSkin(playerid, maleskin);
              PlayerInfo[playerid][pChar] = maleskin;
              RegistrationStep[playerid] = 2;
              return 0;
      }
      case 1:
      {
        PlayerPlaySound(playerid, 1187, 0, 0, 10);
        PlayerInfo[playerid][pSex] = 2;
              ClearChatbox(playerid, 8);
              ShowPlayerDialog(playerid,5511,DIALOG_STYLE_LIST,"Koliko imas godina","13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30","Odaberi","Odustani");
              ClearChatbox(playerid, 2);
              new femaleskin;
              femaleskin = random(sizeof(CivFemalePeds));
              SetPlayerSkin(playerid, femaleskin);
              SetPlayerSkin(playerid, femaleskin);
              PlayerInfo[playerid][pChar] = femaleskin;
              RegistrationStep[playerid] = 2;
              return 0;

      }
        }
    }
Reply
#2

BUMP
Reply
#3

You're missing two closing brackets for case 0.
Reply
#4

Can you fix that for me?
Reply
#5

pawn Код:
if(dialogid == 5510 && response)
{
  switch(listitem)
  {
   case 0:
   {
     if(RegistrationStep[playerid] > 0)
     {
      if(RegistrationStep[playerid] == 1)
      {
        PlayerPlaySound(playerid, 1187, 0, 0, 10);
        PlayerInfo[playerid][pSex] = 1;
        ClearChatbox(playerid, 8);
        ShowPlayerDialog(playerid,5511,DIALOG_STYLE_LIST,"Koliko imas godina","13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30","Odaberi","Odustani");
        ClearChatbox(playerid, 2);
        new maleskin;
        maleskin = random(sizeof(CivMalePeds));
        SetPlayerSkin(playerid, maleskin);
        PlayerInfo[playerid][pChar] = maleskin;
        RegistrationStep[playerid] = 2;
        return 0;
      }
     }
   }
   case 1:
   {
     PlayerPlaySound(playerid, 1187, 0, 0, 10);
     PlayerInfo[playerid][pSex] = 2;
     ClearChatbox(playerid, 8);
     ShowPlayerDialog(playerid,5511,DIALOG_STYLE_LIST,"Koliko imas godina","13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25  6\n27\n28\n29\n30","Odaberi","Odustani");
     ClearChatbox(playerid, 2);
     new femaleskin;
     femaleskin = random(sizeof(CivFemalePeds));
     SetPlayerSkin(playerid, femaleskin);
     SetPlayerSkin(playerid, femaleskin);
     PlayerInfo[playerid][pChar] = femaleskin;
     RegistrationStep[playerid] = 2;
     return 0;
   }
  }
}
Try this,
You only have to change te tabs because I used spaces...
Reply
#6

pawn Код:
if(dialogid == 5510 && response)
{
  new
      skin;
  switch(listitem)
  {
    case 0:
    {
      if(RegistrationStep[playerid] == 1)
      {
        PlayerPlaySound(playerid, 1187, 0, 0, 10);
        PlayerInfo[playerid][pSex] = 1;
        ClearChatbox(playerid, 8);
        ShowPlayerDialog(playerid, 5511, DIALOG_STYLE_LIST, "Koliko imas godina", "13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30", "Odaberi", "Odustani");
        ClearChatbox(playerid, 2);
        skin = random(sizeof(CivMalePeds));
        SetPlayerSkin(playerid, skin);
        PlayerInfo[playerid][pChar] = skin;
        RegistrationStep[playerid] = 2;
        return 0;
      }
    }
    case 1:
    {
      PlayerPlaySound(playerid, 1187, 0, 0, 10);
      PlayerInfo[playerid][pSex] = 2;
      ClearChatbox(playerid, 8);
      ShowPlayerDialog(playerid, 5511, DIALOG_STYLE_LIST, "Koliko imas godina", "13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30", "Odaberi", "Odustani");
      ClearChatbox(playerid, 2);
      skin = random(sizeof(CivFemalePeds));
      SetPlayerSkin(playerid, skin);
      PlayerInfo[playerid][pChar] = skin;
      RegistrationStep[playerid] = 2;
      return 0;
    }
  }
}
Check for RegistrationStep[playerid] > 0 isn't needed, because after that you're checking if RegistrationStep[playerid] is equal to 1. I've also used one variable for both skins: male and female, there isn't need for two variables.
Also, there isn't need for another SetPlayerSkin function right after the first one.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)