![]() |
Admin Menu done for you. (MS4) (TESTED) - Printable Version +- Mirage Source (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: Source Code Development (https://mirage-engine.uk/forums/forumdisplay.php?fid=51) +----- Forum: Mirage Source 4 (Visual Basic 6) (https://mirage-engine.uk/forums/forumdisplay.php?fid=44) +------ Forum: Tutorials (https://mirage-engine.uk/forums/forumdisplay.php?fid=13) +------ Thread: Admin Menu done for you. (MS4) (TESTED) (/showthread.php?tid=2269) |
Admin Menu done for you. (MS4) (TESTED) - Dane - 17-10-2008 100% working and tested! If it doesnt work thats your fault for messing something up. [spoiler]Open up frmMirage and add a command button called btnAdmin double click and a code window will pop up, Put this inbetween Private Sub btnAdmin_Click() and End Sub right under it. Code: If GetPlayerAccess(MyIndex) >= ADMIN_MONITER Then 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. Re: Admin Menu done for you. (MS4) (TESTED) - DarkX - 17-10-2008 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 (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 Re: Admin Menu done for you. (MS4) (TESTED) - Hikaru - 17-10-2008 I thought ADMIN_MONITER had been changed already? Re: Admin Menu done for you. (MS4) (TESTED) - Dane - 17-10-2008 Thanks dark X and Hikaru I didnt change my moniter =\ Re: Admin Menu done for you. (MS4) (TESTED) - DarkX - 17-10-2008 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 Re: Admin Menu done for you. (MS4) (TESTED) - Doomy - 17-10-2008 thanks for giving me credit and nice Re: Admin Menu done for you. (MS4) (TESTED) - Dane - 17-10-2008 np doom. Re: Admin Menu done for you. (MS4) (TESTED) - DarkX - 17-10-2008 Now Open frmMirage and in sub Form_KeyUp() Right under: Code: Call CheckInput(0, KeyCode, Shift) Code: If KeyCode = vbKeyF1 Then Re: Admin Menu done for you. (MS4) (TESTED) - Dane - 18-10-2008 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 Re: Admin Menu done for you. (MS4) (TESTED) - DarkX - 18-10-2008 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. Re: Admin Menu done for you. (MS4) (TESTED) - Dane - 19-10-2008 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) Re: Admin Menu done for you. (MS4) (TESTED) - deathknight - 20-10-2008 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] Code: ' Handle when the player presses the return key Now thats out of the way, let me point out something in the Sub btnAdmin_Click(). If you look at it [spoiler] Code: Private Sub btnAdmin_Click() 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] Code: Private Sub btnAdmin_Click() 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 [spoiler] Code: If GetPlayerAccess(MyIndex) >= 1 Then Re: Admin Menu done for you. (MS4) (TESTED) - Dane - 20-10-2008 Where is the Sub HandleKeyPresses? frmMirage? if it is then i must have deleted it by accident Re: Admin Menu done for you. (MS4) (TESTED) - Rian - 20-10-2008 Should be in a module somewhere. Probably game logic. Re: Admin Menu done for you. (MS4) (TESTED) - deathknight - 20-10-2008 Yeah, it is in modGameLogic. If you are having trouble finding it, just ctrl + F Sub HandleKeypresses and it should pop up. Re: Admin Menu done for you. (MS4) (TESTED) - Dane - 20-10-2008 I replaced mine with no errors and still the same thing..I hit enter and nothing happens Re: Admin Menu done for you. (MS4) (TESTED) - deathknight - 20-10-2008 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. Re: Admin Menu done for you. (MS4) (TESTED) - Dane - 20-10-2008 How am I suppost to find it when there isnt an error. =\ Re: Admin Menu done for you. (MS4) (TESTED) - Dane - 21-10-2008 >.< I dont know what to search in lol. Re: Admin Menu done for you. (MS4) (TESTED) - Jared - 13-12-2008 Quote:Open up frmMirage and add a command button called Sorry Re: Admin Menu done for you. (MS4) (TESTED) - Rian - 13-12-2008 ![]() Re: Admin Menu done for you. (MS4) (TESTED) - Jared - 13-12-2008 thank you rian, but im still getting a variable not defined compile error leading me to ADMIN_MONITER Re: Admin Menu done for you. (MS4) (TESTED) - deathknight - 14-12-2008 I believe admin_moniter has been corrected to admin_monitor. Change that in the code, should work. Re: Admin Menu done for you. (MS4) (TESTED) - Jared - 14-12-2008 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. |