Jump to content

..:D&G:..

Members
  • Posts

    1,028
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by ..:D&G:..

  1. I did search like 4 times, and only found a script that only sets the animation...
  2. Ok, so, I did use the "piss" command and there was no error in debugscript. Secondly, I need the feature to create a lot of bars, because I want to make a separate system, like a bar-system that I will use for a system for hunger, thirst, piss, poop, etc.. I don't want to keep creating a new function for each bar. And what you are saying is that the bar won't change as it will only create another one, I got that.. But what if I create a new table for each thing? (hunger, thirst, piss, etc) EDIT: I used your code, but I removed something, maybe I shouldn't of remove it but it didn't make sense to me: I changed this: function showBar() pissBarStatus = not pissBarStatus end Into: function showBar() pissBarStatus = true end And it seem to work, I guess I have to create a bar for each thing I need
  3. Hey guys, a few years ago there was a puke and piss script on community, like the mod on GTA, where you can see the piss and the puke. Now, I can't seem to find them anymore, does anyone have 'em?
  4. Now it doesn't even show... Anyway, I went back to an older code: local listBRS = {} function showBar(barx, bary, barxoverlay, baryoverlay, barRelative, barName) return table.insert(listBRS, {barx, bary, barxoverlay, baryoverlay, barRelative, barName}) end addEvent("onClientShowBar",true) addEventHandler("onClientShowBar", root, showBar) function renderBar() if (#listBRS > 0) then for i=#listBRS,1, -1 do local values = listBRS[i] local barx, bary, barxoverlay, baryoverlay, barRelative, barName = values[1], -- barx values[2], -- bary values[3], -- barxoverlay values[4], -- baryoverlay values[5], -- barRelative values[6] -- barName dxDrawText ( barName, barx/0.499 + 1, bary/0.492, 76, 12, tocolor ( 255, 255, 255, 255 ), 1, "default", "center", "center", false, false, true ) dxDrawRectangle (barx, bary, 80, 14, tocolor (0,0,0,255), false) dxDrawRectangle (barxoverlay-0.5, baryoverlay-0.8, 77, 10, tocolor (235,141,45,127), false) dxDrawRectangle (barxoverlay-0.5, baryoverlay-0.8, 75.5*values[5], 10, tocolor (235,141,45,185), false) end end end addEventHandler("onClientRender",getRootElement(),renderBar) This works perfectly, but I can't get it to update... I tried to explain this to you and I will try again... my data is piss = 100, ok? Now, the bar is full, then I set my piss to 50, which is a half, but the bar still stays full instead of decreasing to a half... I swear if you don't understand this, I'll make a video xDDD The only thing I need is to make it check if the elementData changed, so the bar can also change
  5. The bar keeps flashing (disappearing and appearing) What I want is, if you have 70 pis on you, your bar should be like this: And when you have like 10, your bar thingy... fill.. should go down: The think is that before, the bar did not update, it remained at 70
  6. Ok so, I'll try to explain this as best as I can. I want to make a bar such as the health bar, which should stay on the screen when created. When I piss, I want the bar to go down, as with the health, when my health goes down, this bar should go down
  7. The bar only appears for like half a second, and then it disappears..
  8. Where have you defined "values"? I see you used this think: for i=#listBRS,1, -1 do I never used it before, and I don't even know what it is I been always using ipairs
  9. Here is the code: function showBar(barx, bary, barxoverlay, baryoverlay, barRelative, counter, barName) return table.insert(listBRS, {barx, bary, barxoverlay, baryoverlay, barRelative, counter, barName}) end addEvent("onClientShowBar",true) addEventHandler("onClientShowBar", root, showBar) function renderBar() if (#listBRS > 0) then for i, values in ipairs(listBRS) do local barx, bary, barxoverlay, baryoverlay, barRelative, counter, barName = unpack(values) if (counter > 25) then dxDrawText ( barName, barx/0.499 + 1, bary/0.492, 76, 12, tocolor ( 255, 255, 255, 255 ), 1, "default", "center", "center", false, false, true ) dxDrawRectangle (barx, bary, 80, 14, tocolor (0,0,0,255), false) dxDrawRectangle (barxoverlay-0.5, baryoverlay-0.8, 77, 10, tocolor (235,141,45,127), false) dxDrawRectangle (barxoverlay-0.5, baryoverlay-0.8, 75.5*barRelative, 10, tocolor (235,141,45,185), false) counter = counter +1 else counter = counter +1 end if (counter == 50) then counter = 0 end end end end addEventHandler("onClientRender",getRootElement(),renderBar) function renderPissShit() local sx,sy = guiGetScreenSize () local x = sx/800*683 local y = sy/600*89 local x1 = sx/800*685 local y1 = sy/600*91 local pissData = tonumber(getElementData(getLocalPlayer(), "piss"))/100 local pissBar = 100 local title = "PISS" showBar(x, y, x1, y1, pissData, pissBar, title) end addCommandHandler("piss", renderPissShit)
  10. Ok so, I got this bar that indicates how much piss you hold, it's like the health bar. When the bar is 100% full, and then when I set my piss to 50%, the bar does not update unless I restart the resource...
  11. Hello guys, I am trying to make a piss system, with a bar that should how much piss you hold ( haha) and I use set and getElementData for this. The problem is that I don't know how to make the render update, if I set my piss to 0, I want to bar to go down: if (counter > 25) then dxDrawText ( barName, barx/0.499 + 1, bary/0.492, 76, 12, tocolor ( 255, 255, 255, 255 ), 1, "default", "center", "center", false, false, true ) dxDrawRectangle (barx, bary, 80, 14, tocolor (0,0,0,255), false) dxDrawRectangle (barxoverlay-0.5, baryoverlay-0.8, 77, 10, tocolor (235,141,45,127), false) dxDrawRectangle (barxoverlay-0.5, baryoverlay-0.8, 75.5*barRelative, 10, tocolor (235,141,45,185), false) counter = counter +1 else counter = counter +1 end if (counter == 50) then counter = 0 end The piss amount is "barRelative"
  12. Same thing.. EDIT: Here is the blip if it helps, maybe is cuz of the way it is pointing..
  13. Oh, I just noticed something. When I turn left, the pointer turns right, I tried to fix it but can't figure it out. Maybe you know what's wrong?
  14. It doesn't even get drawn... function drawNFSMap() choosePositionWindow = guiCreateWindow ( choosePositionWindowPosX, choosePositionWindowPosY, choosePositionWindowWidth, choosePositionWindowHeight, "WORLD MAP", false ) choosePositionMap = guiCreateStaticImage(0, 0.04, 1, 0.90, "map.png", true, choosePositionWindow) mapX, mapY = guiGetPosition(choosePositionMap, false) mapX = mapX+choosePositionWindowPosX mapY = mapY+choosePositionWindowPosY mapWidth, mapHeight = guiGetSize(choosePositionMap, false) scaleX = 3000/(mapWidth/2) scaleY = 3000/(mapHeight/2) guiSetVisible(choosePositionWindow, true) end function showNFSMap() if isElement(choosePositionWindow) then destroyElement(choosePositionWindow) removeEventHandler("onClientRender", root, drawNFSBlips) else drawNFSMap() addEventHandler("onClientRender", root, drawNFSBlips) end end function drawNFSBlips() if not isNFSMapWindowShown() then return end local players = getElementsByType( "player" ) for i, p in pairs(players) do local x, y, z = getElementPosition(getPedOccupiedVehicle(p)) local rot1, rot2, rot3 = getElementRotation(getPedOccupiedVehicle(p)) local = (x/scaleX)+0.5*(mapWidth+2*mapX) local yd = (y/-scaleY)+0.5*(mapHeight+2*mapY) dxDrawImage ( -4, yd-4, 8, 8, "playerBlip.png", rot3, nil, nil, false, true ) end end
  15. I seen that..duh.. But how does it work? That is only 1 argument, and getElementRotation gives me 3...
  16. Hello guys, I am making the world's map on a window, and I want to make a blip that attaches to every player on the server. The problem is, I don't know how to make the blip rotate on the guy image/map as on the radar.. Here is the code: function drawNFSBlips() if not isNFSMapWindowShown() then return end local players = getElementsByType( "player" ) for i, p in pairs(players) do local x, y, z = getElementPosition(getPedOccupiedVehicle(p)) local = (x/scaleX)+0.5*(mapWidth+2*mapX) local yd = (y/-scaleY)+0.5*(mapHeight+2*mapY) dxDrawImage ( -4, yd-4, 8, 8, "playerBlip.png" ) end end
  17. Hello guys, I am making a login system and I want to generate a random salt from some numbers using math.random local salt = math.random(106060023000, 9919995299949969) The problem is that I get a negative number like -29404583 Any ideas? Thanks
  18. Lasati-va mai de MTA, a aparut GTA V Online sau MultiV
  19. Good day peeps, I just found a file which contains a cool looking map, which I was thinking of adding to my server. (f11 map) The problem is that this file has 143 .txd's (radar00.txd, radar01.txd etc) which contain a little part of the map. What code do I need to use to replace the map with those .txd's or with the .png from them?
  20. Hello guys, I been searching for a hud or radar that looks like one in NFS:World: I don't know how to make a radar or how to make it look like that, so I thought maybe someone already made one and has one. Thanks.
  21. Hello everyone, how can I make different color texts in a dxDrawText, like: #07F537Text1, #3E6345Text2 Thanks.
  22. It still outputs the same error. Garage is defined, but I deleted half the function, to only leave the things that relate to my problem..
×
×
  • Create New...