-
Posts
80 -
Joined
-
Last visited
Everything posted by greentumbleweed
-
I dont think thats the problem here, because im calling it with the function. So.... every time i press E the numbers will be different, i just need to grab the numbers from the table instead of calling the function. I'm just not sure how. This is for a lockpicking system kind of like dying light.
-
function checkBar(source) local check1 = guiScrollBarGetScrollPosition ( bar ) local table = generateRandomGroupNumbers(); for _,v in ipairs(table) do if (v == check1) then guiSetVisible(Window,false) showCursor(false) removeEventHandler("onClientRender", getRootElement(), openLockedCrate) --triggerServerEvent () end end end bindKey ( "E", "down", checkBar ) ^ this works but the only problem remaining is if i spam E it will keep changing the numbers i need the numbers to stay the same
-
function checkBar(source) local check1 = guiScrollBarGetScrollPosition ( bar ) for _,v in ipairs(randomNumbers) do if (v == check1) then guiSetVisible(Window,false) showCursor(false) removeEventHandler("onClientRender", getRootElement(), openLockedCrate) --triggerServerEvent () end end local randomNumbers = {} local startingNumber = math.random(90) for i=startingNumber,startingNumber+10 do table.insert(randomNumbers,i) end return randomNumbers; end bindKey ( "E", "down", checkBar ) i hope i did this right im not getting any errors in debug but its not exactly working not sure if its because v = multiple answers and check1 is one sigle answer
-
so that city in the pic with hydra is not one dff, txd,and col?
-
im assuming you did what i did here vice city server i talked to you about modeling and seen that bug on the scarface house
-
-
in my opinion samp should just die its obvious anything you can do in samp you can do with mta and better
-
lol i guess you fixed those problems? thats insane its me, jack who joined your server when you first opened it a little curious as to how you did this engineSetModelLODDistance(id, distance) ? or i guess what im referring to is the object limit not the mlod
-
function checkBar(source) local check1 = guiScrollBarGetScrollPosition ( bar ) if randomNumbers == check1 then guiSetVisible(Window,false) showCursor(false) removeEventHandler("onClientRender", getRootElement(), openLockedCrate) --triggerServerEvent () end end bindKey ( "E", "down", checkBar ) how can i call the numbers from the table at if randomNumbers == check1 then im a noob with table functions
-
thx btw i posted on your custom map post
-
I have a custom map made by russians. Dont know if you ever heard of "ozlood" <-- thats the name of the resource, but due to the fact you cant replace mlod -- the model that is viewed at a distance... theres always going to be view distance issues. However i have had no performance issues out of it. i can send you the map with objects if you want. file size is over 500 mb its kind of a large map with some okay custom models. Also the map is kind of a zombie type map im not sure what kind of gm your going for.
-
i finally figured out the problem function generateRandomGroupNumbers() local randomNumbers = {} -- create temporary table to store numbers local startingNumber = math.random(90) -- get random starting position for i=startingNumber,10 do -- add 10 numbers from starting position table.insert(randomNumbers,i) -- insert them to table end return randomNumbers; -- returns table with numbers when numbers have been generated end ^i understand that for... is a loop and the 10 should mean loop 10x but it will not print so the startingNumber is almost always higher than 10 meaning its giving (90 or less ,10) for i when i change the values to local startingNumber = math.random(10) -- get random starting position for i=startingNumber,100 do -- add 10 numbers from starting position it prints (10 or less)-100 i dont get why it wont print with a lower value of loops makes no sense to me and i fully understand what you wrote it should do exactly what you intended it just doesnt print
-
not sure why but its not printing the numbers
-
That still does not give me 10 numbers in a row function checkBar() local check1 = guiScrollBarGetScrollPosition ( bar ) a = {0,1,2,3,4,5,6,7,8,9} --b = {1,2,3,4,5,6,7,8,9,10} here is what i mean by ect i need 10 numbers in a row local check2 = a[ math.random (#a)] if check2 == check1 then guiSetVisible(Window,false) showCursor(false) removeEventHandler("onClientRender", getRootElement(), openLockedCrate) --triggerServerEvent () end end bindKey ( "E", "down", checkBar ) here check2 works for table "a" all numbers will return true --or not i thought it was working guess i was dreaming im basicly trying to section off 100 in random groups of 10 to make a guessing game out of it. rather than having 10 random numbers, i need random groups of 10 numbers
-
Im trying to figure out how to find a random group of 10 numbers in a row out of 100. could be 1-10 or 2-11 ect. function checkBar() local check1 = guiScrollBarGetScrollPosition ( bar ) local check2 = math.random (10,100) if check2 == check1 then guiSetVisible(Window,false) showCursor(false) removeEventHandler("onClientRender", getRootElement(), openLockedCrate) --triggerServerEvent (TODO) end end bindKey ( "E", "down", checkBar )
-
"else you'd teleport on top of things" - this only happens when i aim my weapon and im teleporting forward into a light pole, so yes it happens but, other than that i do not teleport ontop of things. not much of a point in speeding up the player while aiming anyways "I suppose that Position is always where you're looking at" - not exactly, W works perfectly fine in any direction however moving left right and backwards still moves me forwards. im assuming it has something to do with getPedRotation "wouldn't get camera matrix' 4th, 5th and 6th returned float help?" - i only need the direction of the player not the camera
-
well ive ran into a few more problems trying to make it work better. Im not sure how you made it teleport in front of the player, im trying to get it to work for all keys WSAD, also when i jump and im moving forward sometimes it still teleports me back on the ground function startSprint() local wep = getPedWeaponSlot (localPlayer) if not (wep == 0) then return end if sprint then sprint = false setElementData(localPlayer, "charging","on") else sprint = true setElementData(localPlayer, "charging","off") end end bindKey ( "mouse2", "down", startSprint ) vel = 0.05 function sPeedUp() if isElement(localPlayer) then if getElementData(localPlayer, "charging") == "on" then local x, y, z = getElementPosition(localPlayer) local prot = getPedRotation(localPlayer) local nx, ny = getPointFromDistanceRotation(x, y, vel, (prot)*-1) local clear = isLineOfSightClear( x, y, z, nx, ny, z, true, true, true, true, true, true, true) if clear == true then local lx, ly = getPointFromDistanceRotation(x, y, 1, (prot-8)*-1) local rx, ry = getPointFromDistanceRotation(x, y, 1, (prot+8)*-1) local clearl = isLineOfSightClear( x, y, z, lx, ly, z, true, true, true, true, true, true, true) local clearr = isLineOfSightClear( x, y, z, rx, ry, z, true, true, true, true, true, true, true) if clearl == true and clearr == true then local W = getControlState ( "forwards" ) local S = getControlState ( "backwards" ) local A = getControlState ( "left" ) local D = getControlState ( "right" ) local jump = getControlState ( "jump" ) if jump then return end local nz = getGroundPosition ( nx, ny, z+1 ) if getDistanceBetweenPoints3D( x, y, z, nx, ny, nz) < 2 then if W or S or A or D then setElementPosition(localPlayer, nx, ny, nz+1, false) end end end end end end end addEventHandler("onClientRender", root, sPeedUp)
-
thanks a whole lot of lots! this has been giving me headaches, never would have thought setElementPosition was the answer
-
yes, you did that with setElementPosition?
-
well, i dont think teleporting the player wll do what im trying to do. i just want to increase the acceleration of the player. you have any idea if setElementSpeed would work? ive tried but... failed!
-
local sprint = true function updateSprint () local state = getControlState ( "forwards" ) local playeR = getLocalPlayer() local speedx, speedy, speedz = getElementVelocity (playeR) if state and sprint == false then setElementVelocity(playeR, speedx * 2, speedy * 2, speedz) elseif sprint == true then return end end addEventHandler ( "onClientElementStreamIn", getRootElement(), updateSprint ) function startSprint() if sprint then sprint = false else sprint = true end end bindKey ( "mouse2", "down", startSprint ) im not even sure im going the right way about this but its not seeming to work
-
when i import and export an SA model then replace the model the lighting is gone and its just a brighter texture day/night! any suggestions?
-
if you dont mind im having a few problems understanding how to use these functions, never used em before maybe you can give me some lines? would be highly appreciated<3
-
thx for replying and the help!
-
Can someone give me an example on how too make dff, txd, and col files from being accessible from client? I've seen other servers do such a thing. Also seen 50p's post about how to make them server side only, but im not sure how to do it
