Jump to content

MIKI785

Members
  • Posts

    1,131
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by MIKI785

  1. As far as I understand from reading the wiki, it creates a GUI element. This means that you are to treat it as any other GUI element, not like dx functions.

    Basically, there's no need to render it yourself using onClientRender -> the resource does that for you.

    So, what your code does is that it's creating a new GUI element on every render, that's why you're not able to destroy it. You're only storing the latest instance of that GUI element inside of the blur variable.

    • Thanks 1
  2. Simply use getPedOccupiedVehicle.

    ddEventHandler( "onClientRender",root,
       function( )
          local px, py, pz, tx, ty, tz, dist
          px, py, pz = getCameraMatrix( )
          for _, v in ipairs( getElementsByType 'player' ) do
          --if(player ~= localPlayer) then
          	 if not getPedOccupiedVehicle(v) then
               tx, ty, tz = getElementPosition( v )
               dist = math.sqrt( ( px - tx ) ^ 2 + ( py - ty ) ^ 2 + ( pz - tz ) ^ 2 )
               if dist < 30.0 then
                  if isLineOfSightClear( px, py, pz, tx, ty, tz, true, false, false, true, false, false, false,localPlayer ) then
                     local sx, sy, sz = getPedBonePosition( v, 6 )
                     local x,y = getScreenFromWorldPosition( sx, sy, sz +1.5 )
                     if x then -- getScreenFromWorldPosition returns false if the point isn't on screen
                      dxDrawLine3D ( sx, sy, sz+0.2,sx, sy, sz+1.35, tocolor ( 0, 210,0, 90 ), 1.45,false)
                  dxDrawText( "Warrior", x-9.5, y, x, y, tocolor(0,210,0,150), 0.85 + ( 15 - dist ) * 0.035, "default-bold" )
                     end
                  end
               end
             end
          end
       end
    )

     

    • Like 1
  3. On 09/11/2019 at 22:43, xFabel said:

    like this not work ?

    
    function updateTeamColour()
    	setTeamColor ( team[2], colour.r, colour.g, colour.b )
    end
    addEvent("updateTeamColour", true)
    addEventHandler("updateTeamColour", resourceRoot, updateTeamColour)
    addEventHandler("onPlayerJoin", getRootElement(), updateTeamColour)
    

    server side

    Where are team and colour defined?

  4. Well, first of all, Ubuntu 16 is an old version (albeit still in support), you should use 18.04 if you want a newer LTS version.

    Now to answer your question, you have two options:

    The first option is to shutdown the server by using the 'shutdown' command inside the server console. If you used the 'screen' program mentioned in the tutorial you linked, you first have to re-attach the mtasa console by running 'screen -r mtasa'. After the server is off, you can edit the ACL and then start the server again after you're done. If you edit the ACL while the server is running, it will get overwritten upon shutdown.

    The second option is to use the 'reloadacl' command. Simply edit the ACL while the server is running, re-attach the server console as described above and execute the 'reloadacl' command in the server console. No server restart is needed here.

  5. You can use SFTP and connect to the VPS using the same credentials as you use for SSH (WinSCP is a nice SFTP client you can use). Navigate to wherever your mta server is and put the resources under mods/deahtmatch/resources/, either as a .zip or a regular directory. Then run the 'refresh' command either in the server console or in-game (you have to be logged in with an account with sufficient permissions). The new resources should load and you can then start them using the 'start' command.

    You can find a list of built-in server commands here: https://wiki.multitheftauto.com/wiki/Server_Commands.

×
×
  • Create New...