Jump to content

klaw

Members
  • Posts

    23
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

klaw's Achievements

Civilian

Civilian (7/54)

4

Reputation

  1. klaw

    table sort

    I have a table: local myTable = { [204] = { 50, 10 }, [820] = { 22, 32 }, [103] = { 42, 66 }, } How can I sort this table by the first index, so it'd be in order, like: 50, 42, 22 descending.
  2. Oh! Didn't see that, sorry! But thanks, it works perfect.
  3. It seems that using all 4 corners doesn't accomplish what I need, @Jayceon, because there are some occurrences when the two rectangles are touching but none of the corners are conflicting. For example: https://gyazo.com/981ce6b1691e68c833ba4934a3216979 As you can see in the diagram, the two rectangles are touching but none of the corners are within each other. Appreciate any further help.
  4. Sorry, yes. I've figured it out. Apologies to @Jayceon, your code was perfect, I just copied it incorrectly. Thank you.
  5. The one Jayceon posted didn't work. Also, I've tried top, left, bottom and right but it doesn't do what I want it to do. I need the sides too.
  6. Does anybody know how I can check if a rectangle (x, y, width, height) is touching another rectangle (x, y, width, height) on the screen? I have two DX rendered rectangles and want to check if they're touching, so I can change the colour of them if they are.
  7. Pretty self explanatory. I think an event for when elements are created would be very useful. The source of the event should be the element and maybe a parameter for whichever resource the element was created in.
  8. That didn't answer my question. I know how to use guiSetProperty. I'm asking about the property "LookNFeel". Not "Disabled".
  9. I've tried to experiment with the property 'LookNFeel' for CEGUI, but I have no idea what it does. Does anybody know?
  10. Calm down and keep your salt levels at minimum. I'm stating what I've witnessed and I find it extremely ironic how you hate on communities and claim they're :~, constantly crying, undermining them and then you come asking for help from the same people. 75% of my post was helping you, the other 25% was pointing out how pathetic your actions were and what they've led to. Grow up kid and accept the truth.
  11. I thought you were a pro scripter, rays? Giving hate to all the roleplay communities that launch? Claiming people cannot script or are :~ at scripting? Ironic isn't it? guiCreateButton on your example is completely wrong. A button does not have a Z coordinate because it's a 2 dimensional element. Proper: guiCreateButton(x, y, width, height, "Delete", relative, parent) When the player clicks the button, it triggers onClientGUIClick. Once clicked, figure out which row is selected on your grid list using guiGridListGetSelected. To delete it from the grid list you can use guiGridListRemoveRow and to delete it from the DB you need to run a delete statement, e.g. "DELETE FROM stats ... etc" Remember don't use the MySQL module as it's now deprecated, use the native MySQL functions such as dbQuery and dbConnect.
  12. klaw

    Table sorting

    Okay I have a couple questions regarding table sorting: How can I sort this table, from A to Z by it's first value, so myTable[1]? local myTable = { { "David", 21, "Male", "Chicago" }, { "Jessica", 42, "Female", "New York" }, { "Kevin", 14, "Male", "New York" }, { "Louise", 21, "Female", "Washington" }, } Similar with numbers, how do I sort that table from lowest to highest by it's second value, myTable[2]? Thank you.
  13. I'm firing a round with 5 rounds total. It goes from 4, 3, 2, 1, 0 and stops firing. It allows you to continue firing after you lower your gun and raise it again, and also fires 0, then performs the automated GTA SA reload. It's not anywhere else. Mind sharing your code?
  14. function checkClip(weapon, ammo, clipammo) if clipammo == 1 then bindKey("R", "down", clientReloadClip) toggleControl("fire", false) toggleControl("next_weapone", false) toggleControl("previous_weapon", false) end end addEventHandler("onClientPlayerWeaponFire", getRootElement(), checkClip) For some reason, when shooting a gun, you get to the last bullet and it stops shooting. But if you release the fire button and press it again, it allows you to continue shooting even though I've used toggleControl and disabled the ability to shoot. Is this a bug with toggleControl or did I do something wrong? next_weapon is spelt wrong, I fixed that, but it didn't affect anything.
×
×
  • Create New...