-
Posts
6,062 -
Joined
-
Last visited
-
Days Won
208
Everything posted by IIYAMA
-
How to determine if something attached to player's hand?
IIYAMA replied to thund3rbird23's topic in Scripting
That is the same resource. -
What are you waiting for? You know which function is not working properly and yet you are only looking at your own resource? Question for yourself: What are the conditions and expected returned results of the takeitm function?
-
Looks like a typo: exports.dota:takeitm( thePlayer, 1 <missing: , > 50)
-
He probably means: https://wiki.multitheftauto.com/wiki/RemoveEventHandler Or just destroy the function: trigger = nil ?
-
I assume /webfile/ is a different resource then where the file is loaded from? (In that case it is important that the webfile has atleast started once and the file has been downloaded before the browser request. Check the client folder for the html file. ) If it is not that, then indeed it might be a bug. (They disabled the old local url method after all)
-
Can't you do the samething, as in this topic? ?
-
Does this person have a name? Bigbadbutler/PhatLooser from chaos.de perhaps? Probably not, as he is not active any more. He indeed used processLineOfSight. A player will 0.5k+ ping still manages to kill another player. But never the less, it looks advanced, but it is still at the very bone, similar to the headshot resource. It is just way less enchanted, without overwrites. Is the person you meant on this list?
-
It is more dirt than magic. ? One of the first concepts of it was used in this headshot resource: https://community.multitheftauto.com/index.php?p=resources&s=details&id=1600 It is really a disgusting concept... ? function sendHeadshot ( attacker, weapon, bodypart, loss ) At first it looks innocent, but if you see this line, you know you kissed your opponent: if attacker == getLocalPlayer() then if bodypart == 9 then triggerServerEvent( "onServerHeadshot", getRootElement(), source, attacker, weapon, loss ) setElementHealth ( source, 0 ) setPedHeadless( source, true ) end end end addEventHandler ( "onClientPedDamage", getRootElement(), sendHeadshot ) addEventHandler ( "onClientPlayerDamage", getRootElement(), sendHeadshot )
-
You could try this for your sound issue. addEventHandler("onClientResourceStart", root, function () if open == false then setSoundVolume(source, 0) local resourceRoot_ = source setTimer(function () if isElement(resourceRoot_) then setSoundVolume(resourceRoot_, 0) end end, 1000, 1) end end, true, "low")
-
Hmm normally you would have to shoot in front of the target and not behind the target. Except when the target his fps is below the standards. The player movement speed is based on fps. So that is why they do not recommend to put the max fps too high for PvP modus. MTA is correcting this by reupdate the position, but that is not enough for the exact position. This issue is hard to solve, even in modern games like battlefield and cod. But there they have serverside bullet detection, that solves partly the issue. DO: exclude players with a too low fps OR reduce the max fps to something most machines can handle. Increased sync works well with good internet, but has the opposite effect for players with bad internet. With other words pick your target group for PvP or find a target group unlike yourself that doesn't mind lag.
-
More than 50% performance boost. ? Nicely done!
-
And what was it before? If you want to measure this correctly you need multiple samples. 0 AttachElements (idle). 10 AttachElements (doing something). 1000 AttachElements (doing a lot). 10000 AttachElements (doing too much).
-
After the installation you should be able to run this. callBack should be a function as 3e argument where the end-result goes to. function getEngineVehData (id, parte, callBack) callServer("preGetEngineVehData", getPlayerName(localPlayer), id, parte, callBack) return true end function preGetEngineVehData (nombre, id, parte) --... return "something" end
-
http://Lua-users.org/wiki/FormattingNumbers
-
@enzoDs You can't return later without coroutine which is your last resort, how about you solve your issue with a callback? async functionalities are very complex to build, as you do have to mind delays, process flow and cleaning of used code. This enchantment allows you to use callbacks: You can also use the code as inspiration for your own.
-
if passenger and passenger ~= thePlayer then Stack overflows are mostly happening when you created an infinity loop of function calls. A player leaves the vehicle triggering the event, which will remove a player, which will trigger the event, which will remove a player, which will trigger the event, which will remove a player, which will trigger the event, which will remove a player... ? Note: The player is still inside of the vehicle when the event is triggered.
-
Ha @Hugos I am currently a bit busy with stuff, I will reply when I have time. (~1.5 day) If you do not want to wait for help, there are two tutorials you can follow: The first one is about events: (which also includes triggerServerEvent's) And the second one is about some code that can help you making communication easier between serverside and clientside.
-
You subtract an absolute values from the player his resolution, before applying the multiplier. (sx_-1910) * xm That is not a logic calculation. At least follow the tutorial: local devScreenX = 1440 local devScreenY = 900 local screenX, screenY = guiGetScreenSize() local scaleValue = screenY / devScreenY This is more or less how I do it and keep things clean. (untested) local box = { startX = screenX * 0.25, startY = screenY * 0.25, width = screenX * 0.5, height = 500 * scaleValue } box.endX = box.startX + box.width box.endY = box.startY + box.height dxDrawRectangle ( box.startX, box.startY, box.width, box.height, tocolor(0,0,0) ) dxDrawText("SuperFun - Szórakozó szerver", box.startX + 10 * scaleValue, box.startY, box.endY - 100 * scaleValue, box.startY + 50 * scaleValue, tocolor(255,255,255,255), 1.00 --[[* scaleValue]], font2, "left", "center")
-
<min_mta_version server="1.5.2-9.07903" client="1.5.2-9.07903" /> Make sure that something like this is adding between the <meta> -here- </meta> tags. More info can be found here: https://wiki.multitheftauto.com/wiki/Meta.xml
-
I did send you a tutorial in my last reply, so I assume you did read it and applied it to you code? This one. Well show me what you did.
-
It is nothing magic. Just a value you use to multiply another value, so it gets bigger, smaller or unchanged. local bananas = 100 local multiplier = 0.5 -- = 50% bananas = bananas * multiplier print(bananas) -- 50 bananas
-
Absolute values like 290px and 240px do not scale, without a multiplier. There is a tutorial for scaling DX (+useful for other user interfaces).
-
Why not thinking about reduction and faking continuous effects? Instead of trying to solve the issue at the moment you already created too much data? If you are dealing with too much data, the latent trigger event can reduce impact on clients. It is send when the network is free. (+ you need to merge all data in to 1 triggerEvent) https://wiki.multitheftauto.com/wiki/TriggerLatentClientEvent Forcing 100ms is more or less killing your network. Better to check the status of the latent event, before sending the next payload of data. https://wiki.multitheftauto.com/wiki/GetLatentEventStatus If you want to have some advice for reduction and faking. I need to know a lot more about the context of the data and a lot of the details (conditions).
- 7 replies
-
- 1
-
- element data
- synchronization
-
(and 1 more)
Tagged with:
-
Nope it doesn't unfortunately. But that doesn't mean you can't fake it. And save some network data. local elementList = {vehicle, vehicle} triggerClientEvent(root, "triggerEventForElementList", resourceRoot, elementList, "theEvent", "argument1") addEvent("triggerEventForElementList", true) addEventHandler("triggerEventForElementList", resourceRoot, function (elementList, theEvent, ...) for i = 1, #elementList do triggerEvent(theEvent, elementList[i], ...) end end, false)