Sign in to follow this  
botshara

dxDrawRectangle on right click

Recommended Posts

Hello, Im trying to make inventory script and I want when I press right mouse button on the item then acurs my function.

The problem is that dx functions doesnt support onClientClick by default, I looked in forum and I found some solutions where onClientClick checks for coords, but this variant is not suitable for me because i need also check which item I pressed. Also I cant use onClientGUIClick for example by creating empty label because onClientGUIClick doesnt work when I press right mouse button.

Any ideas?

Edited by botshara

Share this post


Link to post

You can use a dx lib instead of MTA's gui. So that you don't need to worry about it.

Edited by thisdp

Share this post


Link to post
7 hours ago, thisdp said:

You can use a dx lib instead of MTA's gui. So that you don't need to worry about it.

What do you mean with dx lib? Resource?

Share this post


Link to post

What would probably be a lot easier, more flexible, and nicer would be to make use CEF instead.
This will require you to use HTML, CSS and Javascript as well. But even if you've never done it before, it's not that difficult.

https://wiki.multitheftauto.com/wiki/CEF_Tutorial

 

Otherwise for the dx solution, you will need to compare the position you clicked on with the position of the items, since dxDraw functions don't create elements or anything like that, they just draw a couple lines and such for you.

  • Thanks 1

Share this post


Link to post

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.