Ladmin4v2 with dialog login, register.
#1

Hey there again.

I found edited ladmin4v2 script in this forum who have dialog register system --> here it is http://pastebin.com/HF2QEFmL

But problems starts when i want to use another filterscript with dialog [Yes i checked both scripts - dont have same dialog id]. Whats wrong with it?
I hope you can tell me. Its kinda wierd its gives no warnings and stuff.

Thanks!
Reply
#2

As it seems noone can help me? iiih.
Reply
#3

Hello,
Tell us what problem are you facing while using Ladmin dialog registration system and your other dialogs?
Reply
#4

Finally.

With this system everything is okey except for that than other dialogs doesnt work. For example i installed house system with dialogs. then typed /buyhouse dialog opens but when i choose next step whatever it is it doesnt work.
After pushing continue nothing happens.

Thanks!
Reply
#5

Hello,
Check If The Problem Is In Your Housing System..
Reply
#6

Quote:

Check If The Problem Is In Your Housing System..

Yes check if it is in it
Reply
#7

nope, that was only example. if ladmin script is last in the filterscript line then house system works and ladmin doesnt. its something with dialog response i guess. But im noob in scriptin and stuff.. but im trying my best to get everything i need to work. Sadly for now this isnt working.
Reply
#8

Hello,
Post Your (OnDialogResponce) Callback Please.
Reply
#9

This is the same as i gave in the first post only in Latvian language.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == logindialog && response)
{
    new dialogstr[256];
    new pame[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pame, sizeof(pame));
    if (PlayerInfo[playerid][LoggedIn] == 1) return SendClientMessage(playerid,red,"Jus jau esat registrejies un piesledzies.");
    if (!udb_Exists(PlayerName2(playerid))) return SendClientMessage(playerid,red,"Sis akaunts jau eksiste, ludzu izmantojiet '/login'.");
    if (strlen(inputtext)==0) return format(dialogstr,sizeof(dialogstr),"{FFFFFF}Tavs lietotajvards ir registrets! Ievadi paroli, lai varetu spelet!"), ShowPlayerDialog(playerid, logindialog, 3, "{FF0000}Pieslegties:{FFFFFF} %s", dialogstr, "Labi", "Atcelt");
    if (udb_CheckLogin(PlayerName2(playerid),inputtext))
    {
        new file[256], tmp3[100], string[128];
        format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(PlayerName2(playerid)) );
        GetPlayerIp(playerid,tmp3,100);
        dini_Set(file,"ip",tmp3);
        LoginPlayer(playerid);
        PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
        if(PlayerInfo[playerid][Level] > 0) {
            format(string,sizeof(string),"Veiksmigi piesledzies. (Limenis: %d)", PlayerInfo[playerid][Level] );
            return SendClientMessage(playerid,green,string);
        } else return SendClientMessage(playerid,green,"Veiksmigi piesledzies.");
    }
    else {
        PlayerInfo[playerid][FailLogin]++;
        printf("LOGIN: %s neizdevas pieslegties, nepareiza parole (%s) Meginajums: (%d)", PlayerName2(playerid), inputtext, PlayerInfo[playerid][FailLogin] );
        if(PlayerInfo[playerid][FailLogin] == MAX_FAIL_LOGINS)
        {
            new string[128]; format(string, sizeof(string), "%s tika izmests (Neizdevas pieslegties)", PlayerName2(playerid) );
            SendClientMessageToAll(COLOR_GREY, string);
            print(string);
            Kick(playerid);
        }
        return SendClientMessage(playerid,red,"Neizdevas pieslegties, nepareiza parole!");
    }
}
if(dialogid == registerdialog && response)
{
    new dialogstr[256];
    new pame[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pame, sizeof(pame));
    if (PlayerInfo[playerid][LoggedIn] == 1) return SendClientMessage(playerid,red,"Jus jau esat registrejies un piesledzies.");
    if (udb_Exists(PlayerName2(playerid))) return SendClientMessage(playerid,red,"Sis akaunts jau eksiste, ludzu izmantojiet '/login'.");
    if (strlen(inputtext) == 0) return format(dialogstr,sizeof(dialogstr),"{FFFFFF}Lietotajvards{00FF00} `%s` {FFFFFF}nav registrets, lai registretos ievadiet paroli!", pame), ShowPlayerDialog(playerid, registerdialog, DIALOG_STYLE_INPUT, "{FF0000}Registracija.", dialogstr, "Labi", "Atcelt");
    if (strlen(inputtext) < 4 || strlen(inputtext) > 20) return format(dialogstr,sizeof(dialogstr),"{FFFFFF}Lietotajvards{00FF00} `%s` {FFFFFF}nav registrets, lai registretos ievadiet paroli!", pame), ShowPlayerDialog(playerid, registerdialog, DIALOG_STYLE_INPUT, "{FF0000}Registracija.", dialogstr, "Labi", "Atcelt");
    if (udb_Create(PlayerName2(playerid),inputtext))
 {
        new file[256],name[MAX_PLAYER_NAME], tmp3[100];
        new strdate[20], year,month,day;    getdate(year, month, day);
        GetPlayerName(playerid,name,sizeof(name)); format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(name));
        GetPlayerIp(playerid,tmp3,100); dini_Set(file,"ip",tmp3);
//      dini_Set(file,"password",params);
        dUserSetINT(PlayerName2(playerid)).("registered",1);
        format(strdate, sizeof(strdate), "%d/%d/%d",day,month,year);
        dini_Set(file,"RegisteredDate",strdate);
        dUserSetINT(PlayerName2(playerid)).("loggedin",1);
        dUserSetINT(PlayerName2(playerid)).("banned",0);
        dUserSetINT(PlayerName2(playerid)).("level",0);
        dUserSetINT(PlayerName2(playerid)).("LastOn",0);
        dUserSetINT(PlayerName2(playerid)).("money",0);
        dUserSetINT(PlayerName2(playerid)).("kills",0);
        dUserSetINT(PlayerName2(playerid)).("deaths",0);
        dUserSetINT(PlayerName2(playerid)).("Pistolskill",0);
        dUserSetINT(PlayerName2(playerid)).("SilencedPistolskill",0);
        dUserSetINT(PlayerName2(playerid)).("DesertEagleskill",0);
        dUserSetINT(PlayerName2(playerid)).("Shotgunskill",0);
        dUserSetINT(PlayerName2(playerid)).("Sawnoffskill",0);
        dUserSetINT(PlayerName2(playerid)).("Spas12shotgunskill",0);
        dUserSetINT(PlayerName2(playerid)).("MicroUziskill",0);
        dUserSetINT(PlayerName2(playerid)).("MP5skill",0);
        dUserSetINT(PlayerName2(playerid)).("AK47skill",0);
        dUserSetINT(PlayerName2(playerid)).("M4skill",0);
        dUserSetINT(PlayerName2(playerid)).("Sniperskill",0);
        dUserSetINT(PlayerName2(playerid)).("hours",0);
        dUserSetINT(PlayerName2(playerid)).("minutes",0);
        dUserSetINT(PlayerName2(playerid)).("seconds",0);
        PlayerInfo[playerid][LoggedIn] = 1;
        PlayerInfo[playerid][Registered] = 1;
        SendClientMessage(playerid, green, "Jus tikat registrets un automatiski pievienots.");
        PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
        return 1;
    }
    return 1;
}
return 1;
}
Reply
#10

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == logindialog && response)
{
    new dialogstr[256];
    new pame[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pame, sizeof(pame));
    if (PlayerInfo[playerid][LoggedIn] == 1) return SendClientMessage(playerid,red,"Jus jau esat registrejies un piesledzies.");
    if (!udb_Exists(PlayerName2(playerid))) return SendClientMessage(playerid,red,"Sis akaunts jau eksiste, ludzu izmantojiet '/login'.");
    if (strlen(inputtext)==0) return format(dialogstr,sizeof(dialogstr),"{FFFFFF}Tavs lietotajvards ir registrets! Ievadi paroli, lai varetu spelet!"), ShowPlayerDialog(playerid, logindialog, 3, "{FF0000}Pieslegties:{FFFFFF} %s", dialogstr, "Labi", "Atcelt");
    if (udb_CheckLogin(PlayerName2(playerid),inputtext))
    {
        new file[256], tmp3[100], string[128];
        format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(PlayerName2(playerid)) );
        GetPlayerIp(playerid,tmp3,100);
        dini_Set(file,"ip",tmp3);
        LoginPlayer(playerid);
        PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
        if(PlayerInfo[playerid][Level] > 0) {
            format(string,sizeof(string),"Veiksmigi piesledzies. (Limenis: %d)", PlayerInfo[playerid][Level] );
            return SendClientMessage(playerid,green,string);
        } else return SendClientMessage(playerid,green,"Veiksmigi piesledzies.");
    }
    else {
        PlayerInfo[playerid][FailLogin]++;
        printf("LOGIN: %s neizdevas pieslegties, nepareiza parole (%s) Meginajums: (%d)", PlayerName2(playerid), inputtext, PlayerInfo[playerid][FailLogin] );
        if(PlayerInfo[playerid][FailLogin] == MAX_FAIL_LOGINS)
        {
            new string[128]; format(string, sizeof(string), "%s tika izmests (Neizdevas pieslegties)", PlayerName2(playerid) );
            SendClientMessageToAll(COLOR_GREY, string);
            print(string);
            Kick(playerid);
        }
        return SendClientMessage(playerid,red,"Neizdevas pieslegties, nepareiza parole!");
    }
}
if(dialogid == registerdialog && response)
{
    new dialogstr[256];
    new pame[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pame, sizeof(pame));
    if (PlayerInfo[playerid][LoggedIn] == 1) return SendClientMessage(playerid,red,"Jus jau esat registrejies un piesledzies.");
    if (udb_Exists(PlayerName2(playerid))) return SendClientMessage(playerid,red,"Sis akaunts jau eksiste, ludzu izmantojiet '/login'.");
    if (strlen(inputtext) == 0) return format(dialogstr,sizeof(dialogstr),"{FFFFFF}Lietotajvards{00FF00} `%s` {FFFFFF}nav registrets, lai registretos ievadiet paroli!", pame), ShowPlayerDialog(playerid, registerdialog, DIALOG_STYLE_INPUT, "{FF0000}Registracija.", dialogstr, "Labi", "Atcelt");
    if (strlen(inputtext) < 4 || strlen(inputtext) > 20) return format(dialogstr,sizeof(dialogstr),"{FFFFFF}Lietotajvards{00FF00} `%s` {FFFFFF}nav registrets, lai registretos ievadiet paroli!", pame), ShowPlayerDialog(playerid, registerdialog, DIALOG_STYLE_INPUT, "{FF0000}Registracija.", dialogstr, "Labi", "Atcelt");
    if (udb_Create(PlayerName2(playerid),inputtext))
 {
        new file[256],name[MAX_PLAYER_NAME], tmp3[100];
        new strdate[20], year,month,day;    getdate(year, month, day);
        GetPlayerName(playerid,name,sizeof(name)); format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(name));
        GetPlayerIp(playerid,tmp3,100); dini_Set(file,"ip",tmp3);
//      dini_Set(file,"password",params);
        dUserSetINT(PlayerName2(playerid)).("registered",1);
        format(strdate, sizeof(strdate), "%d/%d/%d",day,month,year);
        dini_Set(file,"RegisteredDate",strdate);
        dUserSetINT(PlayerName2(playerid)).("loggedin",1);
        dUserSetINT(PlayerName2(playerid)).("banned",0);
        dUserSetINT(PlayerName2(playerid)).("level",0);
        dUserSetINT(PlayerName2(playerid)).("LastOn",0);
        dUserSetINT(PlayerName2(playerid)).("money",0);
        dUserSetINT(PlayerName2(playerid)).("kills",0);
        dUserSetINT(PlayerName2(playerid)).("deaths",0);
        dUserSetINT(PlayerName2(playerid)).("Pistolskill",0);
        dUserSetINT(PlayerName2(playerid)).("SilencedPistolskill",0);
        dUserSetINT(PlayerName2(playerid)).("DesertEagleskill",0);
        dUserSetINT(PlayerName2(playerid)).("Shotgunskill",0);
        dUserSetINT(PlayerName2(playerid)).("Sawnoffskill",0);
        dUserSetINT(PlayerName2(playerid)).("Spas12shotgunskill",0);
        dUserSetINT(PlayerName2(playerid)).("MicroUziskill",0);
        dUserSetINT(PlayerName2(playerid)).("MP5skill",0);
        dUserSetINT(PlayerName2(playerid)).("AK47skill",0);
        dUserSetINT(PlayerName2(playerid)).("M4skill",0);
        dUserSetINT(PlayerName2(playerid)).("Sniperskill",0);
        dUserSetINT(PlayerName2(playerid)).("hours",0);
        dUserSetINT(PlayerName2(playerid)).("minutes",0);
        dUserSetINT(PlayerName2(playerid)).("seconds",0);
        PlayerInfo[playerid][LoggedIn] = 1;
        PlayerInfo[playerid][Registered] = 1;
        SendClientMessage(playerid, green, "Jus tikat registrets un automatiski pievienots.");
        PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
        }
        }
 return 1;
        }
   return 0;
}
}
Test This.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)