lexkymbeth Posted November 20, 2011 Author Share Posted November 20, 2011 in client modtext look for sub drawplayernamereplace the hole sub with```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 = QBColor(7) Case 1 color = QBColor(1) Case 2 color = QBColor(2) Case 3 color = QBColor(4) Case 4 color = QBColor(6) 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) & " - LvL: " & GetPlayerLevel(Index) ElseIf GetPlayerAccess(Index) = 2 Then Name = "[Builder] " & 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 = "[Dev] " & 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```name should come out to be, say.. Dev wold be [dev] Name - Level: 64 (Color would be Gold)Feel free to edit and thank me for doing this :pCoverted:```Public Sub DrawPlayerName(ByVal index As Long)Dim textX As Long, textY As Long, Text As String, textSize As Long, colour As Long If GetPlayerAccess(index) = 0 Then Text = Trim$(Player(index).Name) & " - Lvl: " & Player(index).Level ElseIf GetPlayerAccess(index) = 1 Then Text = "[TESTER] " & Trim$(Player(index).Name) & " - LvL: " & Player(index).Level ElseIf GetPlayerAccess(index) = 2 Then Text = "[DEVELOPER] " & Trim$(Player(index).Name) & " - LvL: " & Player(index).Level ElseIf GetPlayerAccess(index) = 3 Then Text = "[ADMIN] " & Trim$(Player(index).Name) & " - LvL: " & Player(index).Level ElseIf GetPlayerAccess(index) = 4 Then Text = "[OWNER] " & Trim$(Player(index).Name) & " - LvL: " & Player(index).Level End If textSize = EngineGetTextWidth(Font_Default, Text) ' get the colour If GetPlayerAccess(index) = 0 Then colour = White ElseIf GetPlayerAccess(index) = 1 Then colour = Blue ElseIf GetPlayerAccess(index) = 2 Then colour = Green ElseIf GetPlayerAccess(index) = 3 Then colour = Red ElseIf GetPlayerAccess(index) = 4 Then colour = Yellow End If textX = Player(index).x * PIC_X + Player(index).xOffset + (PIC_X \ 2) - (textSize \ 2) textY = Player(index).y * PIC_Y + Player(index).yOffset - 32 If GetPlayerSprite(index) >= 1 And GetPlayerSprite(index) <= Count_Char Then textY = GetPlayerY(index) * PIC_Y + Player(index).yOffset - (D3DT_TEXTURE(Tex_Char(GetPlayerSprite(index))).height / 4) + 12 End If Call RenderText(Font_Default, Text, ConvertMapX(textX), ConvertMapY(textY), colour)End Sub``` Link to comment Share on other sites More sharing options...
Prince Posted November 21, 2011 Share Posted November 21, 2011 It've been posted tons of this feature. Link to comment Share on other sites More sharing options...
lexkymbeth Posted November 21, 2011 Author Share Posted November 21, 2011 @Prince:> It've been posted tons of this feature.oh well i made this one for my game. its probably the most easy thing to change on the client lol Link to comment Share on other sites More sharing options...
Techos Posted December 6, 2011 Share Posted December 6, 2011 uhmm why i getting an error when i compile ?this what it highlights Link to comment Share on other sites More sharing options...
lexkymbeth Posted December 6, 2011 Author Share Posted December 6, 2011 Eo? Link to comment Share on other sites More sharing options...
Techos Posted December 6, 2011 Share Posted December 6, 2011 Uhh… i forgot to say that it's CS:DE :cheesy:Sorry xD Link to comment Share on other sites More sharing options...
lexkymbeth Posted December 6, 2011 Author Share Posted December 6, 2011 Lol i can convert it. But, i dont have a computer atm Link to comment Share on other sites More sharing options...
Techos Posted December 6, 2011 Share Posted December 6, 2011 Wish you have because i really need. [I'M NOT REQUESTING] Link to comment Share on other sites More sharing options...
lexkymbeth Posted December 6, 2011 Author Share Posted December 6, 2011 k ill do it on my phone o.o Link to comment Share on other sites More sharing options...
lexkymbeth Posted December 6, 2011 Author Share Posted December 6, 2011 done Link to comment Share on other sites More sharing options...
Techos Posted December 6, 2011 Share Posted December 6, 2011 i got an error :sad: Link to comment Share on other sites More sharing options...
erkro1 Posted December 6, 2011 Share Posted December 6, 2011 Thats because this tutorial hasn't been tested, change all index in the sub with myindexAlso, GetPlayer should be GetPlayername Link to comment Share on other sites More sharing options...
RyokuHasu Posted December 6, 2011 Share Posted December 6, 2011 No, Erwin.the problem is```GetPlayer(Index).level```there is no GetPlayer(index).level, change it to just```Player(index).level```That's the only thing that needs to be fixed to make this work Link to comment Share on other sites More sharing options...
Domino_ Posted December 6, 2011 Share Posted December 6, 2011 @Ryoku:> No, Erwin.> > the problem is> ```> GetPlayer(Index).level> > ```> there is no GetPlayer(index).level, change it to just> > ```> Player(index).level> ```> That's the only thing that needs to be fixed to make this workIn client side must be GetPlayer(MyIndex).level or Player(MyIndex).level Link to comment Share on other sites More sharing options...
RyokuHasu Posted December 6, 2011 Share Posted December 6, 2011 If you use "MyIndex" EVERY player will have YOUR level above their head on your screen. That's why its called MyIndex, its for whoever is logged into the client.Test it with 2 accounts one level 5 and one level 10 in the same place at the same time.Besides there is no GetPlayer().level, why would there be? it would be GetPlayerLevel(), but i don't know if the client has that one, I'd have to check. Link to comment Share on other sites More sharing options...
Techos Posted December 6, 2011 Share Posted December 6, 2011 Oh.. i see .. Ryoku is right it worksthis is my DrawPlayerNamei also removed the End If in this parttextSize = EngineGetTextWidth(Font_Default, Text)SO THIS IS THE REAL CODE WORKING FOR CS:DE>! Public Sub DrawPlayerName(ByVal index As Long)Dim textX As Long, textY As Long, Text As String, textSize As Long, colour As Long>! If GetPlayerAccess(index) = 0 Then Text = Trim$(Player(index).Name) & " - Lvl: " & Player(index).Level ElseIf GetPlayerAccess(index) = 1 Then Text = "[TESTER] " & Trim$(Player(index).Name) & " - LvL: " & Player(index).Level ElseIf GetPlayerAccess(index) = 2 Then Text = "[DEVELOPER] " & Trim$(Player(index).Name) & " - LvL: " & Player(index).Level ElseIf GetPlayerAccess(index) = 3 Then Text = "[ADMIN] " & Trim$(Player(index).Name) & " - LvL: " & Player(index).Level ElseIf GetPlayerAccess(index) = 4 Then Text = "[OWNER] " & Trim$(Player(index).Name) & " - LvL: " & Player(index).Level End If>! textSize = EngineGetTextWidth(Font_Default, Text) ' get the colour If GetPlayerAccess(index) = 0 Then colour = White ElseIf GetPlayerAccess(index) = 1 Then colour = Blue ElseIf GetPlayerAccess(index) = 2 Then colour = Green ElseIf GetPlayerAccess(index) = 3 Then colour = Red ElseIf GetPlayerAccess(index) = 4 Then colour = Yellow End If textX = Player(index).x * PIC_X + Player(index).xOffset + (PIC_X \ 2) - (textSize \ 2) textY = Player(index).y * PIC_Y + Player(index).yOffset - 32 If GetPlayerSprite(index) >= 1 And GetPlayerSprite(index) <= Count_Char Then textY = GetPlayerY(index) * PIC_Y + Player(index).yOffset - (D3DT_TEXTURE(Tex_Char(GetPlayerSprite(index))).height / 4) + 12 End If Call RenderText(Font_Default, Text, ConvertMapX(textX), ConvertMapY(textY), colour)End Sub Link to comment Share on other sites More sharing options...
erkro1 Posted December 7, 2011 Share Posted December 7, 2011 @Ryoku:> No, Erwin.> > the problem is> ```> GetPlayer(Index).level> > ```> there is no GetPlayer(index).level, change it to just> > ```> Player(index).level> ```> That's the only thing that needs to be fixed to make this workOw yeah, didn't see that :P Link to comment Share on other sites More sharing options...
lexkymbeth Posted December 7, 2011 Author Share Posted December 7, 2011 @HeartHunt3r:> Oh.. i see .. Ryoku is right it works> > this is my DrawPlayerName> i also removed the End If in this part> textSize = EngineGetTextWidth(Font_Default, Text)> > SO THIS IS THE REAL CODE WORKING FOR CS:DE> > >! Public Sub DrawPlayerName(ByVal index As Long)> Dim textX As Long, textY As Long, Text As String, textSize As Long, colour As Long> >! If GetPlayerAccess(index) = 0 Then> Text = Trim$(Player(index).Name) & " - Lvl: " & Player(index).Level> ElseIf GetPlayerAccess(index) = 1 Then> Text = "[TESTER] " & Trim$(Player(index).Name) & " - LvL: " & Player(index).Level> ElseIf GetPlayerAccess(index) = 2 Then> Text = "[DEVELOPER] " & Trim$(Player(index).Name) & " - LvL: " & Player(index).Level> ElseIf GetPlayerAccess(index) = 3 Then> Text = "[ADMIN] " & Trim$(Player(index).Name) & " - LvL: " & Player(index).Level> ElseIf GetPlayerAccess(index) = 4 Then> Text = "[OWNER] " & Trim$(Player(index).Name) & " - LvL: " & Player(index).Level> End If> >! textSize = EngineGetTextWidth(Font_Default, Text)> > ' get the colour> If GetPlayerAccess(index) = 0 Then> colour = White> ElseIf GetPlayerAccess(index) = 1 Then> colour = Blue> ElseIf GetPlayerAccess(index) = 2 Then> colour = Green> ElseIf GetPlayerAccess(index) = 3 Then> colour = Red> ElseIf GetPlayerAccess(index) = 4 Then> colour = Yellow> End If> > textX = Player(index).x * PIC_X + Player(index).xOffset + (PIC_X \ 2) - (textSize \ 2)> textY = Player(index).y * PIC_Y + Player(index).yOffset - 32> > If GetPlayerSprite(index) >= 1 And GetPlayerSprite(index) <= Count_Char Then> textY = GetPlayerY(index) * PIC_Y + Player(index).yOffset - (D3DT_TEXTURE(Tex_Char(GetPlayerSprite(index))).height / 4) + 12> End If> > Call RenderText(Font_Default, Text, ConvertMapX(textX), ConvertMapY(textY), colour)> End Subthanks! i didn't test it Link to comment Share on other sites More sharing options...
game_heaven Posted December 7, 2011 Share Posted December 7, 2011 umm guys i know this has nothing to do with but when i open client.vbp with eclipse i dont know what to do next im using eo Link to comment Share on other sites More sharing options...
Kemerd Posted December 7, 2011 Share Posted December 7, 2011 Read some VB6 tutorials. Experiment. Ask for help. **ON THE QUESTIONS BOARD.** 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