Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Feature]Admin Panel
#1
Some of this i scripted by my self others was from help. And some i looked at other sources and got ideas and some i just ripped.
Hope you enjoy

Components
Microsoft Tagged Dialog Control
Check it then

Create A Form Called frmAdmin
Create A SSTab with these properties
Tabs - 4, Tabs Per Row - 4

Then Name Them. I named mine Admin, Map, Sprite, Develop

Admin First

Create A Label Called btnBan
This is a ban button
Put this inside

Code:
If GetPlayerAccess(MyIndex) >= ADMIN_CREATOR Then
        Call SendBan(Trim$(txtPlayer.Text))
    Else: Auth = "You are not authorized to carry out that action"
         Call AddText(Auth, BrightRed)
    End If

Create a button called btnWarpMeTo
This is Warp To Me
Put This Inside

Code:
If GetPlayerAccess(MyIndex) >= ADMIN_MAPPER Then
        Call WarpMeTo(Trim$(txtPlayer.Text))
    Else: Auth = "You are not authorized to carry out that action"
        Call AddText(Auth, BrightRed)
    End If

Create a button called btnKick
This is Kick
Put This Inside

Code:
If GetPlayerAccess(MyIndex) >= ADMIN_MONITER Then
        Call SendKick(frmAdmin.txtPlayer.Text)
        Else: Auth = "You are not authorized to carry out that action"
        Call AddText(Auth, BrightRed)
    End If

Create a Button called btnSetAccess
This is Set Access
Put This inside

Code:
If GetPlayerAccess(MyIndex) >= ADMIN_CREATOR Then
      Call SendSetAccess(Trim$(txtPlayerAdmin.Text), Trim$(txtAccess.Text))
   Else: Auth = "You are not authorized to carry out that action"
         Call AddText(Auth, BrightRed)
   End If

Create a label called Access Level
Then create a txtbox called txtAccess

Create a label called Player Name
Then Create a txtbox called txtPlayerAdmin


Now on to Map Tab
Create a button called btnLOC
This is Location
put this inside

Code:
If GetPlayerAccess(MyIndex) >= ADMIN_MAPPER Then
        Call SendRequestLocation
    Else: Auth = "You are not authorized to carry out that action"
        Call AddText(Auth, BrightRed)
    End If

Create a button called btnRespawn
This is Respawn
put this inside

Code:
If GetPlayerAccess(MyIndex) >= ADMIN_MAPPER Then
        Call SendMapRespawn
    Else: Auth = "You are not authorized to carry out that action"
        Call AddText(Auth, BrightRed)
    End If

Create a button called btnWarpto
This is Warp To
put this inside

Code:
If GetPlayerAccess(MyIndex) >= ADMIN_MAPPER Then
        Call WarpTo(Val(txtMap.Text))
    Else: Auth = "You are not authorized to carry out that action"
        Call AddText(Auth, BrightRed)
    End If

Create a label called Map Number
then create a txtbox called txtMap

Now onto sprite tab
create a button called btnSprite
This is Set Sprite
then put this inside it

Code:
If GetPlayerAccess(MyIndex) >= ADMIN_MAPPER Then
        Call SendSetSprite(Val(txtSprite.Text))
    Else: Auth = "You are not authorized to carry out that action"
        Call AddText(Auth, BrightRed)
    End If

create a button called btnPlayerSprite
This is Set Player Sprite
then put this inside it

Code:
If GetPlayerAccess(MyIndex) >= ADMIN_MAPPER Then
        If Trim$(txtPlayer.Text)  vbNullString Then
            If Trim$(txtSprite.Text)  vbNullString Then
                Call SendSetPlayerSprite(Trim$(txtPlayer.Text), Trim$(txtSprite.Text))
            End If
        End If
    Else: Auth = "You are not authorized to carry out that action"
    Call AddText(Auth, BrightRed)
    End If

create a label called player name
then create a txtbox called txtPlayer

create a label called Sprite number
then create a txtbox called txtSprite

now on to the develop tab
create a button called btnMapeditor
This is Map Editor
then put this inside

Code:
If GetPlayerAccess(MyIndex) >= ADMIN_MAPPER Then
        Call SendRequestEditMap
         frmMirage.Width = 14175
    Else: Auth = "You are not authorized to carry out that action"
             Call AddText(Auth, BrightRed)
    End If

create a button called btneditspell
This is Spell Editor
then put this inside

Code:
If GetPlayerAccess(MyIndex) >= ADMIN_DEVELOPER Then
        Call SendRequestEditSpell
    Else: Auth = "You are not authorized to carry out that action"
        Call AddText(Auth, BrightRed)
    End If

create a button called btnedititem
This is Item Editor
then put this inside

Code:
If GetPlayerAccess(MyIndex) >= ADMIN_DEVELOPER Then
        Call SendRequestEditItem
    Else: Auth = "You are not authorized to carry out that action"
         Call AddText(Auth, BrightRed)
    End If

create a button called btnEditShops
This is Shop Editor
then put this inside

Code:
If GetPlayerAccess(MyIndex) >= ADMIN_DEVELOPER Then
        Call SendRequestEditShop
    Else: Auth = "You are not authorized to carry out that action"
         Call AddText(Auth, BrightRed)
    End If

Create a button called btnEditNPC
This is NPC Editor
then put this inside

Code:
If GetPlayerAccess(MyIndex) >= ADMIN_DEVELOPER Then
        Call SendRequestEditNpc
    Else: Auth = "You are not authorized to carry out that action"
        Call AddText(Auth, BrightRed)
    End If


To put this as a hot key for f1 go to KeyDown in frmMirage
then put this inside

Code:
If KeyCode = vbKeyF1 then
    frmAdminPanel.visible = true
    end if

Hope you guys like
Tell me what you think plz

Admin form
XD
http://www.mediafire.com/?mdim4mozmom
Reply
#2
Nice job. I'm working on my own right now. Gonna use this as reference though. =D
Reply
#3
thanks
and i created cause skillzalot wanted too know how to do it
so i just made one so everyone dont go around asking
Reply
#4
I'm also working on one at the moment. So far, I have scripted:

WarpMeTo
WarpToMe
WarpTo
Kill
Ban
Kick

I'm working on others though. =D. Thanks for the tut, this will come useful as a reference.
Reply
#5
You haven't scripted anything Tongue

Scripting is what you do in Elysium's sadscript files.

This is programming. You're a real man now.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#6
Following this tut I made it and im wondering what do i add to make it if I click f1 and im an admin it brings up this panel
Reply
#7
Open the 'KeyDown' subroutine in frmMirage then add this:

Code:
If KeyCode = vbKeyF1 then
frmAdminPanel.visible = true
end if
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#8
thanks robin i forgot to add that part ill put that in
Reply
#9
doomteam1 Wrote:thanks robin i forgot to add that part ill put that in

I'd make it require an access also. So people don't just find out about it randomly.(Even though the buttons require access)

EDIT:

Code:
If KeyCode = vbKeyF1 then
        If GetPlayerAccess(MyIndex) >= ADMIN_MAPPER Then
            frmAdminPanel.visible = true
            If GetPlayerAccess(MyIndex) < ADMIN_CREATOR Then
                btnBan.Enabled = False
                btnSetAccess.Enabled = False
            End If
            If GetPlayerAccess(MyIndex) < ADMIN_DEVELOPER Then
                btnEditSpell.Enabled = False
                bntEditItem.Enabled = False
                btnEditShop.Enabled = False
                btnEditNPC.Enabled = False
            End If
            If GetPlayerAccess(MyIndex) < ADMIN_MONITOR Then
                btnKick.Enabled = False
            End If
            If GetPlayerAccess(MyIndex) < ADMIN_MAPPER Then
                btnWarpMeTo.Enabled = False
                btnLoc.Enabled = False
                btnRespawn.Enabled = False
                btnWarpTo.Enabled = False
                btnSetSprite.Enabled = False
                btnPlayerSprite.Enabled = False
                btnMapEditor.Enabled = False
            End If
        End If
    End If

Untested. SHOULD work?
Reply
#10
It should work, but for MS4, you have to put the name of the form before the button. SO it would be like:

Code:
frmadminpanel.btnWarpMeTo.Enabled = False
Reply
#11
Sorry for the double post, but I found a bug. For the map editor button, you have to add:

Code:
frmMirage.Width = 14175
Under: SendRequestEditMap. As, the Map Editor is actually built into Mirage, but the width doesn't display it, unless told to expand.
Reply
#12
i forgot about that
i removed all the width things cause i resized my window
and didnt want to put it in
so i just made my mapeditor a picbox and placed over screen
Reply
#13
doomteam1 Wrote:i forgot about that
i removed all the width things cause i resized my window
and didnt want to put it in
so i just made my mapeditor a picbox and placed over screen

Nevertheless, others haven't. So I'd suggest adding that to the tut somewhere. Thanks.
Reply
#14
where would i add it cause idk because i dont have it
Reply
#15
Add it under the MapEditor Button. Inside the button, I mean.
Reply
#16
There i fixed it thx
Reply
#17
I added my
Admin.frm for those who want it
Reply
#18
ummm, i get an error with the BTNban, it highlights ".Text" and says "method or data member not found" but Ive looked it over and it should work fine.
Reply
#19
Probably because a button doesn't have a Text property. Well, it does, but it's called Caption
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)