07.06.2013, 20:14
Hi guys,is possible to ask email at the registration process?
How?
How?
I don't see why you need to use PHP for this, you're only asking for their email on registration, but okay...
http://www.w3schools.com/php/default.asp |
if(dialogid == 2) //REGISTER
{
if(gPlayerLogged[playerid] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "SERVER: You are already logged in.");
return 1;
}
if(response)
{
if(strlen(inputtext) >= 50)
{
DisplayDialogForPlayer(playerid, 2); //register
SendClientMessage(playerid, COLOR_WHITE, "SERVER: Password is too long.");
return 0;
}
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
new namestring = strfind(sendername, "_", true);
if(namestring == -1)
{
SendClientMessage(playerid, COLOR_YELLOW, "Your name must be in the Firstname_Lastname format.");
SetTimerEx("kickp", 1000, false, "i", playerid);
return 1;
}
else
{
if(!strlen(inputtext))
{
DisplayDialogForPlayer(playerid, 2); //register
SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must enter a password.");
return 1;
}
new string[128];
format(string, sizeof(string), "%s.ini", sendername);
// if(dini_Exists(string))
if(fexist(string))
{
SendClientMessage(playerid, COLOR_YELLOW, "That name is already taken, please choose a different one.");
return 1;
}
new tmppass[64];
strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
Encrypt(tmppass);
OnPlayerRegister(playerid,tmppass);
OnPlayerLogin(playerid,tmppass,inputtext);
gPlayerAccount[playerid] = 1;
gPlayerSpawned[playerid] = 1;
SendClientMessage(playerid, COLOR_YELLOW, "Account registered, you have been logged in automatically.");
SendClientMessage(playerid, COLOR_YELLOW, "You have been automaticly refunded, thank you.");
}
}
else
{
DisplayDialogForPlayer(playerid, 2); //register
}
}
I know PHP and MySQL but I've learned it for web developing. If you need any help in PHP you can ask me.
|
if(dialogid == 2) //REGISTER
{
if(gPlayerLogged[playerid] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "SERVER: You are already logged in.");
return 1;
}
if(response)
{
if(strlen(inputtext) >= 50)
{
DisplayDialogForPlayer(playerid, 2); //register
SendClientMessage(playerid, COLOR_WHITE, "SERVER: Password is too long.");
return 0;
}
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
new namestring = strfind(sendername, "_", true);
if(namestring == -1)
{
SendClientMessage(playerid, COLOR_YELLOW, "Your name must be in the Firstname_Lastname format.");
SetTimerEx("kickp", 1000, false, "i", playerid);
return 1;
}
else
{
if(!strlen(inputtext))
{
DisplayDialogForPlayer(playerid, 2); //register
SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must enter a password.");
return 1;
}
new string[128];
format(string, sizeof(string), "%s.ini", sendername);
// if(dini_Exists(string))
if(fexist(string))
{
SendClientMessage(playerid, COLOR_YELLOW, "That name is already taken, please choose a different one.");
return 1;
}
new tmppass[64];
strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
Encrypt(tmppass);
OnPlayerRegister(playerid,tmppass);
OnPlayerLogin(playerid,tmppass,inputtext);
gPlayerAccount[playerid] = 1;
gPlayerSpawned[playerid] = 1;
SendClientMessage(playerid, COLOR_YELLOW, "Account registered, you have been logged in automatically.");
SendClientMessage(playerid, COLOR_YELLOW, "You have been automaticly refunded, thank you.");
}
}
else
{
DisplayDialogForPlayer(playerid, 2); //register
}
}
I made this: https://sampforum.blast.hk/showthread.php?tid=429512 a while back for these type of situations.. Just use it with dialogs as realcop said. You can also pass bbcodes through the email as well
|