Ok I have improved my code a little, This seems to be going correctly
SERVER SIDE:::::::::::::::::::::::::::::::
Code:
Public Const TILE_TYPE_FISH = 9
Public Const MAX_FISH = 255
Sub SaveFish(ByVal FishNum As Long)
Dim FileName As String
Dim i As Long
FileName = App.Path & "\data\fishies.ini"
Call PutVar(FileName, "FISH" & FishNum, "Name", Trim(Fish(FishNum).Name))
Call PutVar(FileName, "FISH" & FishNum, "ClassReq", Trim(Fish(FishNum).ClassReq))
Call PutVar(FileName, "FISH" & FishNum, "LevelReq", Trim(Fish(FishNum).LevelReq))
Call PutVar(FileName, "FISH" & FishNum, "MaxLevel", Trim(Fish(FishNum).MaxLevel))
Call PutVar(FileName, "FISH" & FishNum, "Item", Trim(Fish(FishNum).Item))
End Sub
Sub SaveFishies()
Dim i As Long
For i = 1 To MAX_Fishies
Call SaveFish(i)
Next i
End Sub
Sub LoadFishies()
Dim FileName As String
Dim i As Long
Call CheckFishies
FileName = App.Path & "\data\Fishies.ini"
For i = 1 To MAX_FISHIES
Fish(i).Name = GetVar(FileName, "FISH" & i, "Name")
Fish(i).ClassReq = Val(GetVar(FileName, "FISH" & i, "ClassReq"))
Fish(i).LevelReq = Val(GetVar(FileName, "FISH" & i, "LevelReq"))
Fish(i).MaxLevel = Val(GetVar(FileName, "FISH" & i, "MaxLevel"))
Fish(i).Item = Val(GetVar(FileName, "Fish" & i, "Item"))
DoEvents
Next i
End Sub
Sub CheckFishies()
If Not FileExist("data\fishies.ini") Then
Call SaveFishies
End If
End Sub
Sub ClearFishies(ByVal Index As Long)
Fish(Index).Name = ""
Fish(Index).ClassReq = 0
Fish(Index).LevelReq = 0
Fish(Index).MaxLevel = 0
Fish(Index).Item = 0
End Sub
Sub CleaFishies()
Dim i As Long
For i = 1 To MAX_FISHIES
Call ClearFish(i)
Next i
End Sub
Sub CanPlayerFish(ByVal Index As Long, ByVal FishNum As Long)
Dim c As Integer
If Fish(FishNum).ClassReq = 0 Then
If GetPlayerLevel(Index) <= Fish(FishNum).MaxLevel Then
c = Int((Rnd * Fish(FishNum).MaxLevel) + 1) - GetPlayerLevel(Index)
If c <= Fish(FishNum).LevelReq Then
Call GiveItem(Index, Val(Fish(FishNum).Item), 1)
Call PlayerMsg(Index, "You found some " & Trim(Fish(FishNum).Name) & "!", BrightBlue)
Else
Call PlayerMsg(Index, "You found nothing!", BrightRed)
End If
Else
Call PlayerMsg(Index, "You are not skilled enough to fish " & Trim(Fish(FishNum).Name) & "!", Red)
End If
Else
If GetPlayerClass(Index) <> Fish(FishNum).ClassReq Then
If GetPlayerLevel(Index) <= Fish(FishNum).MaxLevel Then
c = Int((Rnd * Fish(FishNum).MaxLevel) + 1) - GetPlayerLevel(Index)
If c <= Fish(FishNum).LevelReq Then
Call GiveItem(Index, Val(Fish(FishNum).Item), 1)
Call PlayerMsg(Index, "You found some " & Trim(Fish(FishNum).Name) & "!", BrightBlue)
Else
Call PlayerMsg(Index, "You found nothing!", BrightRed)
End If
Else
Call PlayerMsg(Index, "You are not skilled enough to fish " & Trim(Fish(FishNum).Name) & "!", Red)
End If
Else
Call PlayerMsg(Index, "You cannot fish here because you are not the required class!", Red)
End If
End If
End Sub
Although I'm now trying to make it so there's no class restrictions, you can be anything(it's just another one of your side skills.) And I have been doing other things over the weekend so thats as much of it as I have worked out, is any of that right