why dosnt this work?
#1

this dosnt register it dosnt create a dini
i dont get any errors or warnings
pawn Код:
dcmd_register(playerid,params[])
{
    #pragma unused params
    new file[128],n[MAX_PLAYER_NAME];
    GetPlayerName(playerid,n,MAX_PLAYER_NAME);
    format(file,sizeof(file),"MyAdmin/Users/%s.ini",n);
    if(dini_Exists(file)) return SendClientMessage(playerid,YELLOW,"You are already registered!");
    if(PInfo[playerid][Regged] == 1) return SendClientMessage(playerid,LIGHTBLUE,"You are already registered!");
    if(PInfo[playerid][Logged] == 1) return SendClientMessage(playerid,red,"You are already registered, and logged in!");
    ShowPlayerDialog(playerid,10,DIALOG_STYLE_INPUT,"Register","Welcome \n We see you want to register\nPlease enter a password below","Register","Cancel");
    return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new file[128],n[MAX_PLAYER_NAME];
    GetPlayerName(playerid,n,MAX_PLAYER_NAME);
    format(file,sizeof(file),"MyAdmin/Users/%s.ini",n);
    if(dialogid == 9)
    {
        dini_Create(file);
        dini_Set(file,"Password",inputtext);
        dini_IntSet(file,"Regged",1);
        dini_IntSet(file,"Logged",0);
        dini_IntSet(file,"Level",0);
        dini_IntSet(file,"Muted",0);
        dini_IntSet(file,"Jailed",0);
        dini_IntSet(file,"Frozen",0);
        dini_IntSet(file,"Skin",0);
        dini_IntSet(file,"Dueling",0);
        dini_IntSet(file,"Score",GetPlayerScore(playerid));
        SendClientMessage(playerid,LIGHTBLUE,"Congratulations, you have just registered, please /login");
        PInfo[playerid][Regged] = 1;
        }
    return 1;
}
Reply
#2

You have the folders?
Reply
#3

ofc i hade it all in just one command
but i wanted to change in to a dialog
but in the cmd was working, why isnt it working in the dialog?
Reply
#4

Quote:
Originally Posted by dark_clown
Посмотреть сообщение
ofc i hade it all in just one command
but i wanted to change in to a dialog
but in the cmd was working, why isnt it working in the dialog?
Am i blind or does it have to be 'if(dialogid==10)'?
Reply
#5

well yah ur not blind why?
i putted
Quote:

ShowPlayerDialog(playerid,10,DIALOG_STYLE_INPUT,"R egister","Welcome \n We see you want to register\nPlease enter a password below","Register","Cancel");

does it matter any number i put?
Reply
#6

Quote:
Originally Posted by dark_clown
Посмотреть сообщение
well yah ur not blind why?
i putted

does it matter any number i put?
It has to be the number of the dialog that you created. Here it is the number 10.

[gay]This forum requires that you wait 120 seconds between posts. Please try again in 30 seconds.[/gay]
Reply
#7

where do i create?
pawn Код:
new dialog 10?
on the top?
but the dialog appears it just dosnt create the dini
edit: 100 posts
Reply
#8

Quote:
Originally Posted by dark_clown
Посмотреть сообщение
where do i create?
pawn Код:
new dialog 10?
on the top?
but the dialog appears it just dosnt create the dini
It doesn't create the dini because the dialogid is not 9.

You've got:

pawn Код:
if(dialogid == 9)
but due to the fact that you used

pawn Код:
ShowPlayerDialog(playerid,10,DIALOG_STYLE_INPUT,"Register","Welcome \n We see you want to register\nPlease enter a password below","Register","Cancel");
it has to be like

pawn Код:
if(dialogid == 10)
This might help you, too. Watch the second parameter.
Reply
#9

lol i saw it but still it dosnt work
Reply
#10

pawn Код:
dcmd_register(playerid,params[])
{
    #pragma unused params
    new file[128],n[MAX_PLAYER_NAME];
    GetPlayerName(playerid,n,MAX_PLAYER_NAME);
    format(file,sizeof(file),"MyAdmin/Users/%s.ini",n);
    if(dini_Exists(file)) return SendClientMessage(playerid,YELLOW,"You are already registered!");
    if(PInfo[playerid][Regged] == 1) return SendClientMessage(playerid,LIGHTBLUE,"You are already registered!");
    if(PInfo[playerid][Logged] == 1) return SendClientMessage(playerid,red,"You are already registered, and logged in!");
    ShowPlayerDialog(playerid,10,DIALOG_STYLE_INPUT,"Register","Welcome \n We see you want to register\nPlease enter a password below","Register","Cancel");
    return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new file[128],n[MAX_PLAYER_NAME];
    GetPlayerName(playerid,n,MAX_PLAYER_NAME);
    format(file,sizeof(file),"MyAdmin/Users/%s.ini",n); //Make sure you have those folders
    if(dialogid == 10) //It must be 10, like they told you.
    {
        if(response) //You forgot this.
        {
            dini_Create(file);
            dini_Set(file,"Password",inputtext);
            dini_IntSet(file,"Regged",1);
            dini_IntSet(file,"Logged",0);
            dini_IntSet(file,"Level",0);
            dini_IntSet(file,"Muted",0);
            dini_IntSet(file,"Jailed",0);
            dini_IntSet(file,"Frozen",0);
            dini_IntSet(file,"Skin",0);
            dini_IntSet(file,"Dueling",0);
            dini_IntSet(file,"Score",GetPlayerScore(playerid));
            SendClientMessage(playerid,LIGHTBLUE,"Congratulations, you have just registered, please /login");
            PInfo[playerid][Regged] = 1;
        }
        else
        {
            SendClientMessage(playerid,LIGHTBLUE,"You canceled the register!");
        }
    }
    return 1;
}
Reply
#11

Quote:
Originally Posted by The_Moddler
Посмотреть сообщение
pawn Код:
dcmd_register(playerid,params[])
{
    #pragma unused params
    new file[128],n[MAX_PLAYER_NAME];
    GetPlayerName(playerid,n,MAX_PLAYER_NAME);
    format(file,sizeof(file),"MyAdmin/Users/%s.ini",n);
    if(dini_Exists(file)) return SendClientMessage(playerid,YELLOW,"You are already registered!");
    if(PInfo[playerid][Regged] == 1) return SendClientMessage(playerid,LIGHTBLUE,"You are already registered!");
    if(PInfo[playerid][Logged] == 1) return SendClientMessage(playerid,red,"You are already registered, and logged in!");
    ShowPlayerDialog(playerid,10,DIALOG_STYLE_INPUT,"Register","Welcome \n We see you want to register\nPlease enter a password below","Register","Cancel");
    return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new file[128],n[MAX_PLAYER_NAME];
    GetPlayerName(playerid,n,MAX_PLAYER_NAME);
    format(file,sizeof(file),"MyAdmin/Users/%s.ini",n); //Make sure you have those folders
    if(dialogid == 10) //It must be 10, like they told you.
    {
        if(response) //You forgot this.
        {
            dini_Create(file);
            dini_Set(file,"Password",inputtext);
            dini_IntSet(file,"Regged",1);
            dini_IntSet(file,"Logged",0);
            dini_IntSet(file,"Level",0);
            dini_IntSet(file,"Muted",0);
            dini_IntSet(file,"Jailed",0);
            dini_IntSet(file,"Frozen",0);
            dini_IntSet(file,"Skin",0);
            dini_IntSet(file,"Dueling",0);
            dini_IntSet(file,"Score",GetPlayerScore(playerid));
            SendClientMessage(playerid,LIGHTBLUE,"Congratulations, you have just registered, please /login");
            PInfo[playerid][Regged] = 1;
        }
        else
        {
            SendClientMessage(playerid,LIGHTBLUE,"You canceled the register!");
        }
    }
    return 1;
}
it still dosnt create the dini
Reply
#12

please help
Reply
#13

pawn Код:
dcmd_register(playerid,params[])
{
    #pragma unused params
    new file[128],n[MAX_PLAYER_NAME];
    GetPlayerName(playerid,n,MAX_PLAYER_NAME);
    format(file,sizeof(file),"MyAdmin/Users/%s.ini",n);
    if(dini_Exists(file)) return SendClientMessage(playerid,YELLOW,"You are already registered!");
   {
    if(PInfo[playerid][Regged] == 1) return SendClientMessage(playerid,LIGHTBLUE,"You are already registered!");
    if(PInfo[playerid][Logged] == 1) return SendClientMessage(playerid,red,"You are already registered, and logged in!");
    }
    else
    {
         ShowPlayerDialog(playerid,10,DIALOG_STYLE_INPUT,"Register","Welcome \n We see you want to register\nPlease enter a password below","Register","Cancel");
     }
    return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new file[128],n[MAX_PLAYER_NAME];
    GetPlayerName(playerid,n,MAX_PLAYER_NAME);
    format(file,sizeof(file),"MyAdmin/Users/%s.ini",n); //Make sure you have those folders
    if(dialogid == 10) //It must be 10, like they told you.
    {
        if(response) //You forgot this.
        {
            dini_Create(file);
            dini_Set(file,"Password",inputtext);
            dini_IntSet(file,"Regged",1);
            dini_IntSet(file,"Logged",0);
            dini_IntSet(file,"Level",0);
            dini_IntSet(file,"Muted",0);
            dini_IntSet(file,"Jailed",0);
            dini_IntSet(file,"Frozen",0);
            dini_IntSet(file,"Skin",0);
            dini_IntSet(file,"Dueling",0);
            dini_IntSet(file,"Score",GetPlayerScore(playerid));
            SendClientMessage(playerid,LIGHTBLUE,"Congratulations, you have just registered, please /login");
            PInfo[playerid][Regged] = 1;
        }
        else
        {
            SendClientMessage(playerid,LIGHTBLUE,"You canceled the register!");
        }
    }
    return 1;
}
Reply
#14

Make sure that you have the folders with their capital letters and well spelled!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)