How to make these two work together?
#1

pawn Код:
//OnPlayerConnect
    new name[24], ip[16];
    GetPlayerIp(playerid, ip, sizeof ip);
    GetPlayerName(playerid, name, sizeof name);
    for(new id; < 24; id++)
    {
        if(!strmcp(name,TempBans[id][BannedName]))
        {
            SendClientMessage(playerid, Red,"Your ban has not expired");
            Kick(playerid);
            return 1;
        }

        if(!strmcp(ip,TempBans[id][BannedIP]))
        {
            SendClientMessage(playerid, Red, "Your ban has not expired");
            Kick(playerid);
            return 1;
        }
    }
    return 1;


pawn Код:
//OnPlayerConnect
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    if(fexist(Path(playerid)))
    {
        INI_ParseFile(Path(playerid),"loadaccount_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid,login,DIALOG_STYLE_INPUT,"Login","Welcome Back!\n Please login with your password","Login","Quit");
    }
    else
    {
        ShowPlayerDialog(playerid,register,DIALOG_STYLE_INPUT,"Register","Welcome! This account is not registered.\nEnter your own password to create a new account.\nPlease enter the password!","Register","Quit");
        return 1;
    }
    return 1;
}
Can't really figure it out since I am getting shit loads of errors.
Reply
#2

pawn Код:
new name[24], ip[16];
    GetPlayerIp(playerid, ip, sizeof ip);
    GetPlayerName(playerid, name, sizeof name);
    for(new id; < 24; id++)
    {
        if(!strmcp(name,TempBans[id][BannedName]))
        {
            SendClientMessage(playerid, Red,"Your ban has not expired");
            Kick(playerid);
            return 1;
        }

        if(!strmcp(ip,TempBans[id][BannedIP]))
        {
            SendClientMessage(playerid, Red, "Your ban has not expired");
            Kick(playerid);
            return 1;
        }
   }
    if(fexist(Path(playerid)))
    {
        INI_ParseFile(Path(playerid),"loadaccount_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid,login,DIALOG_STYLE_INPUT,"Login","Welcome Back!\n Please login with your password","Login","Quit");
    }
    else
    {
        ShowPlayerDialog(playerid,register,DIALOG_STYLE_INPUT,"Register","Welcome! This account is not registered.\nEnter your own password to create a new account.\nPlease enter the password!","Register","Quit");
        return 1;
    }
return 1;
}
Reply
#3

Код:
(250) :error 029: invalid expression, assumed zero
(250) : warning 215: expression has no effect
(250) : error 001: expected token: ")", but found ";"
(250) : error 036: empty statement
(250) : fatal error 107: too many error messages on one line
pawn Код:
//code 250
 for(new id; < 24; id++)
Reply
#4

That's your reading through files, I don't think I can help you with that, ,maybe someone else can
Reply
#5

You was right, however it should be
pawn Код:
for(new id = 0; id < 24; id++)
not
pawn Код:
for(new id; < 24; id++)
I recommend using foreach as it's a ton easier.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)