Zopto Posted August 1, 2012 Author Share Posted August 1, 2012 ```Sub SaveGuildName(ByVal name As String) Dim F As Long Dim n As Long F = FreeFile Open App.Path & "\data\guilds\Guildlist.txt" For Append As #F Print #F, name; "" Close #FEnd Sub``````Function FindGuild(ByVal name As String) As Boolean Dim F As Long Dim s As String F = FreeFile Open App.Path & "\data\guilds\Guildlist.txt" For Input As #F Do While Not EOF(F) Input #F, s If Trim$(LCase$(s)) = Trim$(LCase$(name)) Then FindGuild = True Close #F Exit Function End If Loop Close #FEnd Function`````` 'Check to see if guild name exists. If FindGuild(name) Then PlayerMsg Founder_Index, "That Guild name already exists!", BrightRed Exit Sub End If`````` 'Write to text file to save guild name. Call SaveGuildName(name)```Makes guild list if guild list is not there. This is in initserver``` ' Check if the master Guildlist file exists for checking duplicate names, and if it doesnt make it If Not FileExist("data\guilds\Guildlist.txt") Then F = FreeFile Open App.Path & "\data\guilds\Guildlist.txt" For Output As #F Close #F End If```Before I forget I would like to thank you. It must of been frustrating trying to help me, but I feel as though I learned quite a bit.Now I am working on it deleting out of the text file when the guild disbands. I have a feeling the deleting will be very hard…Stuck on the deleting part. No errors thrown, however nothing is deleted.```Sub DeleteGuild(ByVal name As String) Dim f1 As Long Dim f2 As Long Dim s As String Call FileCopy(App.Path & "\data\guilds\Guildlist.txt", App.Path & "\data\guilds\Guildtemp.txt") ' Destroy name from Guild List f1 = FreeFile Open App.Path & "\data\guilds\Guildtemp.txt" For Input As #f1 f2 = FreeFile Open App.Path & "\data\guilds\Guildlist.txt" For Output As #f2 Do While Not EOF(f1) Input #f1, s If Trim$(LCase$(s)) <> Trim$(LCase$(name)) Then Print #f2, s End If Loop Close #f1 Close #f2 Call Kill(App.Path & "\data\guilds\Guildtemp.txt")End Sub```[/quotewhere to i put this code can any one make me a tutorial how to i use it… tnx? Link to comment Share on other sites More sharing options...
Ganjika Posted August 1, 2012 Share Posted August 1, 2012 I too am also alil confused on that, what file exactly is it we are supposed to edit to do these changes? Link to comment Share on other sites More sharing options...
Ruins of Hell Posted August 1, 2012 Share Posted August 1, 2012 Where did you get that code? [Just use this tutorial.](http://www.touchofdeathforums.com/smf2/index.php/topic,78441.0.html) 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