Jump to content

Help


HUNGRY:3

Recommended Posts

Middle of the screen? because cursor is also in the middle

No no I mean when cursor is showing and player click on an element the window should appear near the cursor :D

Yeah I know it but I have no idea look.. Like this?

  
  
  
function cursorshit() 
   local showing = isCursorShowing () 
   if showing then  
      local screenx, screeny = getCursorPosition() 
      local myWindow = guiCreateWindow ( screenx,screeny, 0.5, 0.4, "test", true )   
end 
addCommandHandler("okay",cursorshit) 
  

Link to comment

ok this doesn't set the image near the cursor when i click on player ._.

function lxad(button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement) 
local x, y, z = getElementPosition(localPlayer) 
local showing = isCursorShowing () 
if showing then 
if  ( getElementType ( clickedElement )  == 'player' ) then 
if getDistanceBetweenPoints3D(x, y, z, worldX, worldY, worldZ)<=5 then 
guiSetVisible(CLP.staticimage[1],true) 
guiSetPosition ( CLP.staticimage[1], screenx, screeny,true ) 
guiSetText(CLP.label[1],"PlayerName: "..getPlayerName(clickedElement)) 
setTimer(function()guiSetVisible(CLP.staticimage[1],false)end,5000,0) 
end 
end 
end 
end 
addEventHandler ( 'onClientClick', root,lxad) 

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