Jump to content

Bean666

Members
  • Posts

    732
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Bean666

  1. Bean666

    Tables

    is that an unfinished string or it's normal? 131931,3131,13131"
  2. i already know that ^-^ and i could use more IDS right? is this right or wrong if i add more IDs? local objects = getElementsByType("object") for i, v in ipairs(objects) do local ID = getElementModel (v) if ID ~= 3113 or if ID ~= 980 then local x,y,z = getElementPosition(v) local xr,yr,zr = getElementRotation(v) setLowLODElement(v,createObject ( getElementModel(v), x,y,z,xr,yr,zr,true )) end end
  3. Bean666

    problem

    not working , text dont appear
  4. Bean666

    problem

    THIS IS Anubhav's CODE it didn't seem to work but ill try again! ill tell u the result tomorrow or later! EDIT : Not working , not showing text above player head addEventHandler("onClientRender", getRootElement(), function () for k,v in ipairs(getElementsByType("player")) do if getPlayerTeam(v) == getTeamFromName("Army") then if not v == localPlayer then dxDrawTextOnElement(v,"Army",1,20,0,255,0,255,1,"bankgothic") end end end end)
  5. Bean666

    problem

    [quote name=..&G:..]It's not the same, you used this: if not v == localPlayer then return end and I used: if v == localPlayer then return end Also, use this: addEventHandler("onClientRender", getRootElement(), function () for k,v in ipairs(getElementsByType("player")) do if getPlayerTeam(v) == getTeamFromName("Military") then if not v == localPlayer then dxDrawTextOnElement(v,"Army",1,20,0,255,0,255,1,"bankgothic") end end end) Because when the script gets to you when it loops through the table, it will stop, and will not carry on to the other players, and you don't really need a "return" for this function.*sigh* anyways it's almost the same as anubhav's code just with 1 less end what's the difference?
  6. Bean666

    problem

    [quote name=..&G:..] addEventHandler("onClientRender", getRootElement(), function () for k,v in ipairs(getElementsByType("player")) do if getPlayerTeam(v) == getTeamFromName("Military") then if v == localPlayer then return end dxDrawTextOnElement(v,"Army",1,20,0,255,0,255,1,"bankgothic") end end end) it's the same as my code given at the very top, if i use this code, it works! i won't be able to see my own text and see other people's text, but when there are 2 or more players in the "Team", the text is not showing up anymore.
  7. Bean666

    problem

    doesnt work doesnt show the Text EDIT: I tried this and it works , he can see mine too, we are both in same team but , it's showing the text for me too. i want players to see other's people's text only , not theirs too. addEventHandler("onClientRender", getRootElement(), function () for k,v in ipairs(getElementsByType("player")) do if getPlayerTeam(v) == getTeamFromName("Military") then if not v == localPlayer then return end dxDrawTextOnElement(v,"Army",1,20,0,255,0,255,1,"bankgothic") end end end)
  8. Bean666

    problem

    it only works when there is 1 player in the team ,when i add 1 more player in the team ,the text above the players in the team disappears. addEventHandler("onClientRender", getRootElement(), function () for k,v in ipairs(getElementsByType("player")) do if getPlayerTeam(v) == getTeamFromName("Army") then if v == localPlayer then return end dxDrawTextOnElement(v,"Army",1,20,0,255,0,255,1,"bankgothic") end end end)
  9. Bean666

    3D Text

    no one would make such a script like this for you for free, well if there are ultra good people out there they might for you . as i know use https://wiki.multitheftauto.com/wiki/Dx ... tOnElement
  10. Bean666

    .

    Will this work on all resolutions? try testing it yourself. anyways there's a typo at dxDrawRectangle, it's screenWidth not sreenWidth
  11. i tested your script there are no problems , try turning off the resource "play"
  12. Bean666

    bug

    Why is it like this? it seems working fine but, see shown in the video, i want it to work like a loot system the problem is when one marker is destroyed, u still need to wait for the marker to respawn to go to another marker so it won't be bugged, how can it be fixed?, what do i need to do? here is the bug shown in the video: sometimes im getting errors: attempt to index boolean value in line 27 as shown in the code. EDIT: I also tested it with a player, if i destroy the marker, player still sees it. code: local spots = { { 2490.173828125, -1670.1630859375, 12.3 }, { 2492.6298828125, -1675.1650390625, 12.3 }, { 2496.60840, -1675.31177, 12.3 } } local marker = { } function MarkerHit ( hitPlayer, matchingDimension ) if (hitPlayer == localPlayer) then if isPedInVehicle(hitPlayer) then return; end if source == marker[1] then setElementData( localPlayer, 'm', { n = 1, source_ = source, pos = {getElementPosition (source) } } ) triggerEvent("m4show", localPlayer) elseif source == marker[2] then setElementData( localPlayer, 'm', { n = 2, source_ = source, pos = {getElementPosition (source) } } ) triggerEvent("akshow", localPlayer) elseif source == marker[3] then setElementData( localPlayer, 'm', { n = 3, source_ = source, pos = {getElementPosition (source) } } ) triggerEvent("snshow", localPlayer) end end end addEventHandler("onClientElementDestroy", resourceRoot,function () if getElementType(source) == "marker" and getElementData( localPlayer, 'm' ).source_ == source then local x,y,z = unpack (getElementData( localPlayer, 'm' ).pos) setTimer ( function() marker[getElementData(localPlayer,'m').n] = createMarker( x, y, z, "cylinder", 1, 255, 255, 255, 100 ) addEventHandler ( "onClientMarkerHit", marker[getElementData(localPlayer,'m').n], MarkerHit ) end,10000,1) end end ) for k,v in ipairs( spots ) do marker[k] = createMarker ( v[1],v[2],v[3], "Cylinder", 1, 255, 255, 255, 100 ) addEventHandler ( "onClientMarkerHit", marker[k], MarkerHit ) end addEventHandler("onClientGUIClick",resourceRoot,function() if ( source == button) then guiSetVisible(window,false) showCursor(false) destroyElement(getElementData(localPlayer, 'm').source_) triggerServerEvent("m4", getLocalPlayer(), m4) elseif ( source == button2) then guiSetVisible(window,false) showCursor(false) destroyElement(getElementData(localPlayer, 'm').source_) triggerServerEvent("ak", getLocalPlayer(), ak) elseif ( source == button3) then guiSetVisible(window,false) showCursor(false) destroyElement(getElementData(localPlayer, 'm').source_) triggerServerEvent("sn", getLocalPlayer(), sn) elseif ( source == cancel) then guiSetVisible(window,false) showCursor(false) end end )
  13. great i never thought of that idea of ~= , ~= means different right? and == means equal , anywy going to test it , hope it works! EDIT: It wasn't working in the beginning but i optimized the script and did this: i switched the local ID = getElementModel (v) on the top and it managed to fix it. local objects = getElementsByType("object") for i, v in ipairs(objects) do local ID = getElementModel (v) if ID ~= 3113 then local x,y,z = getElementPosition(v) local xr,yr,zr = getElementRotation(v) setLowLODElement(v,createObject ( getElementModel(v), x,y,z,xr,yr,zr,true )) end end
  14. Bean666

    Tables

    here is an example of a marker table when you add more arrays , don't forgot to add at the end of the arrays with , but don't add , in the last array! local markers = { { x, y, z }, { x, y, z } } for i,v in ipairs( markers ) do createMarker ( v[1],v[2],v[3], type/kind, size, r, g, b, a ) end
  15. like this? EDIT: lol nope local objects = getElementsByType("object") for i, v in ipairs(objects) do local x,y,z = getElementPosition(v) local xr,yr,zr = getElementRotation(v) local ID = getElementModel (v) if not (ID) == 3113 then setLowLODElement(v,createObject ( getElementModel(v), x,y,z,xr,yr,zr,true ) ) end end
  16. Bean666

    convert?

    is there anyway to convert DFF , TXD of a vehicle model to an object one with a COL? is it possible if yes please state how to. if there is someone out there who is good enough could you convert 1 for me?
  17. is there anyway scripted gates will be exempted from this script? because this script makes objects visible even far from distance, but it's messing up the scripted gates. or Exempt a certain Object ID? here is why: code: local objects = getElementsByType("object") for i, v in ipairs(objects) do local x,y,z = getElementPosition(v) local xr,yr,zr = getElementRotation(v) setLowLODElement(v,createObject ( getElementModel(v), x,y,z,xr,yr,zr,true ) ) end
  18. Bean666

    delete me

    why pay for firstperson script when you can find it anywhere in the community website lmao... it would be useless to pay 10$ just for that.
  19. oops nvm i noticed i had *1000 , solved
  20. why is the weather not changing every 5 seconds? local weathers = {7,8,9,16,11,19,15} local interval = 5000 setTimer( function() local randomWeather = weathers[math.random(#weathers)] setWeather(randomWeather) end ,interval*1000,0 )
  21. Bean666

    dxGUI

    you'll need to script it by yourself by making Invisible buttons, change of colors etcs... Example: you can make tab using DX Rectanges, and making alpha's of buttons "0" and when you click the button, make a change that the DX Rectangle you clicked will change color.
  22. Bean666

    SOLVED

    EDIT: nvm fixed.
  23. getElementModel would fit better in setElementModel
  24. Bean666

    SOLVED

    i did this all over before, but it only works in the first marker of the table. all i want is the MarkerHit function will only work in the "spots" table markers.
×
×
  • Create New...