Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[EO 2.0]Friend System Version 1.5


crzyone9584
 Share

Recommended Posts

  • Replies 100
  • Created
  • Last Reply

Top Posters In This Topic

@crzyone9584:

> Thanks sunku.
>
> colorful your posts are not helpful when you post a question to answer a question. Its a waste of time…

your welcome also once i get vb 6 i will make a custom eclipse version with it if thats ok.
Link to comment
Share on other sites

  • 2 weeks later...
Added this into my source, but when I click on the Friendlist button the server gets Run-time error 9 "Subscript out of range" and he's selecting this line :
```
nLength = (UBound(nByte) - LBound(nByte)) + 1
```In Public Sub WriteBytes

Please help..
Link to comment
Share on other sites

@crzyone9584:

> in lblfriends_click remove UpdateFriendList… It auto updates when people sign on or off so i remeove3d the handeling for that server side. Guess i missed that on updating the post.

Thanks, that worked ;)
But now I don't get red messages when I'm using a name that don't exists..
Link to comment
Share on other sites

@crzyone9584:

> That has to do with a check when adding a player to the list. Check server side where you add the friend. Make sure you have
>
> ```
> PlayerMsg.......
> ```

This is my code :
```
Sub HandleAddFriend(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddR As Long, ByVal ExtraVar As Long)
Dim Buffer As clsBuffer
Dim FriendName As String
Dim i As Long
Dim i2 As Long
Set Buffer = New clsBuffer
Buffer.WriteBytes Data()
FriendName = Buffer.ReadString
Set Buffer = Nothing

    'See if character exsists
    If FindChar(FriendName) = False Then
        Call PlayerMsg(Index, "Player doesn't exsist", Red)
        Exit Sub

    If FriendName = GetPlayerName(Index) Then
        Call PlayerMsg(Index, "You can't add yourself", Red)
        Exit Sub
    Else
        'Add Friend to List
        For i = 1 To MAX_FRIENDS
            If Player(Index).Friends(i).FriendName = vbNullString Then
                Player(Index).Friends(i).FriendName = FriendName
                Player(Index).AmountofFriends = Player(Index).AmountofFriends + 1
                Exit For
            End If
        Next
    End If
End If

    'Update Friend List
    Call UpdateFriendList(Index)
End Sub
```
Link to comment
Share on other sites

Its there. It is this peace of code thats in what you posted

```
'See if character exsists
    If FindChar(FriendName) = False Then
        Call PlayerMsg(Index, "Player doesn't exsist", Red)
        Exit Sub
```
To make sure it works, put a break point there at the beginning of the if statement and then add a friend then press f8 to go through the code line by line and let me know what happens.
Link to comment
Share on other sites

@crzyone9584:

> Its there. It is this peace of code thats in what you posted
>
> ```
> 'See if character exsists
>     If FindChar(FriendName) = False Then
>         Call PlayerMsg(Index, "Player doesn't exsist", Red)
>         Exit Sub
> ```
> To make sure it works, put a break point there at the beginning of the if statement and then add a friend then press f8 to go through the code line by line and let me know what happens.

Nothing happens..
Link to comment
Share on other sites

>! ~~Can you help?
>! I've followed the tutorial, but I think I skipped a step, as when I try and do a full compile, I get an error on```
HandleDataSub(CAddFriend) = GetAddress(AddressOf HandleAddFriend)
    HandleDataSub(CRemoveFriend) = GetAddress(AddressOf HandleRemoveFriend)
```in modHandleData (Server-side).
>! An error comes up saying "Compile error: Variable not defined"
>! I've backtracked a bit, but can't find where I've gone wrong ;/.~~

Sorry, I found my error. Turns out I accidentally c+p the same thing at the bottom, instead of the other thing

* * *

Sorry, have another error..Whenever I click Add Friend, the box does open up, but it doesn't actually add anything to the List…I thing I overlooked something...
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share


×
×
  • Create New...