y_ini big problem
#1

hi i have a problem...register/login dialogs work only for id 0..idk whats the problem,tell me what part of script i need to post so you can see whats the problem...please help
Reply
#2

Show us the contents of your OnDialogResponse callback.
Reply
#3

PHP Code:
    switch(dialogid)
    {
        case 
REGISTER:
        {
            if(!
response) return Kick(playerid);
            if(
response)
            {
                if(!
strlen(inputtext)) return ShowPlayerDialog(playeridREGISTERDIALOG_STYLE_INPUT"{B0B0B0}Register","{FFFFFF}Type your password below to register a new account.","Register","Cancel");
                new 
INI:File INI_Open(UserPath(playerid));
                
INI_SetTag(File,"data");
                
INI_WriteInt(File,"Password",udb_hash(inputtext));
                
INI_WriteInt(File,"Cash",0);
                
INI_WriteInt(File,"Score",0);
                
INI_WriteInt(File,"Skin",0);
                
INI_WriteInt(File,"Admin",0);
                
INI_WriteInt(File,"Kills",0);
                
INI_WriteInt(File,"Deaths",0);
                
INI_WriteInt(File,"Online",0);
                
INI_WriteInt(File,"Locked",0);
                
INI_WriteInt(File,"SaveSkin",0);
                
INI_Close(File);
            }
        }
        case 
LOGIN:
        {
            if(!
response) return Kick(playerid);
            if(
response)
            {
                if(
udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra true, .extra playerid);
                    
OnPlayerLogin(playerid);
                }
                else
                {
                    
ShowPlayerDialog(playeridLOGINDIALOG_STYLE_INPUT,"{B0B0B0}Login",""RED"You have entered an incorrect password.\n{FFFFFF}Welcome back to {33E82A}San Andreas Stunt Evolution.{FFFFFF}\n\nThis account is already registered.Login to access your account:","Login","Cancel");
                }
                return 
1;
            }
        }
    } 
Reply
#4

It's not about OnDialogResponse. It's about OnPlayerConnect since id>0 doesn't get Dialog at all
Reply
#5

Give us OnPlayerConnect, that thing with ShowPlayerDialog( ... ); for Login/Register
Reply
#6

PHP Code:
    if(fexist(UserPath(playerid)))
    {
        
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra true, .extra playerid);
        
ShowPlayerDialog(playeridLOGINDIALOG_STYLE_INPUT,"{B0B0B0}Login","{FFFFFF}Welcome back to {33E82A}San Andreas Stunt Evolution.{FFFFFF}\n\nThis account is already registered.Login to access your account:","Login","Cancel");
    }
    else
    {
        
ShowPlayerDialog(playeridREGISTERDIALOG_STYLE_INPUT,"{B0B0B0}Register","{FFFFFF}Type your password below to register a new account.","Register","Cancel");
    } 
Reply
#7

Can you tell us what happens exactly? Does the dialog show for everyone and it's just when the player selects something in the dialog that it doesn't work, or does the dialog not show for everyone in the first place?
Reply
#8

only player id 0 can see register/login dialog..
Reply
#9

pawn Code:
if(!fexist(UserPath(playerid))) ShowPlayerDialog(playerid, REGISTER, DIALOG_STYLE_INPUT,"{B0B0B0}Register","{FFFFFF}Type your password below to register a new account.","Register","Cancel");
else ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT,"{B0B0B0}Login","{FFFFFF}Welcome back to {33E82A}San Andreas Stunt Evolution.{FFFFFF}\n\nThis account is already registered.Login to access your account:","Login","Cancel");
And put this:
pawn Code:
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
In your Login Dialog.....
Reply
#10

In what context is this snippet of code that you posted?

pawn Code:
if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT,"{B0B0B0}Login","{FFFFFF}Welcome back to {33E82A}San Andreas Stunt Evolution.{FFFFFF}\n\nThis account is already registered.Login to access your account:","Login","Cancel");
    }
    else
    {
        ShowPlayerDialog(playerid, REGISTER, DIALOG_STYLE_INPUT,"{B0B0B0}Register","{FFFFFF}Type your password below to register a new account.","Register","Cancel");
    }
I can't really see how that wouldn't show for anyone but ID 0, assuming that the value of playerid is being passed correctly in whatever callback you're using.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)