Register cmd
#1

Removed, thanks for the help!
Reply
#2

pawn Код:
CMD:register(playerid, params[])
{
     ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "You must enter a password to register on the server!", "Okay", "Cancel");
     return 1;
}
dcmd:

pawn Код:
dcmd_register(playerid, params[])
{
     ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "You must enter a password to register on the server!", "Okay", "Cancel");
     return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(register, 8, cmdtext);
    return 0;
}
any more help just pm me or type here.
Reply
#3

Removed
Reply
#4

I don't know if your using R6 or not, but it seems u are. So here's how to do it with sscanf and zcmd.
pawn Код:
CMD:register(playerid, params[])
{
    new password[20], query[256], name[MAX_PLAYER_NAME];
    if(sscanf(params, "s[20]", password)) return SendClientMessage(playerid, red, "USAGE: /register [password]");
    if(strlen(password) <= 4 || strlen(password) > 20) return SendClientMessage(playerid, red, "The password you entered is not strong enough.  You must insert a password between 4-20 characters!");
        GetPlayerName(playerid, name, MAX_PLAYER_NAME);
     mysql_real_escape_string(name, name);
    format(query, 256, "SELECT `name_of_player_in_db` FROM `your_table_name` WHERE `name_of_player_in_db` = '%s'", name);
    mysql_query(query);
    mysql_store_result();
    if(mysql_num_rows() > 0)
    {
        SendClientMessage(playerid, red, "Your account is already registered on the server!");
    }
    else
    {
        mysql_real_escape_string(password, escpass);
        MySQL_Register(playerid, escpass);
    }
    mysql_free_result();
    return 1;
}
Reply
#5

Removed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)