Jump to content

Problem with onClientClick


Piorun

Recommended Posts

Posted

I have this code:

  
function tworzeniePickupa () 
  
   sx,sy,wx,wy,wz = getCursorPosition" class="kw4">getCursorPosition() 
   outputChatBox(wx.." "..wy.." "..wz) 
    
end 
addEventHandler ( "onClientClick", getRootElement(), tworzeniePickupa ) 
  

Everything is cool, but this code send me 2 messeges (outputChatBox) with coords of GTA world.

Please, help :(

Posted

I don't understand what do you want to do, could you put your script in English language firstly? and then explain again what do you want to do.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

  • Moderators
Posted

Maybe in your meta.xml, yourScript.lua is loaded 2 times or there are 2 times the function tworzeniePickupa in your code.

Why get the position of the cursor again because this event send this parameters ( button, state, absoluteX, absoluteY, wx, wy, wz, clickedElement ):

function tworzeniePickupa ( button, state, absoluteX, absoluteY, wx, wy, wz, clickedElement ) 
   outputChatBox(wx.." "..wy.." "..wz) 
end 
addEventHandler ( "onClientClick", getRootElement(), tworzeniePickupa ) 

The rEvolution is coming ...

Posted
function tworzeniePickupa ( button, state, absoluteX, absoluteY, wx, wy, wz, clickedElement ) 
    if state == "down" then 
        outputChatBox(wx.." "..wy.." "..wz) 
    end 
end 
addEventHandler ( "onClientClick", getRootElement(), tworzeniePickupa ) 

Retired

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...