Need Help please
#1

Hello,I got a script that any player enter with any admin name he can use all command before writing password ,can I get help plz ?
Reply
#2

Create a Logged boolean and block all commands if player is not logged in.
Reply
#3

I take it you're using y_ini. I used to do this a lot when I started scripting too.

Basically, you just need to reset the variables after you've done INI_ParseFile. Or the better alternative would be, to load ONLY your password on OnPlayerConnect, and then the rest of the file when the player logs in.

Example:
Your code is currently something like:
pawn Код:
public OnPlayerConnect(playerid)
{
    INI_ParseFile(Userfile(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
    //Load the player's password, but this also loads everything else like 'Admin' and 'Money' etc.
    ShowPlayerDialog(playerid, ... //Show the login dialog.
    return 1;
}
Instead, you should have:
pawn Код:
public OnPlayerConnect(playerid)
{
    INI_ParseFile(Userfile(playerid), "LoadPassword_%s", .bExtra = true, .extra = playerid);
    //Load ONLY the password, in a separate function.
    ShowPlayerDialog(playerid, ... //show login dialog
    return 1;
}

//When the player logs in:
INI_ParseFile(Userfile(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
//Load the user's entire file once they log in.
Or another option is (NOT RECOMMENDED):
pawn Код:
public OnPlayerConnect(playerid)
{
    INI_ParseFile(Userfile(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
    //Load the whole user's file.
    PlayerInfo[playerid][Admin] = 0; //Reset the admin level to 0.
    ShowPlayerDialog(playerid, ... //Show the login dialog
    return 1;
}
If you don't understand, or don't think you can do this yourself, feel free to send me your script and I will do it for you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)