Problems with strings!
#1

can anyone explain to me why do i get dat error as always and help me to get da code in a right way here it is:

error
pawn Код:
warning 219: local variable "string" shadows a variable at a preceding level
.
Code

pawn Код:
if(dialogid == DIALOG_LOGIN){
        if(response == 0 && ServerInfo[MustLogin] == 1){
            Kick(playerid);}
        if(response){
            cmd_login(playerid,inputtext);
            if (!udb_Exists(PlayerName2(playerid))) return SendClientMessage(playerid,COLOR_RED,"ACCOUNT: Account doesn't exist, please use '/register [password]'.");
            if (udb_CheckLogin(PlayerName2(playerid),inputtext)){
                new file[256], tmp3[100], string[256], lname[MAX_PLAYER_NAME];
                GetPlayerName(playerid,lname,sizeof(lname));
                format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(lname));
                GetPlayerIp(playerid,tmp3,100);
                dini_Set(file,"ip",tmp3);
                LoginPlayer(playerid);
                PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
                if(PlayerInfo[playerid][Level] >= 1) {
                    format(string,sizeof(string),"You have succesfully logged in to your account as Administrator (Level: %s)",PlayerInfo[playerid][Level]);
                    return SendClientMessage(playerid, green, string);
                } else return SendClientMessage(playerid, green, "You have logged in to your account!");
            } else ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"{FF0000}SFTDM - Login Dialog", "{FFFFFF}You had entred a wrong password, try again:", "OK", "Leave");}
        return 1;}
but please i will be thankful if you explained much am not here to get da code without making something, thanks in advance!
Reply
#2

delete new string[256]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)