/setpass
#4

pawn Код:
//Here is your tutorial

CMD:setpass(playerid, params[])
{
    new op[20], np[20], np1[20], playername[25];
    if (sscanf(params, "sss", op, np, np1)) return SendClientMessage2(playerid, COLOR_ORANGE, "Usage: /setpass [old pass] [new pass] [confirm new pass]");// You can use s[128] if you are using sscanf2
    GetPlayerName(playerid, playername, MAX_PLAYER_NAME); //Getting playername
    if (num_hash(op) != "Define your user's password from users file") return SendClientMessage2(playerid, COLOR_RED, "Error: You must type your current password correctly!");
    if (strlen(np) < 6 || strlen(np) > 18) return SendClientMessage2(playerid, COLOR_RED, "Error: Your new password must be between 6-18 characters!");
    if (strcmp(np, np1, false) != 0) return SendClientMessage2(playerid, COLOR_RED, "Error: You must confirm your new password correctly!");
    //Here you must update your password in userfile
    /*example */ dini_IntSet(playerfile(playerid), "Password", num_hash(op1));
    SendClientMessage2(playerid, COLOR_YELLOW, "You have successfully changed your password.");
    return 1;
}
Reply


Messages In This Thread
/setpass (I will +1 you) - by saffierr - 31.08.2015, 23:14
Re: /setpass - by trablon - 01.09.2015, 02:07
Re: /setpass - by Abagail - 01.09.2015, 02:44
Re: /setpass - by IceBilizard - 01.09.2015, 04:54
Re: /setpass - by Bomber07 - 01.09.2015, 08:37

Forum Jump:


Users browsing this thread: 2 Guest(s)