Register cmd - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Register cmd (
/showthread.php?tid=424190)
Register cmd -
Fernado Samuel - 21.03.2013
Removed, thanks for the help!
Re: Register cmd -
kamzaf - 21.03.2013
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.
Re: Register cmd -
Fernado Samuel - 21.03.2013
Removed
Re: Register cmd -
kamzaf - 21.03.2013
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;
}
Re: Register cmd -
Fernado Samuel - 21.03.2013
Removed