register & login in box? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: register & login in box? (
/showthread.php?tid=135698)
register & login in box? -
Ben147 - 21.03.2010
I'm using /register and /login commands
and i saw in 0.3 anew register and login system in box..
like this:
That"s my scripts how can ichange it to the box?
Код:
if (strcmp(cmd, "/register", true) ==0 )
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "SERVER: You are already logged in.");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "users/%s.ini", sendername);
new File: hFile = fopen(string, io_read);
if (hFile)
{
SendClientMessage(playerid, COLOR_YELLOW, "That Username is already taken, please choose a different one.");
fclose(hFile);
return 1;
}
new tmppass[64];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /register [password]");
return 1;
}
strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
//Encrypt(tmppass);
OnPlayerRegister(playerid,tmppass);
}
return 1;
}
Код:
if (strcmp(cmd, "/login", true) ==0 || strcmp(cmd, "/l", true) ==0)
{
if(IsPlayerConnected(playerid))
{
new tmppass[64];
if(gPlayerLogged[playerid] == 1)
{
SendClientMessage(playerid, TEAM_AZTECAS_COLOR, "SERVER: You are already logged in.");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, TEAM_AZTECAS_COLOR, "USAGE: (/l)ogin [password]");
return 1;
}
strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
//Encrypt(tmppass);
OnPlayerLogin(playerid,tmppass);
}
return 1;
}
Re: register & login in box? -
_soad_ - 21.03.2010
i think its very easy.
I never tryed but..
But create first a Dialog how this one.
https://sampwiki.blast.hk/wiki/How_to_Create_a_Dialog
[Use the Dialog Style Input ] and then put the Command under the Input.
Re: register & login in box? -
Ben147 - 21.03.2010
Yes i saw but how i change my commands to dialog can anyone help me?
Re: register & login in box? -
Ben147 - 21.03.2010
Anyone?
Re: register & login in box? -
Anwix - 21.03.2010
You're still using the 0.3 beta?
Re: register & login in box? -
Ben147 - 21.03.2010
0.3a