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

Show player exp


Emy
 Share

Recommended Posts

@Couture:

> Hello, I need some help with showing other players exp. I've tried with GetPlayerExp(Index) and it doesn't work (obviously), do I have to add something or is there an easy way?
>
> Thanks

It doesn't work client-side, you'll have to use MyIndex for that, although this will only display the players EXP, not from others, if you want to archieve that you'll have to make a new packet or find the packet which sends EXP from another player (don't know or it exists)
Link to comment
Share on other sites

Well I'm basically just using the code for your own exp bar, and I thought it would work if I changed GetPlayerLevel(MyIndex) to GetPlayerLevel(Index) and GetPlayerExp(MyIndex) to GetPlayerExp(Index) but the exp stays at 0 when hovering over other players so I guess I need to add the GetPlayerExp packet that sends the other players exp client side.

I don't think it works just adding the packet from server side right? I'm a rookie so sorry if it sounds stupid, I appreciate your help!
Link to comment
Share on other sites

So I got GetPlayerExp(Index) to work, but the problem is others can't see the exp change when they're in the same map, they have to reenter to see the current amount of exp the other players have. What I did was just adding the packet client side and to the PlayerData, any help?
Link to comment
Share on other sites

@Grim:

> call the Sub you just made in Sub GameLoop i think

Well, that's one way to do it. A better way would be to send the packet to the map whenever a player gains EXP.

Create a sub that sends the EXP to the whole map and run it whenever the player gains EXP (which is how SendEXP is used; or you could modify SendEXP to send it to everyone on the map).
Link to comment
Share on other sites

Thanks for your help, so I tried this:
```
Sub SendEXP(ByVal index As Long, ByVal mapNum As Long)
Dim Buffer As clsBuffer

    Set Buffer = New clsBuffer

    Buffer.WriteLong SPlayerEXP
    Buffer.WriteLong GetPlayerExp(index)
    Buffer.WriteLong GetPlayerNextLevel(index)

    SendDataToMap mapNum, Buffer.ToArray()
    Set Buffer = Nothing
End Sub
```
It didn't work.. What am I doing wrong?
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...