Jump to content

srslyyyy

Scripting Moderators
  • Posts

    635
  • Joined

  • Days Won

    8

Everything posted by srslyyyy

  1. After some testing i could just say: wow. Just for the sole fact of updated syntax this is amazing (although there is mistakes to be found), and the latter is just spicy addition.
  2. I assume both annotations and go to definition (particularly variable, because you can already go to function definition) works for Sublime Text 4 as well?
  3. Nie zajmujemy się poszczególnymi serwerami, toteż aby odzyskać dostęp musisz zgłosić się do administracji danego serwera.
  4. Zapewne odnosisz się do danego serwera, musiałbyś się zgłosić na ichniejszym forum.
  5. Make sure to update all default (and community) resources. Keeping them outdated could lead to such scenarios, where they could make use of incorrectly written logic. Disable access to load and loadstring in ACL, unless you have certain reason to keep it enabled (latest MTA builds have it disabled by default). <right name="function.loadstring" access="false"/> <right name="function.load" access="false"/> You could take a look at Script security article, which i've recently updated. Also, there's no such anti-cheat which would protect you from vulnerable Lua code running on your server, so blaming it in first place isn't reasonable - which most of people nowadays shamelessly do. Including ungratefulness towards AC team, which provided nearly cheat-free experience for a few good years.
  6. Try this, but carefully read full page. Might require some changes though. https://wiki.multitheftauto.com/wiki/CallServerFunction
  7. You can use https://wiki.multitheftauto.com/wiki/Animate In order to smoothly change volume.
  8. Napisz tutaj - https://forum.multitheftauto.com/forum/180-ban-appeals/ Tylko po angielsku.
  9. function onClientPlayerDamage(pAttacker, pDamage, pBodypart) local localAttacker = pAttacker == localPlayer if not localAttacker then return false end -- do trigger event to server, preferrably do some check if victim ~= localPlayer; victim in this case is 'source' (without ') end addEventHandler("onClientPlayerDamage", root, onClientPlayerDamage) Note that i won't do everything for you, for next part please read:
  10. Perhaps freeroam/fr_client.lua (line 60) For the next time please use Find in files feature, which should be available in any decent code editor. It's CTRL + SHIFT + F for Sublime Text.
  11. Hit markers are probably based off attacker sync, use onClientPlayerDamage event (bind it to root), check if attacker equal to localPlayer, and then kill player if required (triggerServerEvent, and kill player server-side)
  12. Topic moved for better results.
  13. If you mean command then you could use optional argument for addCommandHandler. bool addCommandHandler ( string commandName, function handlerFunction [, bool restricted = false, bool caseSensitive = true ] )
  14. As long as it have collision it should be retrievable with https://wiki.multitheftauto.com/wiki/OnClientVehicleCollision With either hitElement or model parameter. However i think that's not a case for stinger - which you are trying to do i guess? Have a look at this resource which might help you: https://community.multitheftauto.com/index.php?p=resources&s=details&id=125
  15. Hi Your topic has been moved to Portuguese scripting section for better results.
  16. From what i can see the or operator is missing here. if teamName == "~STAFF" isObjectInACLGroup("user."..account, aclGetGroup("Admin")) then It should looks like this: if teamName == "~STAFF" or isObjectInACLGroup("user."..account, aclGetGroup("Admin")) then Also you need one more end which will close function scope.
  17. Not really. I am using this method on 1360x768.
  18. You would need to use cancelEvent() (to cancel default behaviour) in onClientVehicleDamage and write your own damage system via this event.
  19. srslyyyy

    Dead Body

    We aren't able to help without code.
  20. If you wanna keep script in this state, i will explain what could be done better. Start off by: Saving an function call in: local dimension = getElementDimension(localPlayer) Currently, you are returning it every frame, while you could save it in main scope and avoid calling it. By using onClientElementDimensionChange to store localPlayer's current dimension. local dimension = 0 function onClientElementDimensionChange(_, newDimension) dimension = newDimension end addEventHandler("onClientElementDimensionChange", localPlayer, onClientElementDimensionChange) Saving an another function call: local px, py, pz = getElementPosition(getElementByID("ped1")) I'm assuming that custom element is created on script init, otherwise you would need to update it at the time it creates. -- Main scope local myPed = getElementByID("ped1") -- Render scope local px, py, pz = getElementPosition(myPed) For next step, you could use custom implementation of getDistanceBetweenPoints3D which is faster from MTA (thanks @Sarrum) local function getDistance3D(pFirstX, pFirstY, pFirstZ, pSecondX, pSecondY, pSecondZ) pFirstX, pFirstY, pFirstZ = pFirstX - pSecondX, pFirstY - pSecondY, pFirstZ - pSecondZ return (pFirstX * pFirstX + pFirstY * pFirstY + pFirstZ * pFirstZ) ^ 0.5 end Another thing which most of scripters forget about is using tocolor in render, even if color doesn't change... tocolor(3, 169, 252, 255) -- notice () - a function call which returns same color every frame The solution will be to save it in local variable in main scope and later use it. -- Main scope local textColor = tocolor(3, 169, 252, 255) -- Render scope dxDrawText("Unknown", sx, sy, sx, sy, textColor, 2.02, "default-bold", "center", "center", false, false, false, false, false) If color isn't static you could use, for example events or timers which will be ideal way to update it. Other than that, you might use onClientElementStreamIn/onClientElementStreamOut to add/remove handler when ped appears or disappears from stream zone, as mentioned above by Dutchman101.
  21. There's a guide for this - See How to add "remember me" functionality. You shouldn't store password on client-side, even encoded.
  22. We are here to help, not to do job for you. https://wiki.multitheftauto.com/wiki/OnClientKey See examples to understand how this event works.
×
×
  • Create New...