| Mirage Source http://miragesource.net/forums/ |
|
| Admin Menu done for you. (MS4) (TESTED) http://miragesource.net/forums/viewtopic.php?f=183&t=4585 |
Page 1 of 60 |
| Author: | Dane [ Fri Oct 17, 2008 10:37 pm ] |
| Post subject: | Admin Menu done for you. (MS4) (TESTED) |
100% working and tested! If it doesnt work thats your fault for messing something up. SPOILER: (click to show)
You can add a F1 Or a button if you want..If you want to follow what I put above click the spoiler...(I tested it but most people might want something else) Then download frmAdmin and add it to the src Folder. RAPIDSHARE - http://rapidshare.com/files/155030086/frmAdmin.frm.html MEGAUPLOAD - http://www.megaupload.com/?d=1QE92IQ1 Then you done! Thanks Credits to 10% Me 70% Doomteam1 20% For my lungs letting me breath to give oxygen to my brain. |
|
| Author: | DarkX [ Fri Oct 17, 2008 11:02 pm ] |
| Post subject: | Re: Admin Menu done for you. (MS4) (TESTED) |
Why do you make a btnAdmin, and that button is viewable to everyone who is or is not a admin, so go into frmMirage and in form_load add Code: If GetPlayerAccess(MyIndex) >= ADMIN_MONITER Then btnAdmin.Visible = True Else If GetPlayerAccess(MyIndex) >= 0 Then btnAdmin.Visible = False Call AddText("You do NOT have access to that selection.", BrightRed) End If End If then make btnAdmin's visibilty false through it's own properties (I think that will work, do not qoute me on it though) and add the f1 key to form key up the way it was done in the old tuts |
|
| Author: | Hikaru [ Fri Oct 17, 2008 11:03 pm ] |
| Post subject: | Re: Admin Menu done for you. (MS4) (TESTED) |
I thought ADMIN_MONITER had been changed already? |
|
| Author: | Dane [ Fri Oct 17, 2008 11:07 pm ] |
| Post subject: | Re: Admin Menu done for you. (MS4) (TESTED) |
Thanks dark X and Hikaru I didnt change my moniter =\ |
|
| Author: | DarkX [ Fri Oct 17, 2008 11:08 pm ] |
| Post subject: | Re: Admin Menu done for you. (MS4) (TESTED) |
check that code before you use it, and whats diffrent between this one and the other one? didn't care to check 'cause I don't use MS4 |
|
| Author: | Doomy [ Fri Oct 17, 2008 11:10 pm ] |
| Post subject: | Re: Admin Menu done for you. (MS4) (TESTED) |
thanks for giving me credit and nice |
|
| Author: | Dane [ Fri Oct 17, 2008 11:20 pm ] |
| Post subject: | Re: Admin Menu done for you. (MS4) (TESTED) |
np doom. |
|
| Author: | DarkX [ Fri Oct 17, 2008 11:44 pm ] |
| Post subject: | Re: Admin Menu done for you. (MS4) (TESTED) |
Now Open frmMirage and in sub Form_KeyUp() Right under: Code: Call CheckInput(0, KeyCode, Shift) Add: Code: If KeyCode = vbKeyF1 Then If Player(MyIndex).Access > 0 Then frmAdmin.Visible = False frmAdmin.Visible = True End If End If there is the code for you Night, makes it so when you push f1 the admin panel appears. |
|
| Author: | Dane [ Sat Oct 18, 2008 2:56 am ] |
| Post subject: | Re: Admin Menu done for you. (MS4) (TESTED) |
you forgot Else.. You put a space instead...(I think.) If KeyCode = vbKeyF1 Then If Player(MyIndex).Access > 0 Then frmAdmin.Visible = False Else frmAdmin.Visible = True End If End If |
|
| Author: | DarkX [ Sat Oct 18, 2008 9:13 pm ] |
| Post subject: | Re: Admin Menu done for you. (MS4) (TESTED) |
I just c&p'd from the old forums, so just change it as needed, why not add the posts I made into yours then put your button codes in there so that people who are new will know what your talking about. |
|
| Author: | Dane [ Sun Oct 19, 2008 10:16 pm ] |
| Post subject: | Re: Admin Menu done for you. (MS4) (TESTED) |
I think ill just remake this whole thing sence i COMPLETELY Changed my admin panel lol. also Please help..I changed something in my frmMirage and now when i hit enter to send a message on chat it doesnt send and it makes a DING sound...Like a low dong like...You know what i mean... here is my frm mirage code.. Code: Option Explicit Private Sub btnAdmin_Click() If GetPlayerAccess(MyIndex) >= 1 Then frmAdmin.Visible = True Else If GetPlayerAccess(MyIndex) >= 0 Then frmAdmin.Visible = False Call AddText("You cannot open up the admin menu.", BrightRed) End If End If End Sub ' ****************************************** ' ** Mirage Source 4 ** ' ****************************************** Private Sub Form_Load() frmMirage.Width = 10080 End Sub Private Sub Form_Unload(Cancel As Integer) Call DestroyGame End Sub ' Winsock event Private Sub Socket_DataArrival(ByVal bytesTotal As Long) If IsConnected Then Call IncomingData(bytesTotal) End If End Sub Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) Call CheckInput(1, KeyCode, Shift) End Sub Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer) Call CheckInput(0, KeyCode, Shift) End Sub Private Sub picScreen_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) If InEditor Then Call MapEditorMouseDown(Button, Shift, X, Y) Else Call PlayerSearch End If Call SetFocusOnChat End Sub Private Sub picScreen_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) CurX = X \ PIC_X CurY = Y \ PIC_Y If InEditor Then shpLoc.Visible = False If Button = vbLeftButton Or Button = vbRightButton Then Call MapEditorMouseDown(Button, Shift, X, Y) End If End If End Sub Private Sub txtMyChat_Change() MyText = txtMyChat End Sub Private Sub txtChat_GotFocus() SetFocusOnChat End Sub Private Sub picInventory_Click() Call UpdateInventory picInv.Visible = True End Sub Private Sub lblUseItem_Click() Call SendUseItem(frmMirage.lstInv.ListIndex + 1) End Sub Private Sub lblDropItem_Click() Dim Value As Long Dim InvNum As Long InvNum = frmMirage.lstInv.ListIndex + 1 If GetPlayerInvItemNum(MyIndex, InvNum) > 0 Then If GetPlayerInvItemNum(MyIndex, InvNum) <= MAX_ITEMS Then If Item(GetPlayerInvItemNum(MyIndex, InvNum)).Type = ITEM_TYPE_CURRENCY Then ' Show them the drop dialog frmDrop.Show vbModal Else Call SendDropItem(frmMirage.lstInv.ListIndex + 1, 0) End If End If End If End Sub Private Sub lblCast_Click() If Player(MyIndex).Spell(lstSpells.ListIndex + 1) > 0 Then If GetTickCount > Player(MyIndex).AttackTimer + 1000 Then If Player(MyIndex).Moving = 0 Then Call SendData(CCast & SEP_CHAR & lstSpells.ListIndex + 1 & END_CHAR) Player(MyIndex).Attacking = 1 Player(MyIndex).AttackTimer = GetTickCount Player(MyIndex).CastedSpell = YES Else Call AddText("Cannot cast while walking!", BrightRed) End If End If Else Call AddText("No spell here.", BrightRed) End If End Sub Private Sub lblCancel_Click() picInv.Visible = False End Sub Private Sub lblSpellsCancel_Click() picPlayerSpells.Visible = False End Sub Private Sub lstinv_GotFocus() On Error Resume Next frmMirage.picScreen.SetFocus End Sub Private Sub lstspells_GotFocus() On Error Resume Next frmMirage.picScreen.SetFocus End Sub Private Sub picSpells_Click() Call SendData(CSpells & END_CHAR) End Sub Private Sub picStats_Click() Call SendData(CGetStats & END_CHAR) End Sub Private Sub picTrain_Click() frmTraining.Show vbModal End Sub Private Sub picTrade_Click() Call SendData(CTrade & END_CHAR) End Sub Private Sub picQuit_Click() isLogging = True InGame = False Call SendData(CQuit & END_CHAR) Call DestroyTCP End Sub ' // MAP EDITOR STUFF // Private Sub optLayers_Click() If optLayers.Value Then fraLayers.Visible = True fraAttribs.Visible = False End If End Sub Private Sub optAttribs_Click() If optAttribs.Value Then fraLayers.Visible = False fraAttribs.Visible = True End If End Sub Private Sub picBackSelect_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Call MapEditorChooseTile(Button, Shift, X, Y) End Sub Private Sub picBackSelect_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) shpLoc.Top = (Y \ PIC_Y) * PIC_Y shpLoc.Left = (X \ PIC_X) * PIC_X shpLoc.Visible = True End Sub Private Sub cmdSend_Click() Call MapEditorSend End Sub Private Sub cmdCancel_Click() Call MapEditorCancel End Sub Private Sub cmdProperties_Click() frmMapProperties.Show vbModal End Sub Private Sub optWarp_Click() frmMapWarp.Show vbModal End Sub Private Sub optItem_Click() frmMapItem.Show vbModal End Sub Private Sub optKey_Click() frmMapKey.Show vbModal End Sub Private Sub optKeyOpen_Click() frmKeyOpen.Show vbModal End Sub Private Sub scrlPicture_Change() Call MapEditorTileScroll End Sub Private Sub cmdFill_Click() MapEditorFillLayer End Sub Private Sub cmdClear_Click() Call MapEditorClearLayer End Sub Private Sub cmdClear2_Click() Call MapEditorClearAttribs End Sub Private Sub scrlTileSet_Change() frmMirage.scrlPicture.Max = (frmMirage.picBackSelect.Height \ PIC_Y) - (frmMirage.picBack.Height \ PIC_Y) Map.TileSet = scrlTileSet.Value lblTileset = scrlTileSet.Value Call InitTileSurf(scrlTileSet) Call BltMapEditor Call BltMapEditorTilePreview End Sub Anything wrong? |
|
| Author: | deathknight [ Mon Oct 20, 2008 4:14 am ] |
| Post subject: | Re: Admin Menu done for you. (MS4) (TESTED) |
Ok, so I looked through your code, and as far as I can tell everything looks fine (except one little error I will point out in a minute). I think the problem may be in your Sub HandleKeyPresses. I will post my On Return part of the sub below. SPOILER: (click to show)
Now thats out of the way, let me point out something in the Sub btnAdmin_Click(). If you look at it SPOILER: (click to show)
You will notice that it checks to see if your access is greater than or equal too 1, in which case it makes the form visible. Imediately after that, it checks to see if your access is GREATER than or equal to ZERO and then set the form visible to false. So you have one if making the form visible, and the next one making it not so visible. This should work though, if im not mistaken SPOILER: (click to show)
If I'm reading this Sub btnAdmin_click wrong, please let me know, although it seems to make sense to me. Also if you want the btnAdmin to be visible to only admins, just add this in the Sub Form_Load right underneath Code: frmMirage.Width = 10080 Sure you can still edit the client to show the button, but with proper checks on the server side, it shouldn't matter. SPOILER: (click to show)
|
|
| Author: | Dane [ Mon Oct 20, 2008 4:51 am ] |
| Post subject: | Re: Admin Menu done for you. (MS4) (TESTED) |
Where is the Sub HandleKeyPresses? frmMirage? if it is then i must have deleted it by accident |
|
| Author: | Rian [ Mon Oct 20, 2008 5:10 am ] |
| Post subject: | Re: Admin Menu done for you. (MS4) (TESTED) |
Should be in a module somewhere. Probably game logic. |
|
| Author: | deathknight [ Mon Oct 20, 2008 8:17 am ] |
| Post subject: | Re: Admin Menu done for you. (MS4) (TESTED) |
Yeah, it is in modGameLogic. If you are having trouble finding it, just ctrl + F Sub HandleKeypresses and it should pop up. |
|
| Author: | Dane [ Mon Oct 20, 2008 4:48 pm ] |
| Post subject: | Re: Admin Menu done for you. (MS4) (TESTED) |
I replaced mine with no errors and still the same thing..I hit enter and nothing happens |
|
| Author: | deathknight [ Mon Oct 20, 2008 9:17 pm ] |
| Post subject: | Re: Admin Menu done for you. (MS4) (TESTED) |
Take the last couple of things you have added in, and comment them out one at a time. Once it starts letting you send the error message, uncomment everything except the last thing you commented out, also one at a time. This will narrow it down to what lines are causing the error. You might also me able to use this to find which line in the sub/mod/etc. is causing the error, but that would take a little more though. If you find the line thats causing the error, and still can't figure it out, then put the code here, and I'll look over it for you. |
|
| Author: | Dane [ Mon Oct 20, 2008 11:51 pm ] |
| Post subject: | Re: Admin Menu done for you. (MS4) (TESTED) |
How am I suppost to find it when there isnt an error. =\ |
|
| Author: | Lea [ Tue Oct 21, 2008 1:49 am ] |
| Post subject: | Re: Admin Menu done for you. (MS4) (TESTED) |
step through the code until it stops? |
|
| Author: | Dane [ Tue Oct 21, 2008 6:10 pm ] |
| Post subject: | Re: Admin Menu done for you. (MS4) (TESTED) |
>.< I dont know what to search in lol. |
|
| Author: | Jared [ Sat Dec 13, 2008 10:21 pm ] |
| Post subject: | Re: Admin Menu done for you. (MS4) (TESTED) |
Quote: Open up frmMirage and add a command button called btnAdmin Sorry <- Complete noob... lol How do i add a command button '? i looked everywhere and cant seem to find anything like this... lol i even tried google.. and still.. any help for a nooby ? |
|
| Author: | Rian [ Sat Dec 13, 2008 11:30 pm ] |
| Post subject: | Re: Admin Menu done for you. (MS4) (TESTED) |
|
|
| Author: | Jared [ Sat Dec 13, 2008 11:52 pm ] |
| Post subject: | Re: Admin Menu done for you. (MS4) (TESTED) |
thank you rian, but im still getting a variable not defined compile error leading me to ADMIN_MONITER |
|
| Author: | deathknight [ Sun Dec 14, 2008 1:10 am ] |
| Post subject: | Re: Admin Menu done for you. (MS4) (TESTED) |
I believe admin_moniter has been corrected to admin_monitor. Change that in the code, should work. |
|
| Author: | Jared [ Sun Dec 14, 2008 2:37 am ] |
| Post subject: | Re: Admin Menu done for you. (MS4) (TESTED) |
lol well that fixed that problem death. lol but then i got introduced to another crap load of other problems.. oh well :\ thanks guys for helping me. |
|
| Page 1 of 60 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|