-
Posts
6,058 -
Joined
-
Last visited
-
Days Won
208
Everything posted by IIYAMA
-
The shader version gives of dxDrawCircle doesn't have a very high impact on the performance: nightly.multitheftauto.com/files/shaders/shader_circle.zip The only thing that it is missing is anti aliasing. (pixel edges) As last resort you can use browser + html + css to make it. (which should give the best quality, but isn't very performance optimal in my opinion. Yet, there shouldn't be much frame lagg of it.)
-
I am not sure what you want to achieve with it. But if you want to check if an element is in a table, then this is also very fast method. The elements have become the KEY of the table. local table = {[el1] = true, [el2] = true, [el3] = true} if table[place] then -- Yes it is in the table end Adding elements to the table by hand: table[el1] = true table[el2] = true table[el3] = true With this method, you can also make a reference to different data: local table = {[el1] = {"more data"}, [el2] = {"more data"}, [el3] = {"more data"}} local moreData = table[place]
-
You probably need to save the pixels of the texture in stead of the texture. As textures are client-side only elements, which should not be able to sync.(Just in case if you get stuck there) https://wiki.multitheftauto.com/wiki/DxGetTexturePixels Even though a better way would be saving the file names, as every client does already have the textures.
-
The value 1.5 represents the offset. Math.sin and math.rad used on the rotation, represents a sort of vector direction of an axis. Which you can multiply by the offset to extend the range. (The original offset is 1 unit.) You should start calculating from the ladder and not from the ped. Else indeed it might causes glitches like that.
-
function movePlayer(button, press) if press then if button == "w" then local x, y, z = getElementPosition ( localPlayer ) setElementPosition ( localPlayer, x, y, z+1, false ) elseif button == "s" then local x, y, z = getElementPosition ( localPlayer ) setElementPosition ( localPlayer, x, y, z-1, false ) end else --release end end function addTheHandlers() setElementFrozen( localPlayer, true ) addEventHandler("onClientKey", root, movePlayer) --Want this to be constantly checked... end You do not need getKeyState if you use onClientKey, only if you use onClientRender.
-
You can also use: https://wiki.multitheftauto.com/wiki/BindKey keyState: The state of the key that was pressed, down if it was pressed, up if it was released. If this isn't working for you: https://wiki.multitheftauto.com/wiki/GetKeyState
-
You can also bind controls. https://wiki.multitheftauto.com/wiki/Control_names
-
I am not sure what what your friend his ping AND fps are. But just for you to know. There is no serverside bullet detection. The client itself is the only one to decide if there is damage or not. Lower than 50/60 fps is lagg. (causing bullet sync problems) Ping higher than 60 is lagg. (causing bullet sync problems as well) Gta is physics are lagg. (causing bullet sync problems as well) Better sync? How about uber sync? Uber sync (bandwidth and CPU intensive) player_sync_interval 50 keysync_mouse_sync_interval 50 keysync_analog_sync_interval 50 https://wiki.multitheftauto.com/wiki/Sync_interval_settings Instructions Stop the server open: mtaserver.conf Edit settings in file to those values. Save mtaserver.conf Start the server. <player_sync_interval>50</player_sync_interval> <keysync_mouse_sync_interval>50</keysync_mouse_sync_interval> <keysync_analog_sync_interval>50</keysync_analog_sync_interval>
-
I never said it would fix your lagshot. Anyway. I have no idea how your lagg shot looks like. Because there are different types of laggshots. If it is a lot of teleportation and the server is showing no performance impact, then it is the network. Not sure what kind of server you bought, but it seems there is something wrong with it. The reason behind it, might be that other people who rent a server there and are abusing it's capabilities. Or the owners are sharing the main computer(server) with too many vps users. It is also possible that you are just running bad resources on it.
-
You can also try instead of setting the position, freeze the position temporary(by 1 or 2 frames).
-
Current wep bullet sync will be active when you hold a weapon. (only weapons that create bullets) + the bullet sync setting: >bullet_sync< must be active. (which is by default active) https://wiki.multitheftauto.com/wiki/SetServerConfigSetting Which gamemode are you running? (If tactics, lagg shots are included)
-
local oldDirection addEventHandler("onClientPreRender", root, function () local direction = getControlState ("left") and "left" or getControlState ("right") and "right" if direction then if oldDirection and direction ~= oldDirection then local x,y,z = getElementPosition(localPlayer) setElementPosition(localPlayer, x, y, z) end oldDirection = direction else oldDirection = nil end end) Quick and untested prototype. As well as my last one, iterate it yourself.
-
What about setting the player his position when switching over to another direction?
-
Samp sliding looks like a . It is probably something build in to improve the syncs. Maybe it is included in a glitch: (not sure) https://wiki.multitheftauto.com/wiki/SetGlitchEnabled
-
Most simple method: if getTickCount() % 50 > 25 then end
-
If you are talking about a dx chat, then yes.
-
Your condition: https://wiki.multitheftauto.com/wiki/GetKeyState
-
You can take over the controls of the driver. But the driver remains to be the syncer of the vehicle. Which means that the delay of the action depends on the driver and co-driver their internet speed. https://wiki.multitheftauto.com/wiki/SetControlState https://wiki.multitheftauto.com/wiki/BindKey (serverside)
-
map = { size = 1024 } function reCalculateToMap (posX, posY) return posX / map["size"] * 6000 - 3000, posY / map["size"] * -6000 + 3000 end local x, y = reCalculateToMap (500, 800) print(x, y) function reCalculateFromMap (mapX, mapY) return (mapX + 3000) * map["size"] / 6000, (mapY - 3000) * map["size"] / -6000 end local x2, y2 = reCalculateFromMap (x, y) print(x2, y2) This is just old school math. Example: Click X position in image is: 240px Image size is: 1024px Map size is: 6000 X 240 / 1024 = 0.234375 --[[ 0.234375 * 100 = 23.4 240 is 23.4% from 1024 ]] 0.234375 * 6000 = 1406.25 --[[ Append to other value ETC. ]]
-
local mapX = clickX / map["size"] * 6000 - 3000 local mapY = clickY / map["size"] * -6000 + 3000 Try this. Afaik the left + bottom is -3000, -3000. The right + top is 3000, 3000. And the center is 0, 0.
-
if aX > (x / 2 - map["size"] / 2) and aX < (x / 2 + map["size"] / 2) and aY > (y / 2 - map["size"] / 2) and aY < (y / 2 + map["size"] / 2) then end local clickX = aX - (x / 2 - map["size"] / 2) local clickY = aY - (y / 2 - map["size"] / 2) local mapX = clickX / map["size"] * 6000 local mapY = clickY / map["size"] * 6000 Everything is untested.