Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. I guess "winner" text is not being created?
  2. Check your code, you defined it "currentLevel = getElementData blabla".
  3. Because they store it this way: randomTable = { } randomTable [ "my loling text" ] = "myData" Then you can do: randomTable [ "my loling text" ] = nil
  4. Well, now that you posted the way you insert to your table, I can see the problem. That table is an indexed one, that's why you can't remove the items that way, you need to use it like this: randomTable [ 1 ] = nil Or simply using: table.remove ( randomTable, 1 )
  5. Mind posting the rest of your code?
  6. That code gives me headache when trying to read it, anyway, simply check if the index is on your table.
  7. Are you sure that 'source' is the correct element?
  8. You can use this simple function: function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing ( ) ) then return false end local sx, sy = guiGetScreenSize ( ) -- Get the player screen resolution local cx, cy = getCursorPosition ( ) -- Get the cursor position local cx, cy = ( cx * sx ), ( cy * sy ) -- Convert relative positions to absolute if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then return true else return false end end Example: addEventHandler ( "onClientRender", root, function ( ) local color = tocolor ( 0, 0, 0 ) if isMouseInPosition ( 200, 200, 50, 50 ) then color = tocolor ( 255, 0, 0 ) end dxDrawRectangle ( 200, 200, 50, 50, color ) end )
  9. To something else, example: "menuState".
  10. Maybe the upgrades are being applied after, try this: addEvent ( "onRaceStateChanging", true ) addEventHandler ( "onRaceStateChanging", root, function ( state ) if ( state == "GridCountdown" ) then for _, player in ipairs ( getElementsByType ( "player" ) ) do local theVehicle = getPlayerOccupiedVehicle ( player ) if ( theVehicle ) then removeVehicleUpgrade ( theVehicle, 1085 ) end end end end )
  11. Remove every wheel upgrade when you first get the vehicle. onVehicleEnter removeVehicleUpgrade
  12. That's because you named your function the same as your variable "DxMenu". Rename your function or variable.
  13. That's because 'currentLevel' is nil, you forgot to define it the same way you did in "LevelOnWasted" function.
  14. local menuState = false -- Menu is hidden And then, inside your "F1RPhelp" function: menuState = true -- Menu is visible Then you check if the menu is visible inside the onClientClick function: addEventHandler ( "onClientClick", root, function ( ) if ( menuState ) then -- if the menu is visible... if isMouseInPosition ( 481, 380, 70, 29 ) then outputChatBox ( "CLICKED!" ) end end end )
  15. That's why you need to define a global variable specifying if the menu is open or not.
  16. dxDrawText only returns a boolean (true/false). I told you to use onClientClick, use my example.
  17. Why are you creating a GUI window?
  18. Define a global variable, then update the state inside the function "F1RPhelp".
  19. Define a variable with the status of your interface.
×
×
  • Create New...