-
Posts
636 -
Joined
-
Days Won
8
Everything posted by ds1-e
-
It's clean. So what i should do in that case? Additional condition doesn't help.
-
Hey. I need a little help with int loop. So basically, i need to insert colshape (which shouldn't exist in table), with table.insert, however it doesn't work as it should, most likely it's due of my mistake, but i can't figure it out. local saved_cols = #playerTable.player.savedcols if saved_cols == 0 then -- in case if table is empty, otherwise loop wouldn't run table.insert(playerTable.player.savedcols, colshape) outputChatBox(saved_cols) -- output: 0 end -- loop with problem for i = 1, #playerTable.player.savedcols do local saved_col = playerTable.player.savedcols[i] if saved_col == colshape then outputChatBox("saved_col == colshape, break") break -- uhm, should break and not add colshape to table? end table.insert(playerTable.player.savedcols, colshape) -- in case of any questions, i tried to add condition here but that doesn't help end So what's wrong: 1. Spawning car with attached colshape, script trigger onClientElementColShapeHit event with my function. 2. First colshape adds successfully. 3. Spawning car once again, and table.insert add 2x same colshape instead of 1. 4. Condition works good only for first colshape added in table.
-
https://wiki.multitheftauto.com/wiki/Resource:Voice
-
Hey, how can i zoom camera, without moving it? local x, y, z, lx, ly, lz = getCameraMatrix() smoothCameraMove(x, y, z, lx, ly, lz, x, y, z, lx, ly, lz - 0.5, 2100) Maybe a simple answer, but couldn't make it.
-
Hey, once again. I was trying to sort items in table, then show them in GUI, but couldn't make it work. I would like to sort it alphabetically or by value given for certain item. Is there any way to get it to work, for key indexes, without doing any serious changes? Because it took me some time to finish functions for this table structure. ["First Aid Kit"] = {slots = 2, category = "Medicine"},
-
Probably you forgot about: In triggerServerEvent. triggerServerEvent("onRestartWheels", resourceRoot) Also add your resource to admin group in ACL: <object name="resource.resource_name"></object>
-
https://wiki.multitheftauto.com/wiki/TriggerServerEvent
-
I'm not good at explaining but let me try. -- client local variable = "Test" triggerServerEvent("sendDataToServer", getLocalPlayer(), variable) -- server function sendDataToServer_handler(first_arg) local player = source local account = getPlayerAccount(player) if account then setAccountData(account, first_arg, true) outputChatBox(tostring(getAccountData(account, first_arg))) end end addEvent("sendDataToServer", true) addEventHandler("sendDataToServer", getRootElement(), sendDataToServer_handler) Adjust it to your needs.
-
You need to use triggerServerEvent. Check my example for it here:
-
Did you tried to add outputDebugString to check if code actually runs? If it doesn't show, a problem might be ipairs loop, which iterates only indexed table (in your case blips). Try to use pairs instead.
-
Check this code, probably that's what are you looking for. https://github.com/rivor/pubg-mta/blob/master/pubg/lobby.lua
-
Check this. https://wiki.multitheftauto.com/wiki/OnClientVehicleCollision + https://wiki.multitheftauto.com/wiki/SetVehiclePanelState
-
Maybe? https://wiki.multitheftauto.com/wiki/SetAccountData
-
Not only for DayZ, it's custom gamemode.
-
In removeRenderEvent function?
- 21 replies
-
- 1
-
- onclienthudrender
- onclientprerender
-
(and 1 more)
Tagged with:
-
I don't have dayz server, and i didn't had.
-
Then i don't know how can i help, i gave you all ways i used to fix it.
-
About that limit in client side, it means that client can only send one trigger per request? And there's no limit on server-side?
-
Use int loop. for i = 1, #tbl do local x, y, z = tbl[i][1], tbl[i][2], tbl[i][3] local marker = createMarker(x, y, z, "checkpoint", 3, 0, 255, 0, 180) -- and add missing code end
-
Hello. I have decided to write some kind of GPS/radar script by myself. As always, there is some problems which i don't know can i solve. I have also other script which i'm using, but i prefer to rewrite it, because when local player is moving, the radar isn't moving smooth. - How can i get correct offsets for radar, depends from player position, and background map with resolution 3000x3000. - Why this code isn't that much effective as this one? And somehow when minimalizing a game, it uses less or more CPU. -- takes up to 8, 10% of CPU local gpsRender = dxCreateRenderTarget(290, 175) local mapWidth, mapHeight = 3000, 3000 if gpsRender and playerTable.settings.user[2] then -- used within onClientRender <- render events by IIYAMA, i've tested, and default events gives nearly same results. dxSetRenderTarget(gpsRender, true) local x, y, z = getElementPosition(getLocalPlayer()) local rotX, rotY, rotZ = getElementRotation(getCamera()) dxDrawImage(-10, -10, mapWidth, mapHeight, "map.png", rotZ, x/mapWidth, -y/mapHeight, tocolor(255, 255, 255, 255)) dxSetRenderTarget() dxDrawImage(20, 100, 365, 235, gpsRender, 0, 0, 0, tocolor(255, 255, 255, 255)) end -- before that code it's just a dxDrawText and nothing more. -- takes up to 1-4% of CPU, and 20% when starting. local worldW, worldH = 3072, 3072 local rt = dxCreateRenderTarget(290, 175) local mW, mH = dxGetMaterialSize(rt) -- used within onClientRender. dxSetRenderTarget(rt, true) local x, y = getElementPosition(localPlayer) local X, Y = mW/2 -(x/(6000/worldW)), mH/2 +(y/(6000/worldH)) local camX,camY,camZ = getElementRotation(getCamera()) dxDrawImage(X - worldW/2, mH/5 + (Y - worldH/2), worldW, worldH, "img/radar_map.jpg", camZ, (x/(6000/worldW)), -(y/(6000/worldH)), tocolor(255, 255, 255, 255)) dxSetRenderTarget() -- later is some other code, and also ipairs loop.
-
bump. I was looking into it, and there is a lot of function, so i'm not even sure where i should start looking for.
-
Probably ain't gonna use it., the problem will be in case of clearing files from cache. By the way thank you for all of your support and advices, you're helping me very much