-
Posts
732 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Bean666
-
is that an unfinished string or it's normal? 131931,3131,13131"
-
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
-
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)
-
[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?
-
[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.
-
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)
-
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)
-
Will this work on all resolutions? try testing it yourself. anyways there's a typo at dxDrawRectangle, it's screenWidth not sreenWidth
-
i tested your script there are no problems , try turning off the resource "play"
-
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 )
-
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
-
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
-
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
-
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
-
oops nvm i noticed i had *1000 , solved
-
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 )
-
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.
-
getElementModel would fit better in setElementModel