Jump to content

Et-win

Members
  • Posts

    1,390
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Et-win

  1. Checked debugscript 3? I doubt it's not working.
  2. Test it, then you know or it's right.
  3. table.insert(weapon, {wep, totalwep}) Make another table, because you only put 1 value on 1 'rule'.
  4. Et-win

    fixed at my own

    1. What is not working? Does it run anything? 2. Check /debugscript 3 in-game to see any errors.
  5. It started the function, so it's already server-side.
  6. Why not making it client-side? Just use 1 trigger to get it started at client-side?
  7. By the way, you can also create a GUI button on the same spot as the 'dxDrawRectangle'. Just make it invisible. Also always check with 'isElement' or the button has been created, if not, create it. Then you can just use 'onClientGUIClick'. As soon as you remove the 'dxDrawRectangle' code (When you remove the login screen) then destroy the GUI button with 'destroyElement'.
  8. --1 Announcement: xmlFindChild xmlNodeGetAttribute --Or all announcements: xmlNodeGetChildren xmlNodeGetAttribute --[[Or:]] xmlNodeGetAttributes
  9. You can think about some math too local gCursor_pX, gCursor_pY = getCursorPosition() local sWidth, sHeight = guiGetScreenSize() gCursor_pX, gCursor_pY = gCursor_pX*sWidth, gCursor_pY*sHeight
  10. local text = guiGetText(memo) text = text.."add more stuff here" guiSetText(memo, text)
  11. Change 'onClientGUIClick' to 'onClientClick'. Forgot that it indeed only clicks on GUI.
  12. Anything on /debugscript 3? Did you look? Try this: outputChatBox(tostring(gCursor_pX).." "..tostring(gCursor_pY))
  13. If you type /debugscript 3 you get any errors. Then you would know I forgot to remove "480, 590, 122, 52" out of my code, lol. addEventHandler ( "onClientGUIClick", root, function() local gCursor_pX, gCursor_pY = getCursorPosition() if (gCursor_pX > 480) and (gCursor_pY > 590) and (gCursor_pX < 480+122) and (gCursor_pY < 590+52) then outputChatBox("Test !!") end end)
  14. Use this 'code' for a new line: \n And this for the date: https://wiki.multitheftauto.com/wiki/GetTimestamp
  15. Also 'dxDrawRectangle' returns a boolean only. Almost all DX codes do that. addEventHandler ( "onClientGUIClick", root, function() local gCursor_pX, gCursor_pY = getCursorPosition() 480, 590, 122, 52 if (gCursor_pX > 480) and (gCursor_pY > 590) and (gCursor_pX < 480+122) and (gCursor_pY < 590+52) then outputChatBox("Test !!") end end) This would work in your case. (If I didn't do anything wrong) Atleast you can understand what I'm trying to do out of this. I'm checking or the cursor is between the 'dxDrawRectangle' (Login Button) code as soon as you clicked. If you are going to do it on this way, I prefer a variable for the positions, because if you ever want to change the positions, you don't have to change all positions in the script, only the variable you would have to change by then.
  16. dxDrawText This code returns a boolean only. (true or false) This means you cannot use it as element to check or it was pressed. You have to do this with positions or GUI.
  17. No... Is this actually the real code? Because that addEventHandler has not to be on the function which is on onClientRender.
  18. Set source to player @ setElementInterior... setElementInterior(player, 6 ,246.7, 63.3, 1003.6) You had source instead of player. The source = the marker which got hit, not the element. Do this by both setElementInterior codes.
  19. Where are 'login' and 'register' defined? Ow and btw, you know you are adding the 'addEventHandler's now by every frame? That's really bad.
  20. Set source to player... Look what 'onMarkerHit' even returns. https://wiki.multitheftauto.com/wiki/OnMarkerHit "The source of this event is the marker that got hit by the element."
  21. setElementInterior(source, 6 ,246.7, 63.3, 1003.6) You are setting the marker to the interior.
  22. Are you sure it are the right positions?
  23. You are adding the addEventHandlers before the functions. Post them after the functions or put the functions in it.
×
×
  • Create New...