gdog12356 Posted May 2, 2011 Author Share Posted May 2, 2011 Ok, i thought i have been asking too much of the community, and not sharing enough, so here is a super quick edit i did which took mabe 2 mins max.This tutorial is based off of the one made by sheldon here >! [http://www.touchofdeathforums.com/smf/index.php/topic,67213.0.html](http://www.touchofdeathforums.com/smf/index.php/topic,67213.0.html)ok, first open up modconstants and at the bottom, add```Public Level_Show As Boolean```now open up mod text, and add```Dim TextA As LongDim TextB As Long```below```Public Sub DrawPlayerName(ByVal Index As Long)```now find```Call DrawText(TexthDC, TextX, TextY, Name, color)```(still in mod text)and below that add``` If Level_Show = True Then ' calc pos TextA = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$("Level " & GetPlayerLevel(Index)))) If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then TextB = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 5 Else ' Determine location for text TextB = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 5 End If```ok, now open up frmMain. And go to the side, and choose picOptions then where it shows the squared outline, right click and hit bring to front. ![](http://i55.tinypic.com/2q0ilhk.png)Now make a new CHECKBOX, and name it```level_chk```now double click on the check box, and replace all the code that is there with this```Private Sub level_chk_Click()If level_chk.Value = 0 ThenLevel_Show = TrueElseLevel_Show = FalseEnd IfEnd Sub```now make a label, and for the caption, put hide player level. now just put that next to the checkbox, and your done!! :).in the end u shuld get something like this ![](http://i54.tinypic.com/2cfvypw.png) Link to comment Share on other sites More sharing options...
XPiXel Posted May 2, 2011 Share Posted May 2, 2011 Pretty cool. But the level system my server uses is Name Here(Lv. Level Here)You know how to make it like that? Link to comment Share on other sites More sharing options...
Notsu Posted May 5, 2011 Share Posted May 5, 2011 ``` If Level_Show = True Then ' calc pos TextA = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$("Level " & GetPlayerLevel(Index)))) If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then TextB = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 5 Else ' Determine location for text TextB = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 5 End If```I have problem with this code, all working properly but the level don't shows.//sorry for my eng ;p//edit: Ok, it's work. I don't write all of post. Link to comment Share on other sites More sharing options...
Guest Posted May 10, 2011 Share Posted May 10, 2011 so it works but i had to change it up just a lil bit. heres your code that you said to add.``` If Level_Show = True Then ' calc pos TextA = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$("Level " & GetPlayerLevel(Index)))) If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then TextB = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 5 Else ' Determine location for text TextB = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 5 End If```so i did it a little diferently. i had to add just this.```If Level_Show = True Then ```above like you said.```end if```at the bottom and i skipped the middle section as its already there if you did the previous step of the show level tut. the rest was spot on. Link to comment Share on other sites More sharing options...
Kyrie Posted May 12, 2011 Share Posted May 12, 2011 I can't 'bring to front' pic options. I click it on drop down menu, and then i go and right click and it switches to what is on top. Link to comment Share on other sites More sharing options...
gdog12356 Posted May 13, 2011 Author Share Posted May 13, 2011 right click on the box, the small boxes, like right clickj it exactly Link to comment Share on other sites More sharing options...
Vus Posted May 14, 2011 Share Posted May 14, 2011 it works but when you join game, you dont see levels, only when you check the box and uncheck it againhow to do level be visible from beggining as well? Link to comment Share on other sites More sharing options...
erkro1 Posted May 14, 2011 Share Posted May 14, 2011 @Vus:> it works but when you join game, you dont see levels, only when you check the box and uncheck it again> how to do level be visible from beggining as well?Sub Joingame, add this:```Level_show = True``` Link to comment Share on other sites More sharing options...
Vus Posted May 14, 2011 Share Posted May 14, 2011 @Erkro1:> Sub Joingame, add this:> ```> Level_show = True> ```lol true, i am such a noob, butcould you please tell me where it is? search function (CTRL + F) cant find it :( Link to comment Share on other sites More sharing options...
Vus Posted May 14, 2011 Share Posted May 14, 2011 can somebody tell me please? my search function isnt working now… :( Link to comment Share on other sites More sharing options...
erkro1 Posted May 15, 2011 Share Posted May 15, 2011 @Vus:> lol true, i am such a noob, but> could you please tell me where it is? search function (CTRL + F) cant find it :(Have you set search on Current Project?And its in **Modplayer** Link to comment Share on other sites More sharing options...
Vus Posted May 15, 2011 Share Posted May 15, 2011 @Erkro1:> Have you set search on Current Project?> And its in **Modplayer**yes i did, and i dont have there any Modplayer :((EDIT: nvm, i found it in server :) Link to comment Share on other sites More sharing options...
Vus Posted May 15, 2011 Share Posted May 15, 2011 @Vus:> yes i did, and i dont have there any Modplayer :((EDIT: nvm, i found it in server :)EDIT2: Still isnt working :( Link to comment Share on other sites More sharing options...
quintensky Posted August 16, 2011 Share Posted August 16, 2011 i hate to bring this topic to liife (lol)but do i need his edits to be able to use yours? or is his, included in yours?(can you still follow it? XDXD) :P Link to comment Share on other sites More sharing options...
Beanie93 Posted August 23, 2011 Share Posted August 23, 2011 Or you can make your life easier by doing this:Make a checkbox, name it chkLevel.Go to modText, and in Sub DrawPlayerName, in it's declarations, add```Dim TextA As LongDim TextB As Long```Still in modText, add at the bottom:``` ' calc pos TextA = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$("Level " & GetPlayerLevel(Index)))) If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then TextB = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 5 Else ' Determine location for text TextB = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 5 End If 'Draw level If frmMain.chkLevel.Value = 1 Then Call DrawText(TexthDC, TextA, TextB, "Level " & GetPlayerLevel(Index), color) Else ' nothing, don't show it End If```**NOTE:** This uses Sheldon's tutorial. Link to comment Share on other sites More sharing options...
stefans Posted August 24, 2011 Share Posted August 24, 2011 I did every step, but it doesn't work for me.. When i click the checkbox nothing happensEDIT: nevermind.. XD Link to comment Share on other sites More sharing options...
Kocho Posted September 24, 2011 Share Posted September 24, 2011 to me work this way…im remplace Public Sub DrawPlayerName for this:```Public Sub DrawPlayerName(ByVal Index As Long)Dim TextA As LongDim TextB As LongDim TextX As LongDim TextY As LongDim color As LongDim Name 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, 96, 0) Case 1 color = QBColor(DarkGrey) Case 2 color = QBColor(Cyan) Case 3 color = QBColor(BrightGreen) Case 4 color = QBColor(Yellow) End Select Else color = QBColor(BrightRed) End If Name = Trim$(Player(Index).Name) ' calc pos TextX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(Name))) If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 16 Else ' Determine location for text TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 16 End If ' Draw name Call DrawText(TexthDC, TextX, TextY, Name, color) If Level_Show = True Then ' calc pos TextA = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$("" & GetPlayerLevel(Index)))) If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then TextB = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 5 Else ' Determine location for text TextB = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 5 End If 'Draw level Call DrawText(TexthDC, TextA, TextB, "" & GetPlayerLevel(Index), color) End If ' Error handler Exit Suberrorhandler: HandleError "DrawPlayerName", "modText", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub``` Link to comment Share on other sites More sharing options...
lexkymbeth Posted November 5, 2011 Share Posted November 5, 2011 i did this, for some reson if i have more than one npc a wird lvl 0 pops up on top left of my maps? plus my lvl only pups up when a npc is on the map? Edit: Fixed it nvm.. heres my code i put tags in there for admins to```Public Sub DrawPlayerName(ByVal Index As Long)Dim TextX As LongDim TextY As LongDim color As LongDim Name As String ' Check access level If GetPlayerPK(Index) = NO Then Select Case GetPlayerAccess(Index) Case 0 color = RGB(255, 96, 0) Case 1 color = QBColor(DarkGrey) Case 2 color = QBColor(Cyan) Case 3 color = QBColor(BrightGreen) Case 4 color = QBColor(Yellow) End Select Else color = QBColor(BrightRed) End If If GetPlayerAccess(Index) = 0 Then Name = Trim$(Player(Index).Name) & " Lvl: " & GetPlayerLevel(Index) ElseIf GetPlayerAccess(Index) = 1 Then Name = "[Player Relations] " & Trim$(Player(Index).Name) & " Level: " & GetPlayerLevel(Index) ElseIf GetPlayerAccess(Index) = 2 Then Name = "[Mapper] " & Trim$(Player(Index).Name) & " Lvl: " & GetPlayerLevel(Index) ElseIf GetPlayerAccess(Index) = 3 Then Name = "[Admin] " & Trim$(Player(Index).Name) & " Lvl: " & GetPlayerLevel(Index) ElseIf GetPlayerAccess(Index) = 4 Then Name = "[Developer] " & Trim$(Player(Index).Name) & " Lvl: " & GetPlayerLevel(Index) End If ' calc pos TextX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(Name))) If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 16 Else ' Determine location for text TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 16 End If ' Draw name Call DrawText(TexthDC, TextX, TextY, Name, color) ' Error handler Exit Suberrorhandler: HandleError "DrawPlayerName", "modText", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub``` Link to comment Share on other sites More sharing options...
erkro1 Posted November 5, 2011 Share Posted November 5, 2011 Use case's for that 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