willunited Posted March 2, 2013 Author Share Posted March 2, 2013 i make a gui showing the target stats,but in the field of hp he shows 0.what i do? Link to comment Share on other sites More sharing options...
Daneta Posted March 2, 2013 Share Posted March 2, 2013 re cheak your code or maby its becuse the gui has that. Link to comment Share on other sites More sharing options...
willunited Posted March 2, 2013 Author Share Posted March 2, 2013 i put GetPlayerMaxVital(mytarget)but he appear as 0.all other stats is working fine. Link to comment Share on other sites More sharing options...
Synergy Posted March 2, 2013 Share Posted March 2, 2013 > re cheak your code or maby its becuse the gui has that.I appreciate you're trying to be helpful, but: [If You Don't Know the Answer, Don't Reply](http://www.touchofdeathforums.com/community/index.php?/topic/113011-dont-know-the-answer-dont-reply/). Link to comment Share on other sites More sharing options...
Wortel Angels Posted March 2, 2013 Share Posted March 2, 2013 GetPlayerMaxVital is the maximum of the Vital from an PlayerSo its getplayervital(Target) for players or mytarget idk now exactand for NPC's is there NPC(NPCNum).HP if im correct thereartix… i know you want help but please... HP stuff is already coded so please please take a look first in the code befor you write some wrong stuff(Wrote on my Mobile) Link to comment Share on other sites More sharing options...
blkcrow Posted March 10, 2013 Share Posted March 10, 2013 how are you trying to do this? Are you requesting the vitals from the server and display them in when the server sends them or is your code only client side? Also are you checking to see if the target type is NPC or Player? Post your code here it will be easier for us to help you this way Link to comment Share on other sites More sharing options...
willunited Posted March 10, 2013 Author Share Posted March 10, 2013 RenderText Font_Default, Trim$(Player(mytarget).Vitals(HP)) & "/" & Trim$(Player(mytarget).MaxVitals(HP)), dX + 340, 302 - 237, White, 0, False Link to comment Share on other sites More sharing options...
blkcrow Posted March 10, 2013 Share Posted March 10, 2013 you are never checking to see if the target is an npc or a player so if your target is an npc mytarget holds the wring index Link to comment Share on other sites More sharing options...
willunited Posted March 10, 2013 Author Share Posted March 10, 2013 This is a little part of the sub.I need to make a RequestTargetVitals sub and in server side i need to make a SendTargetVitals i think… Link to comment Share on other sites More sharing options...
escfoe2 Posted March 17, 2013 Share Posted March 17, 2013 If you are using Origins or Mega then here's a thought that may clear things up and make it easier for you.**(1st)**When you click to target something, PlayerSearch(CurX, CurY) is called in the HandleMouseDown sub. This sends a packet to the server where the server interprets it in modHandleData - HandleSearch.**(2nd)**HandleSearch figures out if you've targeted an npc or a player and then sends back the index and the target type to modHandleData - HandleTarget.**(3rd)**Now the client has the target and the type of target.My recommendation is to simply use the global variable 'MyTargetType' to identify the target and simply get the vitals appropriately.This can all be done Client-Side.I know I could have just said that but I feel you should know more about what you're doing to get better at doing it.**(Side-Note)**To be clear:GetPlayerVital(index, HP) Returns the player's current healthGetPlayerMaxVital(index, HP) Returns a player's health when it's fullNPC(npcnum).HP Returns an npc's health when it's fullCorrect me if I'm wrong in any way. I'm not a god, I do make mistakes. Link to comment Share on other sites More sharing options...
abhi2011 Posted March 17, 2013 Share Posted March 17, 2013 Wouldn't it be better to let the server send the target details? Link to comment Share on other sites More sharing options...
escfoe2 Posted March 21, 2013 Share Posted March 21, 2013 > Wouldn't it be better to let the server send the target details?As soon as you click something on-screen, if it is target-able, it is sent to the server which interprets it and sends it back. I just said that up above bud. Link to comment Share on other sites More sharing options...
abhi2011 Posted March 21, 2013 Share Posted March 21, 2013 > This can all be done Client-Side.> > > Wouldn't it be better to let the server send the target details? Link to comment Share on other sites More sharing options...
escfoe2 Posted March 21, 2013 Share Posted March 21, 2013 *facepalm*Meaning you don't have to add anything to the Server..So to answer your question; Obviously yes because it already does.Please excuse me for not being more clear. I apologizeAlso excuse my attitude, I've been up all night. I'm tired and stressed ![;)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/wink.png) Link to comment Share on other sites More sharing options...
abhi2011 Posted March 21, 2013 Share Posted March 21, 2013 My question is why not do it server side. It would mean that the values are at least valid and trustworthy. If the client doesn't get a certain update like a players level, then the target details is never updated. Link to comment Share on other sites More sharing options...
escfoe2 Posted March 22, 2013 Share Posted March 22, 2013 You make a good point, I'll give you that. You can do it that way. In my opinion, I don't see a point in adding more to the server. It shouldn't cause any issue with hacking anyway so why not use what's already given to you. This doesn't mean you have to, however. I just made a recommendation. 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