Mirage Source

Free ORPG making software.
It is currently Sun Dec 28, 2025 6:36 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Destroy Banlist (MS4)
PostPosted: Sat Sep 20, 2008 5:45 pm 
Offline
Persistant Poster
User avatar

Joined: Thu Jul 24, 2008 6:42 am
Posts: 703
Google Talk: [email protected]
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?

_________________
Image
GIAKEN wrote:
Since I'm into men, not women

GIAKEN wrote:
I can't take these huge penises anymore! All that's left is shame! And blood


Top
 Profile  
 
PostPosted: Sat Sep 20, 2008 5:46 pm 
Offline
Knowledgeable
User avatar

Joined: Fri Sep 12, 2008 11:18 pm
Posts: 176
Location: England.
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.


Top
 Profile  
 
PostPosted: Sat Sep 20, 2008 5:47 pm 
Offline
Persistant Poster
User avatar

Joined: Thu Jul 24, 2008 6:42 am
Posts: 703
Google Talk: [email protected]
Thanks a lot, I didn't know there was a if fileexist, function.

_________________
Image
GIAKEN wrote:
Since I'm into men, not women

GIAKEN wrote:
I can't take these huge penises anymore! All that's left is shame! And blood


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group