Player registers with value of 0 in variable
#1

Hey, when ever someone connects to my server for some reason their pLSPD variable is set to value of 5..

my code here should set them to 0 when they first register and then after they login it loads what it was (Wont be changed unless invited to lspd faction)

pawn Код:
if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
                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,"Admin",0);
                INI_WriteInt(File,"LSPD",0);
                INI_WriteInt(File,"Kills",0);
                INI_WriteInt(File,"Deaths",0);
                INI_Close(File);
                ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_GREEN"Success!","Your account is now registered!\n You have been automatically logged in."COL_GREEN"","Ok","");
                TogglePlayerSpectating(playerid, 0);
                                                         PlayerInfo[playerid][pAdmin] = 0;
                SetSpawnInfo(playerid, 0, 0,1958.3783, 1343.1572, 15.3746,0,0,0,0,0,0,0);
                SpawnPlayer(playerid);
            }
        }
I made the variable loose so you can easily identify it, Thanks
Reply
#2

You make them save with the value of 5, but not actually setting them. So basically replace those with their variables' names that way..

pawn Код:
Cash[playerid] = 0;
LSPD[playerid] = 0;
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)