bunny123 Posted June 13, 2012 Author Share Posted June 13, 2012 Advanced version of [this tutorial](http://www.touchofdeathforums.com/smf2/index.php/topic,78800.0.html).**Server Side**In frmServer, open the Control tab and add a new frame captioned "Restricted Access Levels". In that frame add the following checkboxes:| **Name** | **Caption** || chkPlayer | Player || chkMonitor | Monitor || chkMapper | Mapper || chkDeveloper | Developer |Open modHandleData. Search for:```      If IsMultiAccounts(Name) Then        Call AlertMsg(index, "Multiple account logins is not authorized.")        Exit Sub      End If```Under that add:``` Select Case Player(index).Access Case 0 If frmServer.chkPlayer.Value = 1 Then Call AlertMsg(index, "Your access level is currently not allowed. Try again later.") Exit Sub End If Case 1 If frmServer.chkMonitor.Value = 1 Then Call AlertMsg(index, "Your access level is currently not allowed. Try again later.") Exit Sub End If Case 2 If frmServer.chkMapper.Value = 1 Then Call AlertMsg(index, "Your access level is currently not allowed. Try again later.") Exit Sub End If Case 3 If frmServer.chkDeveloper.Value = 1 Then Call AlertMsg(index, "Your access level is currently not allowed. Try again later.") Exit Sub End If End Select```(Joost had the idea for the Select Case. Thanks!)**How to use**Check the appropriate boxes to prevent that access level from entering. Link to comment Share on other sites More sharing options...
bunny123 Posted June 13, 2012 Author Share Posted June 13, 2012 Okay, I have a feeling those aren't the Access Levels… Link to comment Share on other sites More sharing options...
abhi2011 Posted June 13, 2012 Share Posted June 13, 2012 should be in source. This is easy addition. You might want to add it where if anyone who is under access level they should be kicked. I am not sure but something like this,```for i = 1 to MAX_PLAYERSif i = isplaying thenif i.acess < # thencall CloseSocket inext``` Link to comment Share on other sites More sharing options...
Joost Posted June 13, 2012 Share Posted June 13, 2012 Hey, I kind of took the liberty to make the code a bit neater. It uses Select Case instead of all the If statements. It looks better and I'm fairly sure it's faster too.```Select Case Player(Index).Access Case 0 If frmServer.chkPlayer.Value = 1 Then Call AlertMsg(Index, "Your access level is currently not allowed. Try again later.") Exit Sub End If Case 1 If frmServer.chkMonitor.Value = 1 Then Call AlertMsg(Index, "Your access level is currently not allowed. Try again later.") Exit Sub End If Case 2 If frmServer.chkMapper.Value = 1 Then Call AlertMsg(Index, "Your access level is currently not allowed. Try again later.") Exit Sub End If Case 3 If frmServer.chkDeveloper.Value = 1 Then Call AlertMsg(Index, "Your access level is currently not allowed. Try again later.") Exit Sub End IfEnd Select``` Link to comment Share on other sites More sharing options...
bunny123 Posted June 13, 2012 Author Share Posted June 13, 2012 @Joost:> Hey, I kind of took the liberty to make the code a bit neater. It uses Select Case instead of all the If statements. It looks better and I'm fairly sure it's faster too.> > ```> Select Case Player(Index).Access> > Case 0> If frmServer.chkPlayer.Value = 1 Then> Call AlertMsg(Index, "Your access level is currently not allowed. Try again later.")> Exit Sub> End If> > Case 1> If frmServer.chkMonitor.Value = 1 Then> Call AlertMsg(Index, "Your access level is currently not allowed. Try again later.")> Exit Sub> End If> > Case 2> If frmServer.chkMapper.Value = 1 Then> Call AlertMsg(Index, "Your access level is currently not allowed. Try again later.")> Exit Sub> End If> > Case 3> If frmServer.chkDeveloper.Value = 1 Then> Call AlertMsg(Index, "Your access level is currently not allowed. Try again later.")> Exit Sub> End If> End Select> ```Thanks! I added that into the code! Link to comment Share on other sites More sharing options...
bunny123 Posted June 13, 2012 Author Share Posted June 13, 2012 Okay, I did some Item testing. The access levels I said above are correct, but there is a 5th access level. What is it? Link to comment Share on other sites More sharing options...
bunny123 Posted June 13, 2012 Author Share Posted June 13, 2012 Okay, I did some more Item testing. I made an item with access level 5 needed. I spawned it but I can't even use it. I wonder what it is. Is the 5th access level just for "No one can use it"? Link to comment Share on other sites More sharing options...
abhi2011 Posted June 14, 2012 Share Posted June 14, 2012 I think the 5th one is for GM's not sure. Link to comment Share on other sites More sharing options...
Guest Posted June 18, 2012 Share Posted June 18, 2012 Much more room for improvement. Link to comment Share on other sites More sharing options...
Joost Posted June 19, 2012 Share Posted June 19, 2012 How much of a dick are you when you go to people's first tutorial and tell them there's much room for improvement? Either do something useful or stfu bro. Link to comment Share on other sites More sharing options...
abhi2011 Posted June 19, 2012 Share Posted June 19, 2012 @joost was a suggestion nothing more. Link to comment Share on other sites More sharing options...
TheOneAndOnly Posted June 24, 2012 Share Posted June 24, 2012 Thanks for this Link to comment Share on other sites More sharing options...
bunny123 Posted September 9, 2012 Author Share Posted September 9, 2012 Also, I want to mention one thing. This code doesn't have support for disconnecting users that have joined previously and are now not allowed to enter… **yet**. If you want to disconnect them, just kick them out. Link to comment Share on other sites More sharing options...
Ganjika Posted November 25, 2012 Share Posted November 25, 2012 Is this so that people who AREANT checked cant get into the server whatsoever as long as those are checked? Link to comment Share on other sites More sharing options...
abhi2011 Posted November 25, 2012 Share Posted November 25, 2012 This is so that ppl won't be allowed to play unless the Access Level is = access checked. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now