troglodite Posted May 7, 2013 Author Share Posted May 7, 2013 With this tutorial we´ll make an option to show on/off the level of our character in the screenI didnt found a tutorial like this in search, so I did it myself and I want to share it with you**CLIENT SIDE**Search```Private Type OptionsRec```Paste above the **End Type**``` Level As Byte```Search```Public Sub SaveOptions()```Paste above the **' Error handler**``` Call PutVar(fileName, "Options", "Level", Str(Options.Level))```Search```Public Sub LoadOptions()```Paste above the **SaveOptions**``` Options.Level = 0```Under``` Options.Debug = GetVar(fileName, "Options", "Debug")```Paste``` Options.Level = GetVar(fileName, "Options", "Level")```Paste above the **' Error handler**``` If Options.Level = 0 Then frmMain.optLvlOff.Value = True Else frmMain.optLvlOn.Value = True End If```Search```Public Sub DrawPlayerName(ByVal Index As Long)```Under```End Sub```Paste```Public Sub DrawPlayerLevel(ByVal Index As Long)Dim TextX As LongDim TextY As LongDim color As LongDim Level As String ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler ' Check access level If GetPlayerPK(Index) = NO Then Select Case GetPlayerAccess(Index) Case 0 color = RGB(255, 120, 70) Case 1 color = QBColor(DarkGrey) Case 2 color = QBColor(BrightGreen) Case 3 color = QBColor(BrightCyan) Case 4 color = QBColor(BrightRed) End Select Else color = QBColor(BrightRed) End If If Player(Index).Invisible = True Then Level = "" Else If GetPlayerAccess(Index) = 0 Then Level = "Lvl" & GetPlayerLevel(Index) ElseIf GetPlayerAccess(Index) = 1 Then Level = "Lvl" & GetPlayerLevel(Index) ElseIf GetPlayerAccess(Index) = 2 Then Level = "Lvl" & GetPlayerLevel(Index) ElseIf GetPlayerAccess(Index) = 3 Then Level = "Lvl" & GetPlayerLevel(Index) ElseIf GetPlayerAccess(Index) = 4 Then Level = "Lvl" & GetPlayerLevel(Index) End If End If ' calc pos TextX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(Level))) If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 4 Else ' Determine location for text TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 4 End If ' Draw level Call DrawText(TexthDC, TextX, TextY, Level, color) ' Error handler Exit Suberrorhandler: HandleError "DrawPlayerLevel", "modText", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub```**Now the Option**In _FrmMain_, inside _picOptions_ (the PictureBox)Make a labelName: Label51Caption: LevelMake an OptionButtonName: optLvlOnCaption: OnValue: FalseMake an OptionButtonName: optLvlOffCaption: OffValue: FalseShould look like this:>! ![](http://i42.tinypic.com/2d1f8h.jpg) **DONE!**Example:![](http://i44.tinypic.com/2zq7peg.jpg) Link to comment Share on other sites More sharing options...
abhi2011 Posted May 7, 2013 Share Posted May 7, 2013 Tutorial already exists for this. Link to comment Share on other sites More sharing options...
troglodite Posted May 7, 2013 Author Share Posted May 7, 2013 > Tutorial already exists for this.**Above name with option regardless the name**?Show me!Because I was looking It and didnt found Link to comment Share on other sites More sharing options...
abhi2011 Posted May 7, 2013 Share Posted May 7, 2013 http://www.touchofdeathforums.com/community/index.php?/topic/121629-eo-show-npc-levels for npc level. There is one for showing with options. Link to comment Share on other sites More sharing options...
troglodite Posted May 7, 2013 Author Share Posted May 7, 2013 > [http://www.touchofde…show-npc-levels](http://www.touchofdeathforums.com/community/index.php?/topic/121629-eo-show-npc-levels) for npc level. There is one for showing with options.Its for NPC ![:huh:](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/huh.png) Link to comment Share on other sites More sharing options...
Wortel Angels Posted May 7, 2013 Share Posted May 7, 2013 > Its for NPC ![:huh:](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/huh.png)Yes but everyone should be so stupide to do the same for Players….But meh nice tutorial.. Link to comment Share on other sites More sharing options...
Punika Posted June 3, 2013 Share Posted June 3, 2013 Thank you.EDIT:Type Missmatch at line "Options.Level = GetVar(FileName, "Options", "Level")"Any help on that? Maybe the sollution AND the reason why it's happening for correcting further problems on my own? ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png) Link to comment Share on other sites More sharing options...
troglodite Posted June 4, 2013 Author Share Posted June 4, 2013 > Thank you.> > EDIT:> > Type Missmatch at line "Options.Level = GetVar(FileName, "Options", "Level")"> > Any help on that? Maybe the sollution AND the reason why it's happening for correcting further problems on my own? ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png)I think is thatPut the line in config.ini, at the bottom of [OPTIONS]:**Level = 1** Link to comment Share on other sites More sharing options...
CaioAnselmo Posted January 29, 2015 Share Posted January 29, 2015 If Player(Index).Invisible = True ThenIs giving error is..Microsoft Visual BasicCompile error :Method or data member not foundwhy :( ? Link to comment Share on other sites More sharing options...
Officer Johnson Posted January 29, 2015 Share Posted January 29, 2015 Is .Invisible declared in the PlayerRec? Link to comment Share on other sites More sharing options...
CaioAnselmo Posted January 29, 2015 Share Posted January 29, 2015 It is not declared but have tried to make and occurredRun-time error '13':Type mismatch :| Link to comment Share on other sites More sharing options...
Officer Johnson Posted January 29, 2015 Share Posted January 29, 2015 look up the invisible tutorial and add it in or just remove the lines of code in already 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