VB6 Habbo Server Code Help
WHAT is WRONG in this code?
If InStr(ToSay, ":deleteroom") = 1 And InStr(ReadINI("rank", "speech_cmd", DBP & "ranks\" & Client(Index).Rank & ".ini"), ",deleteroom") Then
Stuur = 0
If InStr(ToSay, " ") Then
Wie = Mid(ToSay, InStr(ToSay, " ") + 1)
If FSO.FolderExists(DBP & "privaterooms\" & Wie) = True And FSO.FileExists(DBP & "privaterooms\" & Wie & "\deleted.txt") = False Then
RoomOwner = LCase(FSO.OpenTextFile(DBP & "privaterooms\" & Wie & "\owner.txt", ForReading).ReadAll)
If FSO.FolderExists(DBP & "habbos\" & RoomOwner) = True Then
RoomList = FSO.OpenTextFile(DBP & "habbos\" & RoomOwner & "\roomlist.txt", ForReading).ReadAll
RoomList = Replace(RoomList, "<" & Wie & ">", "")
FSO.OpenTextFile(DBP & "habbos\" & RoomOwner & "\roomlist.txt", ForWriting).Write RoomList
OwnCount = Val(FSO.OpenTextFile(DBP & "habbos\" & RoomOwner & "\rooms.txt", ForReading).ReadAll)
RoomCount = Val(FSO.OpenTextFile(DBP & "privaterooms\count.txt", ForReading).ReadAll)
FSO.OpenTextFile(DBP & "privaterooms\count.txt", ForWriting).Write RoomCount - 1
FSO.OpenTextFile(DBP & "habbos\" & RoomOwner & "\rooms.txt", ForWriting).Write OwnCount - 1
furni = FSO.OpenTextFile(DBP & "privaterooms\" & Wie & "\furni.txt").ReadAll
Dim FurniLijst() As String
FurniLijst() = Split(furni, ";")
For a = 0 To UBound(FurniLijst)
FurniLijst (a) <> ""
FSO.DeleteFolder DBP & "furni\" & FurniLijst(a) & "", True
FSO.DeleteFolder DBP & "privaterooms\" & Wie & "", True
End If
End If
End If
End If
End If
Re: VB6 Habbo Server Code Help
Mind telling us what the actual error you get is?
Because.. If you wouldn't get one, you wouldn't be here asking us now would you?
Re: VB6 Habbo Server Code Help
it says "end if without block if" error
Re: VB6 Habbo Server Code Help
You have one too many "End If"-s. Remove one from the end :)
Re: VB6 Habbo Server Code Help
Quote:
Originally Posted by
Sgzfx
You have one too many "End If"-s. Remove one from the end :)
This guy was faster than me :P
Indeed, you have 1 End if too many.. So just remove one from the bottom of the code:
Code:
If InStr(ToSay, ":deleteroom") = 1 And InStr(ReadINI("rank", "speech_cmd", DBP & "ranks\" & Client(Index).Rank & ".ini"), ",deleteroom") Then
Stuur = 0
If InStr(ToSay, " ") Then
Wie = Mid(ToSay, InStr(ToSay, " ") + 1)
If FSO.FolderExists(DBP & "privaterooms\" & Wie) = True And FSO.FileExists(DBP & "privaterooms\" & Wie & "\deleted.txt") = False Then
RoomOwner = LCase(FSO.OpenTextFile(DBP & "privaterooms\" & Wie & "\owner.txt", ForReading).ReadAll)
If FSO.FolderExists(DBP & "habbos\" & RoomOwner) = True Then
RoomList = FSO.OpenTextFile(DBP & "habbos\" & RoomOwner & "\roomlist.txt", ForReading).ReadAll
RoomList = Replace(RoomList, "<" & Wie & ">", "")
FSO.OpenTextFile(DBP & "habbos\" & RoomOwner & "\roomlist.txt", ForWriting).Write RoomList
OwnCount = Val(FSO.OpenTextFile(DBP & "habbos\" & RoomOwner & "\rooms.txt", ForReading).ReadAll)
RoomCount = Val(FSO.OpenTextFile(DBP & "privaterooms\count.txt", ForReading).ReadAll)
FSO.OpenTextFile(DBP & "privaterooms\count.txt", ForWriting).Write RoomCount - 1
FSO.OpenTextFile(DBP & "habbos\" & RoomOwner & "\rooms.txt", ForWriting).Write OwnCount - 1
furni = FSO.OpenTextFile(DBP & "privaterooms\" & Wie & "\furni.txt").ReadAll
Dim FurniLijst() As String
FurniLijst() = Split(furni, ";")
For a = 0 To UBound(FurniLijst)
FurniLijst (a) <> ""
FSO.DeleteFolder DBP & "furni\" & FurniLijst(a) & "", True
FSO.DeleteFolder DBP & "privaterooms\" & Wie & "", True
End If
End If
End If
End If
Re: VB6 Habbo Server Code Help
guys now it shows this error
Code:
If InStr(ToSay, ":deleteroom") = 1 And InStr(ReadINI("rank", "speech_cmd", DBP & "ranks\" & Client(Index).Rank & ".ini"), ",deleteroom") Then
Stuur = 0
If InStr(ToSay, " ") Then
Wie = Mid(ToSay, InStr(ToSay, " ") + 1)
If FSO.FolderExists(DBP & "privaterooms\" & Wie) = True And FSO.FileExists(DBP & "privaterooms\" & Wie & "\deleted.txt") = False Then
RoomOwner = LCase(FSO.OpenTextFile(DBP & "privaterooms\" & Wie & "\owner.txt", ForReading).ReadAll)
If FSO.FolderExists(DBP & "habbos\" & RoomOwner) = True Then
RoomList = FSO.OpenTextFile(DBP & "habbos\" & RoomOwner & "\roomlist.txt", ForReading).ReadAll
RoomList = Replace(RoomList, "<" & Wie & ">", "")
FSO.OpenTextFile(DBP & "habbos\" & RoomOwner & "\roomlist.txt", ForWriting).Write RoomList
OwnCount = Val(FSO.OpenTextFile(DBP & "habbos\" & RoomOwner & "\rooms.txt", ForReading).ReadAll)
RoomCount = Val(FSO.OpenTextFile(DBP & "privaterooms\count.txt", ForReading).ReadAll)
FSO.OpenTextFile(DBP & "privaterooms\count.txt", ForWriting).Write RoomCount - 1
FSO.OpenTextFile(DBP & "habbos\" & RoomOwner & "\rooms.txt", ForWriting).Write OwnCount - 1
furni = FSO.OpenTextFile(DBP & "privaterooms\" & Wie & "\furni.txt").ReadAll
Dim FurniLijst() As String
FurniLijst() = Split(furni, ";")
For a = 0 To UBound(FurniLijst)
FurniLijst(a) <> ""
FSO.DeleteFolder DBP & "furni\" & FurniLijst(a) & "", True
FSO.DeleteFolder DBP & "privaterooms\" & Wie & "", True
End If
End If
End If
End If
on this line it shows the error
FurniLijst(a) <> ""
expected sub,function or property
Re: VB6 Habbo Server Code Help
What is furnilijst,
FurniLijst (a) <> "" << This is a comparisson,
so you probably deleted the if statement there :P
i.e:
Code:
If InStr(ToSay, ":deleteroom") = 1 And InStr(ReadINI("rank", "speech_cmd", DBP & "ranks\" & Client(Index).Rank & ".ini"), ",deleteroom") Then
Stuur = 0
If InStr(ToSay, " ") Then
Wie = Mid(ToSay, InStr(ToSay, " ") + 1)
If FSO.FolderExists(DBP & "privaterooms\" & Wie) = True And FSO.FileExists(DBP & "privaterooms\" & Wie & "\deleted.txt") = False Then
RoomOwner = LCase(FSO.OpenTextFile(DBP & "privaterooms\" & Wie & "\owner.txt", ForReading).ReadAll)
If FSO.FolderExists(DBP & "habbos\" & RoomOwner) = True Then
RoomList = FSO.OpenTextFile(DBP & "habbos\" & RoomOwner & "\roomlist.txt", ForReading).ReadAll
RoomList = Replace(RoomList, "<" & Wie & ">", "")
FSO.OpenTextFile(DBP & "habbos\" & RoomOwner & "\roomlist.txt", ForWriting).Write RoomList
OwnCount = Val(FSO.OpenTextFile(DBP & "habbos\" & RoomOwner & "\rooms.txt", ForReading).ReadAll)
RoomCount = Val(FSO.OpenTextFile(DBP & "privaterooms\count.txt", ForReading).ReadAll)
FSO.OpenTextFile(DBP & "privaterooms\count.txt", ForWriting).Write RoomCount - 1
FSO.OpenTextFile(DBP & "habbos\" & RoomOwner & "\rooms.txt", ForWriting).Write OwnCount - 1
furni = FSO.OpenTextFile(DBP & "privaterooms\" & Wie & "\furni.txt").ReadAll
Dim FurniLijst() As String
FurniLijst() = Split(furni, ";")
For a = 0 To UBound(FurniLijst)
If FurniLijst (a) <> "" Then
FSO.DeleteFolder DBP & "furni\" & FurniLijst(a) & "", True
FSO.DeleteFolder DBP & "privaterooms\" & Wie & "", True
End if
Next a
End If
End If
End If
End If
Re: VB6 Habbo Server Code Help
on this part of the code
Code:
furni = FSO.OpenTextFile(DBP & "privaterooms\" & Wie & "\furni.txt").ReadAll
Dim FurniLijst() As String
FurniLijst() = Split(furni, ";")
For a = 0 To UBound(FurniLijst)
If FurniLijst (a) <> "" Then
FSO.DeleteFolder DBP & "furni\" & FurniLijst(a) & "", True
Will it delete the folders in the furni.txt that is split. lets say it has 1;3;5;8 and those have each folders in the furni\ directory will they be deleted too?
and way2death whats ur msn?
Re: VB6 Habbo Server Code Help
As far as I can read the script, it deletes every folder mentioned in the furni.txt
So lets say you have these folders:
1
15
19
30
And your furni.txt contains:
1;19;30
Then those folders would be deleted
Re: VB6 Habbo Server Code Help
but it doesnt delete :[ hmm
Re: VB6 Habbo Server Code Help
For those who want the code:
Code:
If InStr(ToSay, ":deleteroom") = 1 And InStr(ReadINI("rank", "speech_cmd", DBP & "ranks\" & Client(Index).Rank & ".ini"), ",deleteroom") Then
Stuur = 0
If InStr(ToSay, " ") Then
Wie = Mid(ToSay, InStr(ToSay, " ") + 1)
If FSO.FolderExists(DBP & "privaterooms\" & Wie) = True And FSO.FileExists(DBP & "privaterooms\" & Wie & "\deleted.txt") = False Then
RoomOwner = LCase(FSO.OpenTextFile(DBP & "privaterooms\" & Wie & "\owner.txt", ForReading).ReadAll)
If FSO.FolderExists(DBP & "habbos\" & RoomOwner) = True Then
RoomList = FSO.OpenTextFile(DBP & "habbos\" & RoomOwner & "\roomlist.txt", ForReading).ReadAll
RoomList = Replace(RoomList, "<" & Wie & ">", "")
FSO.OpenTextFile(DBP & "habbos\" & RoomOwner & "\roomlist.txt", ForWriting).Write RoomList
OwnCount = Val(FSO.OpenTextFile(DBP & "habbos\" & RoomOwner & "\rooms.txt", ForReading).ReadAll)
RoomCount = Val(FSO.OpenTextFile(DBP & "privaterooms\count.txt", ForReading).ReadAll)
FSO.OpenTextFile(DBP & "privaterooms\count.txt", ForWriting).Write RoomCount - 1
FSO.OpenTextFile(DBP & "habbos\" & RoomOwner & "\rooms.txt", ForWriting).Write OwnCount - 1
furni = FSO.OpenTextFile(DBP & "privaterooms\" & Wie & "\furni.txt").ReadAll
Dim FurniLijst() As String
FurniLijst() = Split(furni, ";")
For a = 0 To UBound(FurniLijst)
If FurniLijst (a) <> "" Then
'Delete the furniture folder
FSO.DeleteFolder DBP & "furni\" & FurniLijst(a) & "", True
End if
Next a
'Delete the user folder
FSO.DeleteFolder DBP & "privaterooms\" & Wie & "", True
End If
End If
End If
End If