NPC Compatibility
#1

I've made a NPC walking down the street ...

It works but when I try to login it won't show the Login Dialog , also with Registering.

On RequestClass and OnPlayerConnect I Have
pawn Код:
IsPlayerNPC(playerid) return 1;
and it still don't work.
Reply
#2

The dialog doesn't show for you, or what do you mean, for the NPC or you? xD
Because it shouldn't show for the NPC.
Reply
#3

It doesn't show for me
Reply
#4

May you show me the part where the script shows the dialog, OnPlayerConnect or what else.
Reply
#5

On OnPlayerConnect it calls a timer to show the dialog:

pawn Код:
public OnPlayerConnect(playerid)
{
    if(IsPlayerNPC(playerid)) return 1;
    if(fexist(UserPath(playerid)))
    {
        ClearChatbox(playerid, 10);
        LoginIntro(playerid);
                IntroTimer = SetTimer("IntroLog",3000,1);
    }
    else
    {
        ClearChatbox(playerid, 10);
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,"{F81414}                      Register","Upisi sifru da se registrujeљ.","Register","Odustani");
    }
    return 1;
}
Here is the Timer:
pawn Код:
public IntroLog(playerid)
{
    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"Login","Upisi lozinku da nastavis sa igrom.","Login","Odustani");
    KillTimer(IntroTimer);
    return 1;
}
Reply
#6

small bump need help
Reply
#7

pawn Код:
//---Global variable.
new IntroTimer[MAX_PLAYERS];

//---OnPlayerConnect.
public OnPlayerConnect(playerid)
{
    if(IsPlayerNPC(playerid)) return 1;
    if(fexist(UserPath(playerid)))
    {
        ClearChatbox(playerid, 10);
        LoginIntro(playerid);
                IntroTimer[playerid] = SetTimerEx("IntroLog",3000,false,"i",playerid);
    }
    else
    {
        ClearChatbox(playerid, 10);
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,"{F81414}                      Register","Upisi sifru da se registrujeљ.","Register","Odustani");
    }
    return 1;
}

//---Callback called.
public IntroLog(playerid)
{
    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); //I don't know if this is correct, never used Y_INI.
    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"Login","Upisi lozinku da nastavis sa igrom.","Login","Odustani");
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)