| Mirage Source http://www.miragesource.net/forums/ |
|
| Destroy Banlist (MS4) http://www.miragesource.net/forums/viewtopic.php?f=193&t=4394 |
Page 1 of 1 |
| Author: | Nean [ Sat Sep 20, 2008 5:45 pm ] |
| Post subject: | Destroy Banlist (MS4) |
Code: Case CBanDestroy ' Prevent hacking If GetPlayerAccess(Index) < ADMIN_CREATOR Then Call HackingAttempt(Index, "Admin Cloning") Exit Sub End If Call Kill(App.Path & "\data\banlist.txt") Call PlayerMsg(Index, "Ban list destroyed.", White) Exit Sub This is a pretty non-important error, but nonetheless, it'd be nice to get it fixed. When you try to destroy the banlist, it does. However, if you try a second, time when you have already destroyed it, it gives you an error, and shuts the server down, because there is nothing there to destroy. How can I make it so that, it checks to see if its there, and if it is, then destroy, else it exits the sub? |
|
| Author: | Mattyw [ Sat Sep 20, 2008 5:46 pm ] |
| Post subject: | Re: Destroy Banlist (MS4) |
I fixed it earlier: Code: Case CBanDestroy ' Prevent hacking If GetPlayerAccess(Index) < ADMIN_CREATOR Then Call HackingAttempt(Index, "Admin Cloning") Exit Sub End If If FileExist("\data\banlist.txt") Then Call Kill(App.Path & "\data\banlist.txt") Call PlayerMsg(Index, "Ban list destroyed.", White) End If Exit Sub Enjoy. |
|
| Author: | Nean [ Sat Sep 20, 2008 5:47 pm ] |
| Post subject: | Re: Destroy Banlist (MS4) |
Thanks a lot, I didn't know there was a if fileexist, function. |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|