How can i change this code to a input dialog menu when people join my server.
so people dont need to do /register to join.
Код:
dcmd_register(playerid, cmdtext[]) {
#pragma unused cmdtext
new sendername[MAX_PLAYER_NAME], string[256];
new idx, tmp[256];
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[ playerid ][ pLogged ] ==1) return SendClientMessage(playerid, COLOR_RED, "Database: You are already logged in.");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "/Accounts/%s.ini", sendername);
new File: hFile = fopen(string, io_read);
if (hFile)
{
SendClientMessage(playerid, COLOR_RED, "Database: This name is registered already.");
fclose(hFile);
return 1;
}
new tmppass[64];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Database: USAGE: /register (password)");
return 1;
}
strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
Encrypt(tmppass);
OnPlayerRegister(playerid,tmppass);
}
return 1;
}