Jump to content

Variable issue.


Hexa

Recommended Posts

Hello there. I am wondering why my code below isn't working. Well, I want to set selected to 1.

As you can see on line 9, I am trying to set variable to 1 but it doesn't. But actually, variable setting on line 48 works. The rest doesn't.

Hope you understand me.

SOLVED.

Thanks in advance.

Edited by Guest
Link to comment

We don't see the rest of the code. It's simply not working because the comparison is wrong. We don't know the coord of what you're comparing. You have to debug it yourself. Since you're using onClientRender, I'd use dxDrawText to show where the mouse is and where the intersecting rectangles are. Then you'll see why it doesn't work.

Link to comment

Code is correct. I just wanna set variable but it doesn't set except for last one.

Here are some screenshots.

Clicking on icon #1 - Stats

Link deleted.

outputChatBox: nothing.

Clicking on icon #2 and #3 - same as icon #1

Clicking on icon #4 - Settings

Link deleted.

outputChatBox: clicked4 - Works fine.

Edited by Guest
Link to comment

I get it now. It doesn't work because even if icon #1 worked fine your function will carry on executing and eventually it will reach line 54 which sets it back to 0. You should add "return;" to each "if" statement (NOT "else") and it should be fine since you don't want to check other bounding boxes once the mouse is inside of one of them.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...