| Mirage Source http://miragesource.net/forums/ |
|
| [Feature]Admin Panel http://miragesource.net/forums/viewtopic.php?f=183&t=4332 |
Page 1 of 69 |
| Author: | Doomy [ Tue Sep 16, 2008 1:32 am ] |
| Post subject: | [Feature]Admin Panel |
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 |
|
| Author: | DarkC [ Tue Sep 16, 2008 1:37 am ] |
| Post subject: | Re: Admin Panel |
Nice job. I'm working on my own right now. Gonna use this as reference though. =D |
|
| Author: | Doomy [ Tue Sep 16, 2008 1:40 am ] |
| Post subject: | Re: Admin Panel |
thanks and i created cause skillzalot wanted too know how to do it so i just made one so everyone dont go around asking |
|
| Author: | Nean [ Tue Sep 16, 2008 1:44 am ] |
| Post subject: | Re: Admin Panel |
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. |
|
| Author: | Robin [ Tue Sep 16, 2008 9:44 am ] |
| Post subject: | Re: Admin Panel |
You haven't scripted anything Scripting is what you do in Elysium's sadscript files. This is programming. You're a real man now. |
|
| Author: | skillzalot [ Tue Sep 16, 2008 10:50 am ] |
| Post subject: | Re: Admin Panel |
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 |
|
| Author: | Robin [ Tue Sep 16, 2008 10:58 am ] |
| Post subject: | Re: Admin Panel |
Open the 'KeyDown' subroutine in frmMirage then add this: Code: If KeyCode = vbKeyF1 then
frmAdminPanel.visible = true end if |
|
| Author: | Doomy [ Tue Sep 16, 2008 3:05 pm ] |
| Post subject: | Re: Admin Panel |
thanks robin i forgot to add that part ill put that in |
|
| Author: | Mattyw [ Tue Sep 16, 2008 3:17 pm ] |
| Post subject: | Re: Admin Panel |
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? |
|
| Author: | Nean [ Thu Sep 18, 2008 4:50 am ] |
| Post subject: | Re: Admin Panel |
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
|
|
| Author: | Nean [ Fri Sep 19, 2008 10:56 pm ] |
| Post subject: | Re: Admin Panel |
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.
|
|
| Author: | Doomy [ Fri Sep 19, 2008 11:43 pm ] |
| Post subject: | Re: Admin Panel |
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 |
|
| Author: | Nean [ Fri Sep 19, 2008 11:55 pm ] |
| Post subject: | Re: Admin Panel |
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. |
|
| Author: | Doomy [ Sat Sep 20, 2008 12:54 am ] |
| Post subject: | Re: Admin Panel |
where would i add it cause idk because i dont have it |
|
| Author: | Nean [ Sat Sep 20, 2008 1:00 am ] |
| Post subject: | Re: Admin Panel |
Add it under the MapEditor Button. Inside the button, I mean. |
|
| Author: | Doomy [ Sat Sep 20, 2008 1:08 am ] |
| Post subject: | Re: Admin Panel |
There i fixed it thx |
|
| Author: | Doomy [ Sat Sep 20, 2008 9:25 pm ] |
| Post subject: | Re: Admin Panel |
I added my Admin.frm for those who want it |
|
| Author: | timster0 [ Sun Jan 18, 2009 7:03 pm ] |
| Post subject: | Re: Admin Panel |
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. |
|
| Author: | Rian [ Sun Jan 18, 2009 8:19 pm ] |
| Post subject: | Re: Admin Panel |
Probably because a button doesn't have a Text property. Well, it does, but it's called Caption |
|
| Author: | wanai [ Sun Dec 26, 2021 1:27 am ] |
| Post subject: | Re: [Feature]Admin Panel |
XXII |
|
| Author: | wanai [ Sun Dec 26, 2021 1:29 am ] |
| Post subject: | Re: [Feature]Admin Panel |
25 |
|
| Author: | wanai [ Sun Dec 26, 2021 1:30 am ] |
| Post subject: | Re: [Feature]Admin Panel |
Bett |
|
| Author: | wanai [ Sun Dec 26, 2021 1:31 am ] |
| Post subject: | Re: [Feature]Admin Panel |
Bett |
|
| Author: | wanai [ Sun Dec 26, 2021 1:32 am ] |
| Post subject: | Re: [Feature]Admin Panel |
Emma |
|
| Page 1 of 69 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|