Jump to content

Gallardo9944

Members
  • Posts

    442
  • Joined

  • Last visited

Everything posted by Gallardo9944

  1. https://community.multitheftauto.com/ind ... ls&id=9334 Stolen from WTF DONE
  2. That's strange cause it's a VPS. The host says there's nothing what could block the traffic
  3. You can simply use sin and cos for such things. Just change the rotation and then calculate positions for it (something like +math.cos(math.rad(rot))*sx)
  4. what for? You'll have to use string.lower anyway.
  5. You can edit admin panel to display that the way you like. There's table.sort function for such operators.
  6. Of course it will not work. onResourceStart (if we speak about current resource) runs AFTER everything outside it. So outputDebugString should be inside the realTime function.
  7. It does if you add more checks before actually drawing and moving.
  8. Well, you can obviously do setElementDimension(0) first, and then set position.
  9. Injection means using a custom code by abusing mistakes made by scripters. Avoiding is simple: never do something with the "direct" text the player wrote. He can write a lua script there by breaking out of your resource and do what he wants.
  10. local offset = 0 -- offset should be 0 by default function scoreScroll(side) if side == "mouse_wheel_down" then offset = offset + 10 -- scroll down elseif side == "mouse_wheel_up" then offset = offset - 10 -- scroll up end end bindKey("mouse_wheel_up","down",scoreScroll) bindKey("mouse_wheel_down","down",scoreScroll) --Later in your rendering part dxDrawText(text,px,py+offset,sx,sy,...) -- render, including scroll
  11. That's not even maths tho
  12. Use it in rendering as positioning.
  13. You are not able to save mta tables into mysql. You should save that as a text (you might wanna use a JSON format tho)
  14. Add a variable called "offset" and increase/decrease with when you move the mouse wheel.
  15. You have to set that element datas to display them. Update manually each time you set new values.
  16. apparently it doesn't set the tick count. Add at the beginning of the code: local g_PickupStartTick = getTickCount()
  17. There are more than 500k serials possible though. But I don't use serials as a base for smth - there are situations when you are not using your own computer or got a new one.
  18. If you want to save a file without special symbols in the name, but don't want to gsub every single one, you might consider using this function: -- Get the string using this function function getUTFlessString(str) if not (type(str) == "string") then return end local arr = UTF8ToCharArray(str) local ln = { } for k,v in pairs(arr) do local sz = 0 for t in v:gmatch"." do sz = sz + 1 -- count the size per symbol end if sz <= 1 then table.insert(ln,v) end end str = table.concat(ln,"") return str end function UTF8ToCharArray(str) local charArray = {} local iStart = 0 local strLen = str:len() local function bit(b) return 2 ^ (b - 1) end local function hasbit(w, b) return w % (b + b) >= b end local function checkMultiByte(i) if (iStart ~= 0) then charArray[#charArray + 1] = str:sub(iStart, i - 1) iStart = 0 end end for i = 1, strLen do local b = str:byte(i) local multiStart = hasbit(b, bit(7)) and hasbit(b, bit(8)) local multiTrail = not hasbit(b, bit(7)) and hasbit(b, bit(8)) if (multiStart) then checkMultiByte(i) iStart = i elseif (not multiTrail) then checkMultiByte(i) charArray[#charArray + 1] = str:sub(i, i) end end checkMultiByte(strLen + 1) return charArray end The usage is simple: local c = "[DM] Packy Ѡ vol.13 Ѡ Defiance Ѡ" local dc = getUTFlessString(c) -- the result will be "[DM] Packy vol.13 Defiance "
  19. Nah, i'm not looking for reflection. I just want to make the vehicle colour use its max brightness.
  20. Oh wow, full copypaste of my example Use triggerClientEvent.
  21. Hello. When the car is under some light (e.g. headlights from other car or a street lamp), vehicle's colour is also brighter. Is there any proper way of making the car always act as it's under some direct light? Thanks.
  22. viewtopic.php?f=91&t=65746&p=619388
  23. Just remove the event handler each time you are not sure if it's added or not.
×
×
  • Create New...