Dialog Issues
#1

Error
Код:
C:\Users\Robert\Desktop\Server Bundle\gamemodes\crpnew.pwn(1443) : error 017: undefined symbol "DIALOG_BASE"
C:\Users\Robert\Desktop\Server Bundle\gamemodes\crpnew.pwn(1447) : error 017: undefined symbol "pPass"
C:\Users\Robert\Desktop\Server Bundle\gamemodes\crpnew.pwn(1447) : warning 215: expression has no effect
C:\Users\Robert\Desktop\Server Bundle\gamemodes\crpnew.pwn(1447) : error 001: expected token: ";", but found "]"
C:\Users\Robert\Desktop\Server Bundle\gamemodes\crpnew.pwn(1447) : error 029: invalid expression, assumed zero
C:\Users\Robert\Desktop\Server Bundle\gamemodes\crpnew.pwn(1447) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) //the callback
{
  if (dialogid == DIALOG_BASE + 1) //checking dialogid
  {
    if (response == 1) //making sure "Login" was pressed
    {
      if (!strcmp(inputtext, pPass[playerid])) //checking if it is the players password
      {
        LoginPlayer(playerid); //calling a function to log him in
      }
      else //incorrect password
      {
        ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_INPUT, "Invalid Password", "Invalid Password, try again", "Login", "Cancel"); //shows another dialog, with the same dialogid.
        LogAttempts[playerid]++; //increments a variable to know how many time he has tried to login
        if (LogAttempts[playerid] >=2) //is it greater then or equal to 2?
        {
          SendClientMessage(playerid, 0xFFFFFFFF, "Too many attempts, bye!"); //tells him what is about to happen
          SetTimerEx("kicker", 200, 0, "i", playerid); //if you can't figure out what this is, see below
        }
      }
    }
    else //pressed "Cancel"
    {
      SendClientMessage(playerid, 0xFFFFFFFF, "well if you aren't going to login, LEAVE"); //some message
      SendClientMessage(playerid, 0xFFFFFFFF, "okay, i will do it for you."); //another
      SetTimerEx("kicker", 200, 0, "i", playerid); //a timer that allows the player to see the messages before he is kicked.
    }
    return 1; //returns 1, it has been handled
  }
  return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) //the callback
{
  if (dialogid == DIALOG_BASE + 1) //checking dialogid
  {
    if (response == 2) //making sure "Login" was pressed
    {
      if (!strcmp(inputtext, pPass[playerid])) //checking if it is the players password
      {
        RegisterPlayer(playerid); //calling a function to register him
      }

      }
    }
    else //pressed "Cancel"
    {
      SendClientMessage(playerid, 0xFFFFFFFF, "well if you aren't going to register, LEAVE"); //some message
      SendClientMessage(playerid, 0xFFFFFFFF, "okay, i will do it for you."); //another
      SetTimerEx("kicker", 200, 0, "i", playerid); //a timer that allows the player to see the messages before he is kicked.
    }
    return 1; //returns 1, it has been handled
  }
  return 0;
}
Reply
#2

pawn Код:
#define DIALOG_BASE 3213
now for the pPass error, perhaps maybe put it in ur playerinfo enum, Example
pawn Код:
enum pInfo
{
    pPass
}
new PlayerInfo[MAX_PLAYERS][pInfo];
Reply
#3

okay applied that and i get this
Код:
C:\Users\Robert\Desktop\Server Bundle\gamemodes\crpnew.pwn(595) : warning 201: redefinition of constant/macro (symbol "pInfo")
C:\Users\Robert\Desktop\Server Bundle\gamemodes\crpnew.pwn(1452) : error 028: invalid subscript (not an array or too many subscripts): "pPass"
C:\Users\Robert\Desktop\Server Bundle\gamemodes\crpnew.pwn(1452) : warning 215: expression has no effect
C:\Users\Robert\Desktop\Server Bundle\gamemodes\crpnew.pwn(1452) : error 001: expected token: ";", but found "]"
C:\Users\Robert\Desktop\Server Bundle\gamemodes\crpnew.pwn(1452) : error 029: invalid expression, assumed zero
C:\Users\Robert\Desktop\Server Bundle\gamemodes\crpnew.pwn(1452) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#4

in here if (dialogid == DIALOG_BASE + 1
why are you going
DIALOG_BASE + 1
*edit
and it looks like you are checking the players password when they try and register
also i dont think DIALOG_BASE + 1 is correct so try printing its id to see what it is when this function runs
umm and you will need to declare a pass word var somewhere
Код:
 new pPass[MAX_PLAYERS][24];
Reply
#5

Thats just the bit of code. Im still learning dialogs and i am modifying a gm that has a odd login/register system. Idk do you see and issue with it?
Reply
#6

if (dialogid == DIALOG_BASE) I can;t remember right now but I think Something is missing there
{
// Variables here
Return 1;
}
Reply
#7

Idk what to put there. There is currently already a login/register system would you all like to see that?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)