Scores won't save!
#3

PHP код:
if(INI_Open(getINI(playerid))) {
            
INI_WriteInt("Cash"GetPlayerMoney(playerid));
            
INI_WriteInt("Admin"PlayerInfo[playerid][pAdmin]);
            
INI_WriteInt("FirstTime"gFirstTimeHasJoined[playerid]);
            
INI_WriteInt("Skin"GetPlayerSkin(playerid));
            
INI_Save();
            
INI_Close();
        } 
PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[]) {
        switch(
dialogid) {
            case 
DIALOG_REGISTER: {
                if(!
response) return Kick(playerid);
                if(
response) {
                    if(!
strlen(inputtext)) return ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_INPUT""WHITE"Registering...",""RED"You have entered an invalid password.\n"WHITE"Type your password below to register a new account.","Register","Quit");
                    if(
INI_Open(getINI(playerid))) {
                        
INI_WriteString("Password",inputtext);
                        
INI_WriteInt("Cash"0);
                        
INI_WriteInt("Admin"0);
                        
INI_WriteInt("Score"0);
                        
INI_WriteInt("FirstTime"0);
                        
INI_WriteInt("Skin"0);
                        
INI_Save();
                        
INI_Close();
                        
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_INPUT,""WHITE"Login",""WHITE"Type your password below to login.","Login","Quit");
                    }
                }
            } case 
DIALOG_LOGIN: {
                if(!
response) return Kick playerid );
                if(
response) {
                    if(!
strlen(inputtext)) return ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_INPUT""WHITE"Login",""RED"You have entered an invalid password.\n"WHITE"Type your password below to login.","Login","Quit");
                    if(
INI_Open(getINI(playerid))) {
                        
INI_ReadString(PlayerInfo[playerid][pPass],"Password",20);
                        if(
strcmp(inputtext,PlayerInfo[playerid][pPass],false)) {
                            
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_INPUT""WHITE"Login",""RED"You have entered an incorrect password.\n"WHITE"Type your password below to login.","Login","Quit");
                        }
                        
GivePlayerMoneyplayeridINI_ReadInt"Cash" ) );
                        
PlayerInfo[playerid][pAdmin] = INI_ReadInt("Admin");
                        
SetPlayerScoreplayeridINI_ReadInt"Score" ) );
                        
gFirstTimeHasJoined[playerid] = INI_ReadInt("FirstTime");
                        
gPlayerSkinForEver[playerid] = INI_ReadInt("Skin");
                        
INI_Close();
                    }
                }
            }
        }
        return 
1;
    } 
PHP код:
    enum pInfo
    
{
        
pPass,
        
pCash,
        
pAdmin,
    } 
Reply


Messages In This Thread
Scores won't save! - by samtey - 13.08.2011, 18:12
Re: Scores won't save! - by Libra_PL - 13.08.2011, 18:21
AW: Scores won't save! - by samtey - 13.08.2011, 18:29
Re: Scores won't save! - by Riddick94 - 13.08.2011, 18:30
AW: Scores won't save! - by samtey - 13.08.2011, 18:32
Re: Scores won't save! - by Riddick94 - 13.08.2011, 18:36
Re: Scores won't save! - by Kush - 14.08.2011, 09:42
AW: Scores won't save! - by samtey - 14.08.2011, 09:57
Re: AW: Scores won't save! - by Kush - 14.08.2011, 10:05
AW: Scores won't save! - by samtey - 14.08.2011, 10:15

Forum Jump:


Users browsing this thread: 1 Guest(s)