Hattivatti Posted November 16, 2008 Author Share Posted November 16, 2008 Update: Now it checks, have you used melee/ranged/magic OR got damage in last 10 seconds. Hope you like it :)(Only tested with EE 2.7)I think many of you have thought, how to disable logout when you are fighting. Because when you are going to die, it is tooeasy to keep your stuff and exp by just klicking Quit Game..So here is a code that prevents you from logging out, if you have used melee/ranged/magic in last 10 seconds.First, you should disable control box so you just can't press "red X" to quit.-Open frmMirage and from properties, set ControlBox to false.Now, open frmMirage and double-click Exit Game button.-Replace :``` Private Sub lblMenuQuit_Click() InGame = False End Sub```With this one```Private Sub lblMenuQuit_Click() If GetTickCount > NPCDmgTime + 10000 And GetTickCount > DmgTime + 10000 And GetTickCount > Player(MyIndex).AttackTimer + 10000 Then InGame = False Else Call AddText("You need to wait 10 seconds after last fight to log out", BRIGHTRED) End IfEnd Sub```And thats it :) Link to comment Share on other sites More sharing options...
Tyr Posted November 16, 2008 Share Posted November 16, 2008 pretty simple, funny add-on i didn't even think about. gjEDIT: this wouldn't stop you from logging out when you are under attack… Link to comment Share on other sites More sharing options...
zombie0hour Posted November 16, 2008 Share Posted November 16, 2008 Runescape XD Link to comment Share on other sites More sharing options...
Lenton Posted November 16, 2008 Share Posted November 16, 2008 @Hattivatti:> First, you should disable control box so you just can't press "red X" to quit.> -Open frmMirage and from properties, set ControlBox to false.If you want them same when you click the red cross just paste the same script in:private sub form_unload(cancel as integer) Link to comment Share on other sites More sharing options...
Hattivatti Posted November 16, 2008 Author Share Posted November 16, 2008 @Tyr:> EDIT: this wouldn't stop you from logging out when you are under attack…Yes that's the only problem, but usually you try to hit opponent few times and then see (if) you are too weak..Perhaps I can contrive something to fix this..And Zombie0hour, if this makes your game similar to Runescape, then don't use this.. Link to comment Share on other sites More sharing options...
Tyr Posted November 16, 2008 Share Posted November 16, 2008 @Hattivatti:> Yes that's the only problem, but usually you try to hit opponent few times and then see (if) you are too weak..> Perhaps I can contrive something to fix this..> > And Zombie0hour, if this makes your game similar to Runescape, then don't use this..well actually i got a very simple idea, just add a timer: everytime you hit reset he timer to 10 secs, and everytime you GOT hit also reset it…then on the lvlQuit add a if statement :) should work, i guess...- Tyr Link to comment Share on other sites More sharing options...
Hattivatti Posted November 16, 2008 Author Share Posted November 16, 2008 @Tyr:> well actually i got a very simple idea, just add a timer: everytime you hit reset he timer to 10 secs, and everytime you GOT hit also reset it…> > then on the lvlQuit add a if statement :) should work, i guess...> > - TyrOk now it is fixed, watch the first post. Link to comment Share on other sites More sharing options...
Tyr Posted November 16, 2008 Share Posted November 16, 2008 means when u get attacked u also can't log out for 10 sec? great… gj :) Link to comment Share on other sites More sharing options...
BugSICK Posted July 8, 2009 Share Posted July 8, 2009 Warning: this topic has not been posted in for at least 120 days.Unless you're sure you want to reply, please consider starting a new topic.dont know if this section is exempted in necroposting.but i cant make this work. :cry: Link to comment Share on other sites More sharing options...
Braiton Posted July 8, 2009 Share Posted July 8, 2009 Just click on your exit boutton in frmMirage and replace the code with the one above. Link to comment Share on other sites More sharing options...
BugSICK Posted July 8, 2009 Share Posted July 8, 2009 i try that, but theres an error. try it just dont save. Link to comment Share on other sites More sharing options...
Braiton Posted July 8, 2009 Share Posted July 8, 2009 I tried it. It works fine. Theres nothing wrong with it. And its very simple to install, nothing from the other world. Care to tell us whats the error? Link to comment Share on other sites More sharing options...
BugSICK Posted July 8, 2009 Share Posted July 8, 2009 your nice.here's my error![](http://www.freemmorpgmaker.com/files/imagehost/pics/cde76e625d0599db05687ddff1fd60f3.PNG)![](http://www.freemmorpgmaker.com/files/imagehost/pics/b6e629c88f87afe78ab14e3bf358d870.PNG) Link to comment Share on other sites More sharing options...
Braiton Posted July 8, 2009 Share Posted July 8, 2009 A type mismatch error is usually caused by the wrong variable type… for example the class is expecting a long integer and you're sending it a string. Did you install any other scripts that modified anything? Link to comment Share on other sites More sharing options...
Lenton Posted July 8, 2009 Share Posted July 8, 2009 @Prof.:> If you want them same when you click the red cross just paste the same script in:> private sub form_unload(cancel as integer)You've been great help thanks. Link to comment Share on other sites More sharing options...
BugSICK Posted July 8, 2009 Share Posted July 8, 2009 i know now the error because i install this.http://www.touchofdeathforums.com/smf/index.php/topic,46462.0.htmlits about the "NPCDmgTime"how to fixed this please?Warning - while you were reading a new reply has been posted. You may wish to review your post.@Prof.:> You've been great help thanks.nice tryFIXED. Link to comment Share on other sites More sharing options...
Braiton Posted July 8, 2009 Share Posted July 8, 2009 ```Private Sub lblMenuQuit_Click()For I = 0 To 9 If GetTickCount > NPCDmgTime(I) + 10000 And GetTickCount > DmgTime(I) + 10000 And GetTickCount > Player(MyIndex).AttackTimer + 10000 Then InGame = False Else Call AddText("You need to wait 10 seconds after last fight to log out", BRIGHTRED) End IfEnd Sub```Try like that Link to comment Share on other sites More sharing options...
BugSICK Posted July 8, 2009 Share Posted July 8, 2009 i already fixed it.its not NPCDmgTime(I)rather NPCDmgTime(0) :azn: aslo in the dmgtimethanks Link to comment Share on other sites More sharing options...
varinyc Posted July 23, 2009 Share Posted July 23, 2009 Thanks for the code!Although, I think it would be nicer to only see the warning once per click.```Private Sub lblMenuQuit_Click()Dim iFor i = 0 To 9 If GetTickCount > NPCDmgTime(0) + 10000 And GetTickCount > DmgTime(0) + 10000 And GetTickCount > Player(MyIndex).AttackTimer + 10000 Then InGame = False End IfNextIf InGame = True Then Call AddText("You need to wait 10 seconds after last fight to log out", BRIGHTRED)End IfEnd Sub``` Link to comment Share on other sites More sharing options...
anasky Posted November 8, 2009 Share Posted November 8, 2009 You do know they can just press Alt + F4 and still be logged off right?Sorry if this is a necropost, I think it's on the edge, and it might be usefull to people. Link to comment Share on other sites More sharing options...
Keebler Elf Posted November 8, 2009 Share Posted November 8, 2009 Ya anasky i was just thinking. Ctrl Alt Delete. End Process Tree. Link to comment Share on other sites More sharing options...
Hattivatti Posted November 20, 2009 Author Share Posted November 20, 2009 @Keebler:> Ya anasky i was just thinking. Ctrl Alt Delete. End Process Tree.Of course ending the process is one way to log-out. I have no skill/time to start doing a fix for this, as it would require a lot bigger changes to the code. If someone wants to do a fix, you can start a new thread because I don't visit these forums very often. 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