Jump to content
MakeWebGames

Auto Mail + Username change add on ....


Recommended Posts

Hi, sorry if this is posted but i cannot find it anywhere, it may be cimple for whoever is reading this but i have just recently started working with mccodes and i am looking for a function to go in the register page which will automatically send the user an email when they first login which will welcome them to the game and give them a few tips.

Secondly when changing a username in preferences it seems 2 people can have the same name. I would like to know how to fix this so it displays: "This username has already been taken". Something like that,

any help would be much appreciated, thank you.

Link to comment
Share on other sites

For MC v2, welcome mail

$time = time();
$db->query("INSERT INTO mail VALUES ('',0,0,$i,$time,'mail subject here','mail text here')");
$db->query("UPDATE users SET new_mail=new_mail+1 WHERE userid=$i");

 

Add this after the insert query that adds the players information...

Now, I'm not sure if this is what you need. As you have not stated which version of MC you are working with.

Link to comment
Share on other sites

Add this in the name change function in preferences.

 

$nCheck = mysql_query("SELECT `userid` FROM `users` WHERE (`username`= '".mysql_real_escape_string(strip_tags($_POST['ENTERVALUEHERE']))."')");

if(mysql_num_rows($nCheck))
{
     	echo ('This username has been taken, please try again. 
<a href = "preferences.php">Go Back</a>');
     	exit($h->endpage());
}

 

Hasn't been tested, just wrote it here, make sure to change the "$_POST['ENTERVALUEHERE']" in the query to the actual value as I don't have mccodes.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...