McCull96 Posted December 25, 2010 Author Share Posted December 25, 2010 Well I decided to redo my tutorial for (EO) 1.3.1 and center itAlso it should work with (EO)2.0After you finish it should look like this:![](http://i640.photobucket.com/albums/uu129/McCull96/Example-1.png)Open your client and open modText and find```Public Sub DrawPlayerName(ByVal Index As Long)```Below that add:```Dim TextA As LongDim TextB As Long```Now find```Call DrawText(TexthDC, TextX, TextY, Name, color)```Below that add:```' 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 Call DrawText(TexthDC, TextA, TextB, "Level " & GetPlayerLevel(Index), color)```Vola, now your doneOld Post>! This tutorial is an edit of Crest's Player LevelIt shows your character's level like this![](http://i640.photobucket.com/albums/uu129/McCull96/Example-1.png)>! This all takes place in the clientopen modtext and find Sub DrawPlayerName under that should be:>! >! Dim TextX As LongDim TextY As LongDim color As Long>! Replace with:>! >! Dim TextA As Long Dim TextB As Long Dim TextX As Long Dim TextY As Long Dim color As Long>! Now go down until you find:>! >! If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then TextX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(GetPlayerName(Index)))) TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 16 Else ' Determine location for text TextX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(GetPlayerName(Index)))) TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight) + 16 End If>! ' Draw name Call DrawText(TexthDC, TextX, TextY, GetPlayerName(Index), color)End Sub>! Replace that with:>! >! If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then TextA = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(GetPlayerName(Index)))) TextB = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 5 TextX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(GetPlayerName(Index)))) TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 16 Else ' Determine location for text TextA = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(GetPlayerName(Index)))) TextB = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight) + 5 TextX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(GetPlayerName(Index)))) TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight) + 16 End If>! ' Draw name Call DrawText(TexthDC, TextA, TextB, "Level " & GetPlayerLevel(Index), color) Call DrawText(TexthDC, TextX, TextY, GetPlayerName(Index), color)End Sub>! That should be about it tell me if there's anything wrong. Link to comment Share on other sites More sharing options...
Krumelz Posted December 25, 2010 Share Posted December 25, 2010 nice job ^^.But i think you should make a different sub like Sub DrawPlayerLevel so players got the option to turn it on/off.~Krumelz Link to comment Share on other sites More sharing options...
Yxxe Posted December 25, 2010 Share Posted December 25, 2010 You may need to edit the text centring code for the level displaying.Replace this:```Trim$(GetPlayerName(Index))```with this:```Trim$("Level " & GetPlayerLevel(Index))```in TextA when determining the location of the text's X coordinate. Link to comment Share on other sites More sharing options...
Demetour Posted December 27, 2010 Share Posted December 27, 2010 Im using the new Eclipse origins. I doubt it will make any difference but its moved my name along with the level very high above the player. How can i fix this? Link to comment Share on other sites More sharing options...
Kay-No Posted December 28, 2010 Share Posted December 28, 2010 @The:> Im using the new Eclipse origins. I doubt it will make any difference but its moved my name along with the level very high above the player. How can I fix this?``` ' Determine location for text TextA = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(GetPlayerName(Index)))) TextB = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight) + 5 TextX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(GetPlayerName(Index)))) TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight) + 16```Just to increase the number 5 and 16.150 and 160 worked for me. Link to comment Share on other sites More sharing options...
Guest Posted December 28, 2010 Share Posted December 28, 2010 For thoes who haves some problems puting it in the new EO it should look like this:```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 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)End Sub``` Link to comment Share on other sites More sharing options...
DshWinchester Posted December 28, 2010 Share Posted December 28, 2010 @Raiko:> For thoes who haves some problems puting it in the new EO it should look like this:> > ```> Public Sub DrawPlayerName(ByVal Index As Long)> Dim TextX As Long> Dim TextY As Long> Dim color As Long> Dim 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> > 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)> End Sub> ```lolol~Name = Trim$(Player(Index).Name & " - Level : " & getplayerlevel(index))its just one line of change but this is in the same line Link to comment Share on other sites More sharing options...
Demetour Posted December 28, 2010 Share Posted December 28, 2010 I got it to work without anyones help. (eventually) I just edited the heights of text A and B to be equal to X except instead of -16 it was -8 Link to comment Share on other sites More sharing options...
adr990 Posted January 1, 2011 Share Posted January 1, 2011 This one will work with EO CE(1.2.0):```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 ' 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) If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then TextA = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(GetPlayerName(Index)))) TextB = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 5 TextX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(Name))) TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 16 Else ' Determine location for text TextA = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(GetPlayerName(Index)))) TextB = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 5 TextX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(GetPlayerName(Index)))) TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 16 End If ' Draw name Call DrawText(TexthDC, TextA, TextB, "Level: " & GetPlayerLevel(Index), color) Call DrawText(TexthDC, TextX, TextY, GetPlayerName(Index), color)End Sub```~Adr990 Link to comment Share on other sites More sharing options...
Valek Posted January 1, 2011 Share Posted January 1, 2011 @adr990:> This one will work with EO CE(1.2.0):> > ```> Public Sub DrawPlayerName(ByVal Index As Long)> Dim TextA As Long> Dim TextB As Long> Dim TextX As Long> Dim TextY As Long> Dim color As Long> Dim 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> > Name = Trim$(Player(Index).Name)> If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then> TextA = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(GetPlayerName(Index))))> TextB = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 5> TextX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(Name)))> TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 16> Else> ' Determine location for text> TextA = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(GetPlayerName(Index))))> TextB = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 5> TextX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(GetPlayerName(Index))))> TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 16> End If> > ' Draw name> Call DrawText(TexthDC, TextA, TextB, "Level: " & GetPlayerLevel(Index), color)> Call DrawText(TexthDC, TextX, TextY, GetPlayerName(Index), color)> > End Sub> ```> ~Adr990is it possible to change the color? I assume it has to do this with the color cases? And it looks like the color is different based on player access level. ```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)``` Link to comment Share on other sites More sharing options...
chuchoide Posted January 1, 2011 Share Posted January 1, 2011 That colors are for the Color Access.Anyways, thanks for the edited code. Link to comment Share on other sites More sharing options...
Valek Posted January 1, 2011 Share Posted January 1, 2011 @Chuchoide:> That colors are for the Color Access.> Anyways, thanks for the edited code.Yeah, but it appears that the text color of the "level: ##" appears to be the same as the color of the players access level. I was just wondering if it was possible to change the color that it displays as. Link to comment Share on other sites More sharing options...
adr990 Posted January 1, 2011 Share Posted January 1, 2011 To edit the color of the Level text do this:```Public Sub DrawPlayerName(ByVal Index As Long)Dim TextA As LongDim TextB As LongDim TextX As LongDim TextY As LongDim color As LongDim colorlevel As LongDim Name As String ' Check access level If GetPlayerPK(Index) = NO Then Select Case GetPlayerAccess(Index) Case 0 color = RGB(255, 96, 0) colorlevel = QBColor(Red) Case 1 color = QBColor(DarkGrey) colorlevel = QBColor(Red) Case 2 color = QBColor(Cyan) colorlevel = QBColor(Red) Case 3 color = QBColor(BrightGreen) colorlevel = QBColor(Red) Case 4 color = QBColor(Yellow) colorlevel = QBColor(Red) End Select Else color = QBColor(BrightRed) End If```And ofcourse below that add that other code necessary.Replace 'Red' with Cyan or BrightGreen or RGB(160, 32, 240)Or whatever color you want obviously.~Adr990 Link to comment Share on other sites More sharing options...
tmoney Posted January 2, 2011 Share Posted January 2, 2011 Thanks, easy and nice. Link to comment Share on other sites More sharing options...
luriok Posted January 3, 2011 Share Posted January 3, 2011 looks nice, good job Link to comment Share on other sites More sharing options...
Double Code Posted January 21, 2011 Share Posted January 21, 2011 Looks good gonna try it now :P Link to comment Share on other sites More sharing options...
sniperboy565 Posted January 27, 2011 Share Posted January 27, 2011 Nice guide, works perfectly! Link to comment Share on other sites More sharing options...
McCull96 Posted January 30, 2011 Author Share Posted January 30, 2011 bump, I remade the tut for EO 1.3.1 and centered it Link to comment Share on other sites More sharing options...
Piulres Posted March 17, 2011 Share Posted March 17, 2011 how I put this in EO 2.0 ? Link to comment Share on other sites More sharing options...
Robin Posted March 17, 2011 Share Posted March 17, 2011 The same way you put it in 1.3.1\. >_> Link to comment Share on other sites More sharing options...
Craselin Posted March 18, 2011 Share Posted March 18, 2011 i tried it in EO 2.0 and it didnt work. Link to comment Share on other sites More sharing options...
RyokuHasu Posted March 18, 2011 Share Posted March 18, 2011 I tried it and it worked perfectly, please share your error or discribe how it didnt work…O.o and I've modded mine up the Wazu and it still worked.. =P Link to comment Share on other sites More sharing options...
Carim123 Posted April 15, 2011 Share Posted April 15, 2011 Before I try, can I ask if anybody's tried this with Crzy's User Title System, and seen any conflict between the two sources? Link to comment Share on other sites More sharing options...
Robin Posted April 15, 2011 Share Posted April 15, 2011 @QWERTYUIoP:> Before I try, can I ask if anybody's tried this with Crzy's User Title System, and seen any conflict between the two sources?Why don't you just try it yourself? Link to comment Share on other sites More sharing options...
Carim123 Posted April 15, 2011 Share Posted April 15, 2011 @Robin:> Why don't you just try it yourself?Just asking. Better prepared than going into the unknown. ;\ 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