-
Posts
696 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Dzsozi (h03)
-
Hello! My question is that how can I get a server side element data in client side? So, for example there's a marker in server side, I set an element data to it in server side. How can I get this element data in client side? I want to check if a house is locked or not, but I want to do it in client side because of the gui changes according to the lock. So if the house is locked the gui image is different. Can anyone help me please? Thanks in advance!
-
Use the object with ID 8661.
-
Help please
-
Thank you, I will try something!
-
Hi! I have a question. How can I check if a button, for example L Shift gets pressed repeatedly? Because I want to do a function if I hold down a key the character starts jogging, but if I keep pushing it the character starts to sprint. How could I do this? Does anyone could help me in this please? Thank you!
-
Hello! I have a script about a scoreboard. It has animation in it, but only when it appears. How can I make it animate when I release the button? So the same animation plays, but from the end position to the start position. showing = false local easing = "OutElastic" local tick = getTickCount() function rendering() local endTime = tickk + 500 local term = tick - tickk local perm = endTime - tickk local progress = term/perm local recintw, recinth, _ = interpolateBetween(x, y, 0, recw, rech, 0, progress, easing) local recintx, recinty, _ = interpolateBetween(0, 0, 0, recx, recy, 0, progress, easing) ... -- Here's the part of pushing and releasing tab, and what I tried to animate it when it disappears, but it's not working bindKey("tab", "both", function(key, state) if state == "down" and not showing then tickk = getTickCount() addEventHandler("onClientRender", root, performRender) showing = true g_oldControlStates = {} for k, control in ipairs ( controls ) do g_oldControlStates[k] = isControlEnabled ( control ) toggleControl ( control, false ) end showChat(false) elseif state == "up" and showing then local eastype = "OutElastic" tickk = getTickCount() local endTime = tickk + 500 local term = tick - tickk local perm = endTime - tickk local progress = term/perm interpolateBetween(recx, recy, 0, 0, 0, 0, progress, easing) showing = false removeEventHandler("onClientRender", root, performRender) showChat(true) for k, control in ipairs ( controls ) do toggleControl ( control, g_oldControlStates[k] ) end end end) So, how could I make it animated at disappearing / releasing TAB?
-
But I'm just asking for help with the tables, and why doesn't it work in the right way. Why the item only reacts with the marker in the last position.
-
Man, it's not leaked. It's not private. It's publicly available for download.
-
Hello everybody! I tried to make a code which is works with tables. The half of it works, the objects are in the right place. My problem is that it only reacts with the last coordinate. Server: fa = { {2519.341796875, -870.623046875, 89.903861999512}, {2525.1142578125, -859.0009765625, 89.275253295898}, {2508.7119140625, -856.7333984375, 91.828628540039}, {2517.02734375, -844.8046875, 90.762664794922}, {2526.58984375, -852.5849609375, 89.149307250977}, {2536.1171875, -861.0224609375, 87.53157043457}, {2536.021484375, -877.345703125, 86.958862304688}, {2512.4482421875, -842.5302734375, 91.216598510742}, {2491.5361328125, -834.8134765625, 96.069061279297}, {2484.13671875, -847.6982421875, 98.095672607422}, {2489.521484375, -855.0185546875, 96.606590270996}, {2511.796875, -862.701171875, 91.227981567383}, {2558.0673828125, -867.3876953125, 84.526206970215}, {2556.9765625, -885.7880859375, 84.542434692383}, {2502.5419921875, -829.2978515625, 92.203872680664}, {2517.974609375, -830.791015625, 89.668228149414}, {2530.0830078125, -831.0751953125, 88.806869506836}, {2545.7919921875, -867.85546875, 86.048957824707}, {2562.96484375, -845.9423828125, 83.80574798584}, {2552.6064453125, -835.3076171875, 85.780395507812}, {2542.2685546875, -817.583984375, 87.962028503418}, {2540.6240234375, -836.060546875, 87.394958496094}, {2550.8251953125, -856.67578125, 85.351554870605}, {2525.2470703125, -822.474609375, 89.558639526367}, {2502.2529296875, -844.2607421875, 93.483367919922}, {2578.599609375, -863.74609375, 81.747901916504}, {2568.83203125, -879.9853515625, 83.429077148438}, {2482.986328125, -877.1015625, 97.112419128418} } for i = 1, #fa do faobj = createObject(771, fa[i][1], fa[i][2], fa[i][3]-4, 0, 0, math.random(0,360)) --673, 660, 618 faCol = createMarker(fa[i][1], fa[i][2], fa[i][3]-1, "cylinder", 2, 255, 255, 255, 255) end So I have a part where it checks if a player is in the "faCol" marker: elseif (itemID==173) then if (isElementWithinMarker ( source, faCol )) then if (itemValue > 0) then if (hasSpaceForItem(source, 170, 1)) then takeItemFromSlot(source, itemSlot) giveItem(source, itemID, itemValue - 1) exports.global:applyAnimation(source, "BOMBER", "BOM_Plant_Loop", 2570, true, false, true) exports.global:sendLocalMeAction(source, "test") giveItem(source, 170, 1) triggerClientEvent("hideInventory", source) else outputChatBox( "test2", source, 255, 0, 0 ) end else outputChatBox( "test3", source, 255, 0, 0 ) end else outputChatBox("test4", source, 255, 50, 0) end triggerClientEvent("hideInventory", source) And if I'm not in the marker which is at the last position ( {2482.986328125, -877.1015625, 97.112419128418} ) then it reacts like when I'm not in a marker. But I'm in a marker, but not the last. So when I try to use item 173 then it outputs test4. What's the problem? Help me please! Everything is server side.
-
Hello guys! I've made a level script thingy, but when I try to check if it's working nothing happens. It's based on played hours on the server, I have 81 played hours, and it should output 'lol' to chatbox, but it's not working. What's the problem with my script? function getLevel(playerSource) local playedTime = (getElementData(playerSource, "hoursplayed") or 0) --local currentLevel = (setElementData(playerSource, "playerlevel") or 0) if playedTime then local currentLevel = 0 if playedTime < 5 then currentLevel = 1 elseif playedTime >= 5 and playedTime < 10 then currentLevel = 2 elseif playedTime >= 10 and playedTime < 15 then currentLevel = 3 -- and more ... elseif playedTime >= 80 and playedTime < 85 then currentLevel = 17 outputChatBox("lol") elseif playedTime >= 610 then currentLevel = 100 end return currentLevel else return false end end Debugscript doesn't show errors.
-
Hello guys, I have a little problem. In my vehicle shops system I made a function that creates a blip which is attached to the vehicle that you bought. The only problem is that it's not being destroyed when I delete the vehicle, or if it's get blowned up. What's the problem with my code? Here's a little part of it where I create and try to destroy the blip: if veh then x, y, z = getElementPosition( veh ) vehicleblip = createBlip( x, y, z, 55, 0, 0, 0, 255, thePlayer ) end addEventHandler("onElementDestroy", getRootElement(), function () if veh then destroyBlip(vehicleblip) end end) Thanks in advance!
-
Hello guys! Today I was thinking if there's any way to do a 'function' or I don't know how to call it, which is like this: the player is walking default, but if he holds down shift or space he starts to jog, but if he keeps pressing/hitting shift or space, the character starts to sprint. I want to do this for my project, but I don't know the way how. Can anybody help me please?
-
Then can anybody help me in this please? I'm not good at dxDrawImageSections and maths, positioning of blips and other hard stuff like that
-
Oh, I see, it's my bad, there was another line where's the image defined, but I forgot about this line lol Now It's solved! Thank you!
-
Hello guys! Today I was trying to make image buttons with guiStaticImageLoadImage and onClientMouseEnter, but the image doesn't changes. Can somebody help me please? ... skinHover = guiCreateButton(0.0, 0.339, 1.0, 0.0725, "", true, tabCreationOne) guiSetAlpha(skinHover, 0.75) addEventHandler ( "onClientMouseEnter", skinHover, skinH, false ) ... function skinH () guiStaticImageLoadImage(skinHover, "creation/skin.png" ) end
-
https://community.multitheftauto.com/index.php?p= ... ls&id=8883 "Then I found a resource on the community, but it was laggy, not transparent, hard to understand the code and the blips are Just drawn, and there was no blip visibility distance, or something, so the blips weren't drawn when they are away." This is the resource that I told about.
-
So? Do anyone know something about this? Please help me.
-
Hello everybody, I'm wondering if there's any way to check which image is loaded when I use guiStaticImageLoadImage function, and if image1 is loaded then label color is black, else if image2 is loaded then label color is white. Is there any way to do this? Here's my try, which is not working: img = guiCreateStaticImage(0.0, 0.3, 1, 0.375, "img/image1.png", true, window) label = guiCreateLabel(0.3, 0.1, 0.5, 0.2, "test", true, img) if (img == "img/image1.png") then guiLabelSetColor(label, 255, 255, 255) else guiLabelSetColor(label, 0, 0, 0) end
-
Yes, now when I write the command which is in server side now it writes this: countdown/countdownS.lua:5: Bad element pointer @ startCountDown
-
I've already wrote it there. But it's working on client side, tested it with a command, but in server side it's not working.
-
Still not working. And debugscript shows nothing about this.
-
Hello everybody, today I made a countdown script and I tried to add an export function, but it's not working for some reason. I think I've done everything well, but here's my code: meta: client: local sx, sy = guiGetScreenSize () function startCountDown ( source ) guiSetVisible ( imagecount, false ) imagecount = guiCreateStaticImage ( (670 / 1600) * sx, (140 / 1300) * sy, (250 / 1600) * sx, (220 / 1300) * sy,"images/3.png",false) setTimer ( Countdown2, 1300, 1 ) local sound = playSound("tick.mp3", false) end function Countdown2 ( source ) guiSetVisible ( imagecount, false ) imagecount = guiCreateStaticImage( (670 / 1600) * sx, (140 / 1300) * sy, (250 / 1600) * sx, (220 / 1300) * sy,"images/2.png",false) setTimer ( Countdown1, 1300, 1 ) local sound = playSound("tick.mp3", false) end function Countdown1 ( source ) guiSetVisible ( imagecount, false ) imagecount = guiCreateStaticImage( (670 / 1600) * sx, (140 / 1300) * sy, (250 / 1600) * sx, (220 / 1300) * sy,"images/1.png",false) setTimer ( Countdown0, 1300, 1 ) local sound = playSound("tick.mp3", false) end function Countdown0 ( source ) guiSetVisible ( imagecount, false ) imagecount = guiCreateStaticImage( (670 / 1600) * sx, (140 / 1300) * sy, (250 / 1600) * sx, (220 / 1300) * sy,"images/go.png",false) setTimer ( CountdownEnd, 3000, 1 ) local sound = playSound("go.mp3", false) end function CountdownEnd ( source ) guiSetVisible ( imagecount, false ) end addCommandHandler ( "cd", startCountDown ) addEvent("startCountDown", true) addEventHandler("startCountDown", startCountDown) server: function startCountDown(player) if isElement(player) then triggerClientEvent(player, "startCountDown", getRootElement()) end end the way I tried to call it in server side script: exports.countdown:startCountDown(source) What's the problem with my codes?
-
No, unfortunately it doesn't contains blips, the author said that he's going to make it, but it's still not done yet. And it's compiled. I have already saw it. ( Sorry for bad English )
-
Hello everybody! I'm wondering if is there anyway to do a rectangle radar which is looks and works like in GTA V. So it has blips support, rotation and a little bit transparent and if the blips are away they will be drawn inside the radar and rotate with the radar. In the past I tried to do this, but I couldn't do that. It was a messed up code and it was not working. Then I found a resource on the community, but it was laggy, not transparent, hard to understand the code and the blips are Just drawn, and there was no blip visibility distance, or something, so the blips weren't drawn when they are away. Then I found some topics about this blips thing, and I found one but the guy just removed the codes so it not helped me. I tried to do this, but I'm not good at these thing like dxDrawImageSection and some other dx things. Could someone help me doing one via Skype or Facebook? I'm not asking for doing me one, I'm asking for help in doing it. Or is there anyone who have a radar like this, or in Community? It would be awesome if someone could help me. Thank you guys!
-
Thank you guys! They're working! But now I have another problem. It's the same, it's not fitting all the resolutions, but now this time it's a text. My firend's screen: My screen: How can I fix this? Please help me. A bit of the code: local pHeight = 24 local middleHeight = pHeight*data.length+20 if middleHeight > data.maxHeight-128-32 then middleHeight = data.maxHeight-128-32 end local totalHeight = data.maxHeight --128+middleHeight+32 local contentY = sy/5.001-middleHeight/5.001