Kemerd Posted March 11, 2013 Author Share Posted March 11, 2013 Special thanks to**[XerShade](http://www.touchofdeathforums.com/community/index.php?/user/79661-xershade/)**for helping me fix a problem.Well, this is just a simple little tutorial for making your level display on a label, onto your gui, for whatever reason you'd want it to, WHERE you want it to. It's simple, really.Just make two labels. Make the first one's name, whatever your want. It doesn't mater. Just make the text:```Level:```Then, create another label, name it labellevel and make it's caption:```0```In modDatabase, search for:```SetPlayerLevel```and under:```If Index > MAX_PLAYERS Then Exit SubPlayer(Index).Level = Level```place:```frmMain.labellevel.Caption = Player(MyIndex).Level```There! You're done!You can also use this for any other things that have levels and such. I used this for the Gathering Skills System, and it turned out quite good. Instead I went to the SetPlayerMiningXP, SetPlayerFishingXP, SetplayerWoodcuttingXP, and added a label.caption = Player(MyIndex).WoodcuttingXP.Don't try to place these anywhere else, or it will not work. Link to comment Share on other sites More sharing options...
XerShade Posted March 11, 2013 Share Posted March 11, 2013 Or you can code it directly into the SetPlayerLevel sub when Myindex is passed to it. Does it automatically then. Link to comment Share on other sites More sharing options...
Kemerd Posted March 11, 2013 Author Share Posted March 11, 2013 Well, there's a problem. It's not working. :/ I'll fix it. Gimme a second. Thanks though.EDIT: Fixed! Link to comment Share on other sites More sharing options...
Ertzel Posted March 11, 2013 Share Posted March 11, 2013 Shouldn't you also add a:```If Index == MyIndex Then```block around the Caption setting. This way it only updates if its actually for your player and not every time the client gets sent that sub for all other players on your map….So it would be like:```If Index == MyIndex ThenfrmMain.labellevel.Caption = Player(MyIndex).LevelEnd If``` Link to comment Share on other sites More sharing options...
Kemerd Posted March 11, 2013 Author Share Posted March 11, 2013 It only updates for _that_ client though, right? Link to comment Share on other sites More sharing options...
Kemerd Posted March 11, 2013 Author Share Posted March 11, 2013 But doesn't it only update for _that_ client? Link to comment Share on other sites More sharing options...
Ertzel Posted March 11, 2013 Share Posted March 11, 2013 SetPlayerLevel is called from HandlePlayerData which has to do with all players, not just your own. Thats why everything else in SetPlayerLevel works off of Index and not MyIndex. So although your only updating based on your own level, its being called every time HandlePlayerData is sent for any player.It would probably be best to remove it from SetPlayerLevel and instead put it under HandlePlayerData.In that sub, look for:``` ' Check if the player is the client player If i = MyIndex Then```And put your code in that if statement's block. SetPlayerLevel is never called outside of HandlePlayerData and HandlePlayerData already checks if the data is for your own character. Link to comment Share on other sites More sharing options...
XerShade Posted March 12, 2013 Share Posted March 12, 2013 No it has to be in SetPlayerLevel, im pretty damn sure more then just HandlePlayerData updates the level. Link to comment Share on other sites More sharing options...
Ertzel Posted March 12, 2013 Share Posted March 12, 2013 Unless I'm a complete nub, the only instance of SetPlayerLevel I could find was in HandlePlayerData. I haven't used Eclipse or vb6 in awhile though so you may be correct. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now