Attribute VB_Name = "modHabboClub"
Public Function HClub(ByVal Index As Integer, thmonth As String)
Dim hcpresent(0 To 10) As String
Dim Presents As String
Dim PresentBoxContent As String
Dim OldCount As String
Dim TheCount As String
Dim hmonth As String
hmonth = thmonth
hcpresent(0) = ReadINI("HC", "present1", SettingIni) 'read saved presents
hcpresent(1) = ReadINI("HC", "present2", SettingIni)
hcpresent(2) = ReadINI("HC", "present3", SettingIni)
hcpresent(3) = ReadINI("HC", "present4", SettingIni)
hcpresent(4) = ReadINI("HC", "present5", SettingIni)
hcpresent(5) = ReadINI("HC", "present6", SettingIni)
hcpresent(6) = ReadINI("HC", "present7", SettingIni)
hcpresent(7) = ReadINI("HC", "present8", SettingIni)
hcpresent(8) = ReadINI("HC", "present9", SettingIni)
hcpresent(9) = ReadINI("HC", "present10", SettingIni)
hcpresent(10) = ReadINI("HC", "present11", SettingIni)
If Val(hmonth) > 10 And Val(hmonth) <= 19 Then hmonth = Val(hmonth) - 9 'fix months who are highter than 10
If Val(hmonth) > 19 And Val(hmonth) <= 28 Then hmonth = Val(hmonth) - 18
PresentBoxContent = ""
ToGet = Split(hcpresent(hmonth), ";")
First = Split(hcpresent(hmonth), ";")(1)
For a = 1 To UBound(ToGet) 'start creating furni(s)
    If Len(ToGet(a)) > 2 Then
        If Left(ToGet(a), 4) = "door" Then 'teleporters
            OldCount = Val(FSO.OpenTextFile(DBP & "furni\count.txt", ForReading).ReadAll)
            TheCount1 = OldCount + 1
            TheCount2 = TheCount1 + 1
            FSO.OpenTextFile(DBP & "furni\count.txt", ForWriting).Write TheCount2
            FSO.CopyFolder DBP & "buy_furni\club_furni\" & ToGet(a), DBP & "furni\" & TheCount1
            FSO.CopyFolder DBP & "buy_furni\club_furni\" & ToGet(a), DBP & "furni\" & TheCount2
            FSO.CreateTextFile (DBP & "furni\" & TheCount1 & "\destination.txt")
            FSO.OpenTextFile(DBP & "furni\" & TheCount1 & "\destination.txt", ForWriting).Write TheCount2
            FSO.CreateTextFile (DBP & "furni\" & TheCount2 & "\destination.txt")
            FSO.OpenTextFile(DBP & "furni\" & TheCount2 & "\destination.txt", ForWriting).Write TheCount1
            PresentBoxContent = TheCount1 & ";" & TheCount2 & ";"
        Else 'no teleporters
            OldCount = Val(FSO.OpenTextFile(DBP & "furni\count.txt", ForReading).ReadAll)
            TheCount = OldCount + 1
            FSO.OpenTextFile(DBP & "furni\count.txt", ForWriting).Write TheCount
            FSO.CopyFolder DBP & "buy_furni\club_furni\" & ToGet(a), DBP & "furni\" & TheCount
            PresentBoxContent = PresentBoxContent & TheCount & ";"
        End If
    End If
Next a
OldCount = Val(FSO.OpenTextFile(DBP & "furni\count.txt", ForReading).ReadAll) 'create the present
TheCount = OldCount + 1
FSO.OpenTextFile(DBP & "furni\count.txt", ForWriting).Write TheCount
FSO.CopyFolder DBP & "buy_furni\club_furni\present", DBP & "furni\" & TheCount
FSO.OpenTextFile(DBP & "furni\" & TheCount & "\inbox.txt", ForWriting).Write PresentBoxContent 'write content
FSO.OpenTextFile(DBP & "furni\" & TheCount & "\inboxid.txt", ForWriting).Write "3 " & First 'write "First present" for the Icon
Randomize Timer 'generate Present color
pnum = Int(7 * Rnd)
If pnum = 0 Then pnum = ""
PresentName = "present_gen" & pnum
FSO.OpenTextFile(DBP & "furni\" & TheCount & "\name.txt", ForWriting).Write PresentName
FSO.OpenTextFile(DBP & "habbos\" & LCase(Client(Index).Name) & "\hand.txt", ForAppending).Write ";" & TheCount
FSO.OpenTextFile(DBP & "furni\" & TheCount & "\var.txt", ForWriting).Write "H!" & locale("club_gift_name")
End Function

Public Function HClub_backuponly(ByVal Index As Integer, thmonth As String)
Dim hcpresent(0 To 10) As String
Dim Presents As String
Dim PresentBoxContent As String
Dim OldCount As String
Dim TheCount As String
Dim hmonth As String
hmonth = thmonth
hcpresent(0) = ";club_sofa" 'set presents
hcpresent(1) = ";aqua_chair;aqua_chair;aqua_chair;aqua_chair;aqua_table"
hcpresent(2) = ";mocchamaster"
hcpresent(3) = ";edicehc"
hcpresent(4) = ";hcamme"
hcpresent(5) = ";doorD"
hcpresent(6) = ";hcsohva"
hcpresent(7) = ";hc_lmp"
hcpresent(8) = ";hc_tbl"
hcpresent(9) = ";hc_chr"
hcpresent(10) = ";hc_dsk"
If Val(hmonth) > 10 And Val(hmonth) <= 19 Then hmonth = Val(hmonth) - 9 'fix months who are highter than 10
If Val(hmonth) > 19 And Val(hmonth) <= 28 Then hmonth = Val(hmonth) - 18
PresentBoxContent = ""
ToGet = Split(hcpresent(hmonth), ";")
First = Split(hcpresent(hmonth), ";")(1)
For a = 1 To UBound(ToGet) 'start creating furni(s)
    If Len(ToGet(a)) > 2 Then
        If Left(ToGet(a), 4) = "door" Then 'teleporters
            OldCount = Val(FSO.OpenTextFile(DBP & "furni\count.txt", ForReading).ReadAll)
            TheCount1 = OldCount + 1
            TheCount2 = TheCount1 + 1
            FSO.OpenTextFile(DBP & "furni\count.txt", ForWriting).Write TheCount2
            FSO.CopyFolder DBP & "buy_furni\club_furni\" & ToGet(a), DBP & "furni\" & TheCount1
            FSO.CopyFolder DBP & "buy_furni\club_furni\" & ToGet(a), DBP & "furni\" & TheCount2
            FSO.CreateTextFile (DBP & "furni\" & TheCount1 & "\destination.txt")
            FSO.OpenTextFile(DBP & "furni\" & TheCount1 & "\destination.txt", ForWriting).Write TheCount2
            FSO.CreateTextFile (DBP & "furni\" & TheCount2 & "\destination.txt")
            FSO.OpenTextFile(DBP & "furni\" & TheCount2 & "\destination.txt", ForWriting).Write TheCount1
            PresentBoxContent = TheCount1 & ";" & TheCount2 & ";"
        Else 'no teleporters
            OldCount = Val(FSO.OpenTextFile(DBP & "furni\count.txt", ForReading).ReadAll)
            TheCount = OldCount + 1
            FSO.OpenTextFile(DBP & "furni\count.txt", ForWriting).Write TheCount
            FSO.CopyFolder DBP & "buy_furni\club_furni\" & ToGet(a), DBP & "furni\" & TheCount
            PresentBoxContent = PresentBoxContent & TheCount & ";"
        End If
    End If
Next a
OldCount = Val(FSO.OpenTextFile(DBP & "furni\count.txt", ForReading).ReadAll) 'create the present
TheCount = OldCount + 1
FSO.OpenTextFile(DBP & "furni\count.txt", ForWriting).Write TheCount
FSO.CopyFolder DBP & "buy_furni\club_furni\present", DBP & "furni\" & TheCount
FSO.OpenTextFile(DBP & "furni\" & TheCount & "\inbox.txt", ForWriting).Write PresentBoxContent 'write content
FSO.OpenTextFile(DBP & "furni\" & TheCount & "\inboxid.txt", ForWriting).Write "3 " & First 'write "First present"
Randomize Timer 'generate Present color
pnum = Int(7 * Rnd)
If pnum = 0 Then pnum = ""
PresentName = "present_gen" & pnum
FSO.OpenTextFile(DBP & "furni\" & TheCount & "\name.txt", ForWriting).Write PresentName
FSO.OpenTextFile(DBP & "habbos\" & LCase(Client(Index).Name) & "\hand.txt", ForAppending).Write ";" & TheCount
FSO.OpenTextFile(DBP & "furni\" & TheCount & "\var.txt", ForWriting).Write "H!" & locale("club_gift_name")
End Function

