Flower ☠ Power

Members
  • Content Count

    32
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Flower ☠ Power

  • Rank
    Rat

Recent Profile Visitors

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

  1. Well, I haven't shown the complete code in this post, we're talking about 30+ multiplications, anyways thanks for posting that script I didn't know we had something like that, so useful
  2. So today I was making a new HUD for players in dx, due this HUD will be displayed all the time I started thinking about how I can optimize it as maximun as possible... Going from this classic code: local screenW, screenH = guiGetScreenSize() local scaleX, scaleY = screenW/1920, screenH/1080 addEventHandler("onClientRender", root, function() dxDrawText("30/", screenW * 0.7786, screenH * 0.0648, screenW * 0.8380, screenH * 0.1426, tocolor(241, 173, 11, 255), scaleX, scaleY, dxfont0_excelsior_sans, "left", "top", false, false, false, false, false) dxDrawText("9999", screenW * 0.8354, screenH * 0.0657, screenW * 0.8807, screenH * 0.1130, tocolor(241, 173, 11, 255), scaleX, scaleY, dxfont1_excelsior_sans, "left", "top", false, false, false, false, false) end) to this "more optimized" one: local screenW, screenH = guiGetScreenSize() local scaleX, scaleY = screenW/1920, screenH/1080 local hudSizes = { (screenW * 0.7786), (screenH * 0.0648), (screenW * 0.8380), (screenH * 0.1426), (screenW * 0.8354), (screenH * 0.0657), (screenW * 0.8807), (screenH * 0.1130) } addEventHandler("onClientRender", root, function() dxDrawText("30/", hudSizes[1], hudSizes[2], hudSizes[3], hudSizes[4], 0xFFF1AD0B, scaleX, scaleY, dxfont0_excelsior_sans, "left", "top", false, false, false, false, false) dxDrawText("9999", hudSizes[5], hudSizes[6], hudSizes[7], hudSizes[8], 0xFFF1AD0B, scaleX, scaleY, dxfont1_excelsior_sans, "left", "top", false, false, false, false, false) end) As you can see I replaced the multiplications with some variables that represent the calculations (so it doesn't need to multiply the number everytime that "onClientRender" is triggered) and the same goes for the tocolor function. So as far as my understanding goes this would increase the performance, right? or atleast that's my question doing this would have any impact in clients performance? or it's just complicating the code for no reason?
  3. Thanks for the replies, I guess there is no way I can remove that animation and keep players be able to shoot, I'll give a try to make a github post
  4. There are two animations in this game that I want to remove, the elbow block that you do when you're very close to a person and it doesn't let you shoot your weapon, and the animation that doesn't let you shoot when you're very close to a wall. This animations just screw the PvP combat experience and I would like to remove them from my server How can I use engineLoadIFP engineReplaceAnimation In order to remove this animations
  5. The object that loses collision it's not like the old bug where some random objects of the map lose collision because of replacing, because in theory it was fixed and the object doesn't lose the collision the first time you join, then you /reconnect and it loses collision, in order to get the collision back you need to restart your MTA Client, I know it's kinda weird and it might get fixed by replacing the collision of those objects who lost collision, but I would like to keep my scripts as optimized possible so I would like to know if anyone knows an alternative solution to replacing it's collision file.
  6. There are some objects created in the map editor (.map files) that get collisionless after reconnecting, so basically the first time you join in they have collision but after that they get collisionless, if you're wondering what custom objects i'm using here is the table with them: local objects = { -- id, dff, col, txd {3976, "policest02_lan", "policest02_lan"}, {18023, "int_pizzaplace", "int_pizzaplace"}, {5418, "lae711block01", "lae711block01"}, {17700, "pigpenblok1_lae2", "pigpenblok1_lae2"}, {14838, "int_strip_club", "int_strip_club"}, {14785, "gen_otb", "gen_otb"}, {4683, "ladtbuild2_lan2", "ladtbuild2_lan2"}, {5732, "donut01_lawn", "donut01_lawn"}, {18021, "int_din_donut_main", "int_din_donut_main"}, {12853, "sw_gas01", "sw_gas01"}, {17534, "cluckinbell1_lae", "cluckinbell1_lae"}, {5168, "cluckinbell1_las2", "cluckinbell1_las2"}, {5813, "lawnshop1", "lawnshop1"}, {18022, "int_chick_main", "int_chick_main"}, {18030, "gap", "gap"}, {4572, "stolenbuilds11", "stolenbuilds11"}, {4584, "halgroundlan2", "halgroundlan2"}, {18026, "clothes_:~", "clothes_:~"}, {17517, "barberblock1_lae", "barberblock1_lae"}, {5521, "idlewofuk06_lae", "idlewofuk06_lae"}, {18007, "int_barbera12", "int_barbera12"}, {14682, "int_tatooa10", "int_tatooa10"}, {18082, "cj_barber2", "cj_barber2"}, {6095, "offvensp02_law", "offvensp02_law"}, {18045, "mp_ammu01", "mp_ammu01"}, {5106, "roadsbx_las2", "roadsbx_las2"}, {4552, "amubloksun1_lan", "amubloksun1_lan"}, {14665, "int_7_11a40", "int_7_11a40"}, {4022, "foodmart1_lan", "foodmart1_lan"}, {18031, "clothesexl", "clothesexl"}, {6334, "rodeo02_law2", "rodeo02_law2"}, {18008, "int_clothinga01", "int_clothinga01"}, {6385, "rodeo02tr_law2"}, {6351, "rodeo05_law2", "rodeo05_law2"}, {18025, "clothes_sports", "clothes_sports"}, {6353, "sunbils04_law2", "sunbils04_law2"}, {18024, "int_clothe_ship", "int_clothe_ship"}, {5414, "laejeffers02", "laejeffers02"}, {5637, "laealpha5", "laealpha5"}, {5459, "laejeffers01", "laejeffers01"}, {12948, "sw_block01a", "sw_block01a", "sw_block01a"}, {12976, "sw_diner1", "sw_diner1"}, {14655, "trukstp01", "trukstp01"}, {12862, "sw_block03", "sw_block03"}, {5762, "foodmartlawn", "foodmartlawn"}, {14667, "int_7_11a41", "int_7_11a41"}, {5040, "unionliq_las", "unionliq_las", "unionliq_las"}, {13361, "ce_pizza1", "ce_pizza1"}, {12924, "sw_block06", "sw_block06"}, {5140, "snpedtatshp", "snpedtatshp"}, {5853, "sunset21_lawn", "sunset21_lawn"}, {13131, "sw_block05", "sw_block05", "sw_block05"}, {12984, "sw_block11", "sw_block11"}, {18282, "cw_tsblock", "cw_tsblock"}, {18552, ":Os_ammun", ":Os_ammun"}, {18237, ":Ow_dinerwst", ":Ow_dinerwst"}, {18020, "int_6burger_main", "int_6burger_main"}, {18049, "ammu_twofloor", "ammu_twofloor"}, {17515, "scumgym1_lae", "scumgym1_lae"}, {14831, _, "lm_stripbar"}, {14846, _, "int_ppol"}, {5498, _, "laeroad33"}, {5411, _, "laeroadsblk"}, {5166, _, "dkcargohull2bd"}, {5491, _, "laeroad26"}, {5494, _, "laeroad29"}, {5862, _, "road_lawn31"}, {4898, _, "clifftestgrnd"}, {5483, _, "laeroad17"}, {5482, _, "laeroad16"}, {14825, _, "int_boxing07"}, {18053, _, "munation_xtras04"}, {18052, _, "munation_xtras03"}, {1977, _, "vendin3"}, {18051, _, "range_xtras03"}, {18092, _, "ammun3_counter"}, } Help me please
  7. Thanks for the answer and sharing your own experience, I think I might stick to triggerEvent looks like more manual but it seems that it's way cleaner than elementData.
  8. As far as I understood TriggerEvent would take more RAM (more code store while is executing) and more Bandwidth, while Element Data would be more CPU intensive, right?
  9. I've got a performance question, let's put the hypotetical case where I want to make players showing bubbles like "writting..." when they're typing in the chat, I don't have any issue making a script like that but my question is about performance, now let's say that to sync this information with other players I use setElementData, then every player in the server "knows" who's writting, but the problem is that everyone his mother knows how CPU intensive SetElementData can be if it's constantly triggering. In the other hand let's say that to make a more optimized system, I first get in the client side like all the players in a radious of 100 units then make a table with all the players in this radious, send it via TriggerServerEvent, then send back the information to the players in the table using the first optional argument of triggerClientEvent. Which would perform better, and more important how CPU intensive is sending tables via TriggerServerEvent?
  10. Hello there, first of all a little bit of context: I'm scripting my own server and right now I use MTA's default account data system to storage it's very simple to use and for simple stuff like player kills, money... it's really easy and confortable to use, but when we're talking about storaging about bigger data like maybe the clothes that he's wearing if he has CJ skin I have to start doing tricks with toJSON in order to storage it as string and then back it up as a table... Overall I don't have any issue, but now with more complex stuff like group system I'm seriously thinking about making my own custom MySQL data storage system. Now my questions are more specifically about performance, how good is MTA default acc storage system? does a custom one with MySQL perform better? and ultimately the most important is it worthy making a whole new storage system for your own server or should stick to the default one (or maybe mix them)?
  11. There is a bug on my server where right after logging for some reason other players that are already logged they see you hard sliding, does anyone know why this is happening? is kinda awkward and it seems to get fixed when the player just dies: https://youtu.be/CXTP11_g7ws
  12. That's the center of the screen this doesn't mean it's where your aim sight it is, I have tested using GetScreenFromWorldPosition and it seems it's not the same, I shoot at the center of the enemy ped and return it's position with getElementPosition(source) and in hypothetical case that if screen center would be the center of your aim sight wouldn't be the same or very similiar? addEventHandler("onClientRender", root, function() for _, v in pairs(getElementsByType("player")) do local x, y, z = getElementPosition(v) local okX, okY = getScreenFromWorldPosition(x, y, z) if (okX ~= false) and (okY ~= false) then dxDrawRectangle(okX - 4, okY - 4, 4, 4) end end end) I have drawn a little rectangle in the center of every player to see where is the exact center and I can conclude that the aim sight position IS NOT the center of the screen.
  13. Which is the screen X and the Y when I aim, of my weapon sight? is it the center of the screen? or how do I get it
  14. Server IP: 94.23.196.29:22003 or mta.gtirpg.net:22003
  15. This is a video i made some months ago in a MTA Server that doesn't exist anymore. I expect enjoying the video since you won't be able to enjoy a server that doesn't exist anymore JAJAJAJA