Overkillz

Members
  • Content count

    339
  • Joined

  • Last visited

Community Reputation

4 Neutral

About Overkillz

  • Rank
    Fool
  1. I have a question. dxDrawMaterialLine3D

    In fact, u can rotate it. Just play with the axes.
  2. if getplayerteam

    local team = getPlayerTeam(player) if team then if getTeamName(team) ~= "Polisss" then --Your code to make it visible end end
  3. Issue creating multiple shaders with the same file

    I didn't use tocolor to set it. I
  4. Issue creating multiple shaders with the same file

    Sorry, currentHealth variable is defined rightly. I just did the code again and I forgot to add math.max Respecting the shaders. Why should I put the shaders 255,255,255 ? It depends of the shader file and how it is coded or im wrong ? Regards.
  5. Hello dear community. Im currently trying to create multiple shaders using the same file. In fact they are created but with the same values. For example. To the second shader I set it a different colour but when I draw it, practically has the same value as the first one. Other issue is that sometimes one of the both shaders isn't draw. I can't really remember why because I have tested it few days ago. Anyways, the goal of this topic is that you could help me to fix it or give me some tips to reach the goal. currentHealth = 0 currentNos = 0 function startDrawing() dxDrawImage( 100, 350, 300, 300, myShader,0,0,0,tocolor(40,220,40,255) ) dxDrawImage( 450, 350, 300, 300, myShader2,0,0,0,tocolor(255,0,0,255) ) local theVehicle = getPedOccupiedVehicle(localPlayer) if theVehicle then local theHealth = getElementHealth(theVehicle) or 0 local theNos = getVehicleNitroLevel(theVehicle) or 0 currentHealth = (theHealth-250)/750 currentNos = theNos else currentHealth = 0 currentNos = 0 end dxSetShaderValue( myShader, "degrees", currentHealth*180 ) dxSetShaderValue( myShader2, "degrees", (currentNos*180) ) end function startShadeing() myShader = dxCreateShader( "ring/Circle.fx" ) --Health myShader2 = dxCreateShader( "ring/Circle.fx" ) --Nos myTexture = dxCreateTexture( "ring/emptyCircle.png" ) dxSetShaderValue( myShader, "tex", myTexture ) dxSetShaderValue( myShader2, "tex", myTexture ) dxSetShaderTransform(myShader2,180,180,0) dxSetShaderValue(myShader, "rgba", 0/255, 255/255, 40/255,1) dxSetShaderValue(myShader2, "rgba", 0/255, 40/255, 220/255,1) addEventHandler("onClientRender",root,startDrawing) end addEventHandler("onClientResourceStart",resourceRoot,startShadeing) Thanks for reading, best regards.
  6. Lag while spectating players

    EDIT: Issue fixed. It was the unfreeze function on clientside instead serverside. Thanks for ur help. Im using setCameraTarget Yes, here it is. Btw, the issue shouldn't be on the camera target. It must be on the spawning player, vehicle or soemthing like that due to I see the rest of players too lag. function spectateSomeoneC() for i,player in ipairs(cArenaPlayers) do if getElementData(player,"state") == "alive" then setCameraTarget(player) local cam = getCamera() local myDim = getElementData(localPlayer,"aDimension") setElementDimension(cam,myDim) return end end end addEvent( "onClientSpectateSomeone", true ) addEventHandler( "onClientSpectateSomeone", getRootElement(), spectateSomeoneC) And here it is my spawning player and vehicle function function spawnPlayerInVehicle(thePlayer) if thePlayer then local rSpawn = math.random(1,#arenaSpawns) local v,x,y,z,rz = unpack(arenaSpawns[rSpawn]) local pDimension = getElementData(thePlayer,"aDimension") spawnPlayer ( thePlayer, 0, 0, 5, 90, 0,0,pDimension ) myVehicle = createVehicle(v,x,y,z,0,0,rz) setElementDimension(thePlayer,pDimension) setElementDimension(myVehicle,pDimension) setElementInterior(thePlayer,0) setElementInterior(myVehicle,0) setElementFrozen(myVehicle,true) warpPedIntoVehicle ( thePlayer, myVehicle ) setCameraTarget(thePlayer) end end Btw, vehicle is unfrozen clientside. I don't know if this can affect to it. Regards.
  7. Table Empty issue

    Genious !
  8. Lag while spectating players

    I tried making the spectating on both sides Client and server and I get the same result. I did it and Im still geting the same issue. Regards,
  9. Table Empty issue

    I won't do undo my old function due to It is managed by other scripts too so I tried to implement your's one with mine one. Sadly I didn't get the solution Look, it is still not working function updatePlayersInArena() arenaPlayers = {} local players = getElementsByType("player") for i,player in ipairs(players) do if getElementData(player,"arenaTag") then table.insert(arenaPlayers,player) end end if #arenaPlayers < 1 or not arenaPlayers then outputChatBox("Arena is empty, setting default state") setRaceState("none") end end function playerLeavingServer() for id,player in ipairs(arenaPlayers) do if player == source then table.remove(arenaPlayers,id) end end updatePlayersInArena() end addEventHandler( "onPlayerQuit", getRootElement(), playerLeavingServer)
  10. Table Empty issue

    Thats exactly what I mean. However, i think that Im going to change the way of adding players to if not arenaPlayer [thePlayer] then arenaPlayer [thePlayer] = true end And when the player stay in the arena and leaves the server arenaPlayer [thePlayer] = nil If you know another way which is similar to the first one commented, just leave an answer. Im not adding any player because the function shouldnt add any player if there is not anyone on the server. And the table.insert is before the check players in table condition. Thanls and regards.
  11. Table Empty issue

    Hey dear community, today Im having a little issue when the player leave the server. Well, Im currently updating the players in a table when they join the arena, leave and quit. Well, the issue is when the arena is empty, I want to set a status but it doesn't work setRaceState function only changes the value of a variable, but it doesn't work. When I join and check the variable value with a different custom function it drops me the old one and not "none" as it should be due to the arenaPlayers table is 0. I don't know if you have gotten me at all, but I hope you can bring me a tip to fix it. function updatePlayersInArena() arenaPlayers = {} local players = getElementsByType("player") for i,player in ipairs(players) do if getElementData(player,"arenaTag") then table.insert(arenaPlayers,player) end end if #arenaPlayers <= 0 then outputChatBox("Arena is empty, setting default state") setRaceState("none") end end addEventHandler( "onPlayerQuit", getRootElement(), updatePlayersInArena) Best regards.
  12. Hide the HUD

    Aqui tienes un codigo mas corto. Dado que el tuyo problamente te de errores. local showingHud = true -- AQUIT CAMBIALO POR 'false' si quieres que si/no se muestre desde el principio function toggleHUD() showingHud = not showingHud if showingHud then showChat(true) setPlayerHudComponentVisible ( "all", true ) outputChatBox("HUD Enabled") else showChat(false) setPlayerHudComponentVisible ( "all", false ) outputChatBox("HUD Disabled") end end bindKey("f5","down",toggleHUD)
  13. square on all resolutions

    As MisterQuestions said you can follow his way, however, if u are going to draw text over the rectangle. Probabilly you will need to conver the size of the font on different resolutions. So, I recomend you to create a scaleConverter function. In my opinion is the best option because you only will need to muliply the sizes by the scale that returns your custom function. Regards.
  14. Lag while spectating players

    Well, when the players and the car is created I have set them the same dimension 11 and the same interior(0) The 3rd player you see on the video isn't in the arena. Objects are created in the same dimension (11) - Outputting Vehicle Dim and Players Dim Code function sayPVdIM() local players = getElementsByType("player") for i,player in ipairs(players) do local pName = getPlayerName(player) local pDimension = getElementDimension(player) local vehicle = getPedOccupiedVehicle(player) if vehicle then local vDim = getElementDimension(vehicle) outputChatBox(pName.."#ffffff Dim:"..pDimension.." | Vehicle Dim: "..vDim) else outputChatBox(pName.."#ffffff Dim:"..pDimension.." | Vehicle Dim: none") end end end - Spawning player in Vehicle Code function spawnPlayerInVehicle(thePlayer) if thePlayer then local rSpawn = math.random(1,#arenaSpawns) local v,x,y,z,rz = unpack(arenaSpawns[rSpawn]) local pDimension = getElementData(thePlayer,"aDimension") spawnPlayer ( thePlayer, 0.0, 0.0, 5, 90, 0,0,pDimension ) myVehicle = createVehicle(v,x,y,z,0,0,rz) setElementDimension(thePlayer,pDimension) setElementDimension(myVehicle,pDimension) setElementInterior(thePlayer,0) setElementInterior(myVehicle,0) end end Here I have done a second video about it Thanks for reading. Best regards.
  15. Lag while spectating players

    There are not renders errors. I have checked debugacript 3 on both machines. As I said, arent fps issues, are lags (like ping) issues. Might collision with objects or something like that but it is coded pretty well. I hope u can help me.