Jump to content

TRtam

Members
  • Posts

    65
  • Joined

  • Last visited

Everything posted by TRtam

  1. TRtam

    Draw ACL

    Este ejemplo dibuja cada acl con sus objetos, espero que te sirva: -- -- server -- function get(player) local result = {}; for i, acl in pairs(aclGroupList()) do result[i] = {name = aclGroupGetName(acl), objects = {}}; for object, name in pairs(aclGroupListObjects(acl)) do table.insert(result[i].objects, name); end end triggerClientEvent(player, "receive", resourceRoot, result); end addEvent("get", true); addEventHandler("get", resourceRoot, get); -- -- client -- local data = nil; function start() triggerServerEvent("get", resourceRoot, localPlayer); end addEventHandler("onClientResourceStart", resourceRoot, start); function receive(acls) data = acls; end addEvent("receive", true); addEventHandler("receive", resourceRoot, receive); function render() if not data then return; end local offset_y = 0; for i, value in pairs(data) do dxDrawText(value.name, 200, offset_y); offset_y = offset_y + 20; for i, object in pairs(value.objects) do dxDrawText(object, 220, offset_y); offset_y = offset_y + 20; end end end addEventHandler("onClientRender", root, render);
  2. Like this addEventHandler("onClientRender", root, function() local scoreboard_rows = {}; for i, player in pairs(getElementsByType("player")) do if not getPlayerTeam(player) then table.insert(scoreboard_rows, player); end end for i, team in pairs(getElementsByType("team")) do local team_players = getPlayersInTeam(team); if #team_players > 0 then table.insert(scoreboard_rows, team); for i, player in pairs(team_players) do table.insert(scoreboard_rows, player); end end end for i, row in pairs(scoreboard_rows) do if getElementType(row) == "player" then -- draw your dx stuff here elseif getElementType(row) == "team" then -- draw your dx stuff here end end end )
  3. I dont know the way that you are inserting the players to the scoreboard, but i will give you an example including teams: scoreboard_rows = {}; for i, player in pairs(getElementsByType("player")) do if not getPlayerTeam(player) then table.insert(scoreboard_rows, player); end end for i, team in pairs(getElementsByType("team")) do local team_players = getPlayersInTeam(team); if #team_players > 0 then table.insert(scoreboard_rows, team); for i, player in pairs(team_players) do table.insert(scoreboard_rows, player); end end end
  4. Did you give admin right to the scoreboard?
  5. TRtam

    Dx Rotation

    Cada dxDraw function tiene este argumento "postGUI" y la wiki dice que:
  6. TRtam

    Dx Rotation

    Probaste usando postGUI en la imagen que rota?
  7. This is the first idea that came to my mind, maybe is there more useful ways to do it. function someFunction() passwordVerify( password, hashedPassword, {}, function(matched) passVerificationComplete(matched, someOtherParam) end ) end function passVerificationComplete(matched, someOtherParam) if matched then outputDebugString(someOtherParam) -- passwords matched else -- passwords mismatch end end
  8. Maybe i misunderstood your problem, your problem is that you want to make the camera stay where the player died or not? If is it then the example i gave you above should work
  9. This should fix your problem, but you will need to reset the camera target to localPlayer when you spawn again. addEventHandler("onClientPreRender", root, function() if isPedDead(localPlayer) then setCameraMatrix(getCameraMatrix()); end end );
  10. https://wiki.multitheftauto.com/wiki/DxDrawCircle this function have a example to draw a rounded rectangle
  11. First draw the blur and then draw the UI
  12. Maybe this (Just change the intensity to whatever you want): // // blackwhite.fx // texture screenSource; float intensity = 0.5; sampler TextureSampler = sampler_state { Texture = <screenSource>; }; float4 PixelShaderFunction(float2 TextureCoordinate : TEXCOORD0) : COLOR0 { float4 color = tex2D(TextureSampler, TextureCoordinate); float value = (color.r + color.g + color.b) / 3 * intensity; color.r = value; color.g = value; color.b = value; return color; } technique BlackAndWhite { pass Pass1 { PixelShader = compile ps_2_0 PixelShaderFunction(); } } Or this: // // blackwhite.fx // texture screenSource; float intensity = 0; sampler TextureSampler = sampler_state { Texture = <screenSource>; }; float4 PixelShaderFunction(float2 TextureCoordinate : TEXCOORD0) : COLOR0 { float4 color = tex2D(TextureSampler, TextureCoordinate); float value = (color.r + color.g + color.b) / 3; color.r = value; color.g = value; color.b = value; return color * intensity; } technique BlackAndWhite { pass Pass1 { PixelShader = compile ps_2_0 PixelShaderFunction(); } }
  13. TRtam

    Atraer Jugador

    usando onClientRender con interpolateBetween deberias poder hacerlo
  14. Hmm creo que no, podrias usar setElementData para asignar el estilo de pelea a un jugador y usar getElementData para obtener ese estilo
  15. JAJAJ, usa playSound3D y setSoundMaxDistance
  16. TRtam

    PED Collision

    Probe usando las 2 funciones y setElementCollidableWith si me permite moverme pero la otra funcion no
  17. TRtam

    PED Collision

    Puedes probar usando setElementCollidableWith
  18. TRtam

    PED Collision

    Si es posible y tienes que usar setElementCollisionsEnabled
  19. TRtam

    [Consulta] SQLite

    Cuando le añades un comando a una funcion, esta funcion pasa a tener los siguientes argumentos: thePlayer ( el jugador que ejecuto el comando ), commandName ( el nombre del comando ), y los argumentos que en tu caso seria username y pass. Osea que tu funcion quedaria asi: function registerPlayer ( thePlayer, commandName, username, pass ) Es por eso que en tu database en lugar de guardar el username no guarda nada, y en pass lo que guarda es el nombre del comando
  20. TRtam

    Una duda

    Tienes que crear un elemento que tenga de children cada marker que crees y para eso tendras que setear el parent del marker hacia el elemento creado, por si no me entendiste te doy un ejemplo local markersGroup = createElement ( "markersGroup" ) -- este vendria a ser el "contenedor" para los markers que quieras poner local marker1 = createMarker ( ... ); -- claramente creas los markers local marker2 = createMarker ( ... ); local marker3 = createMarker ( ... ); local marker4 = createMarker ( ... ); -- y usamos la funcion setElementParent para que cada marker que creemos se una al "contenedor" que seria markersGroup setElementParent ( marker1, markersGroup ); setElementParent ( marker2, markersGroup ); setElementParent ( marker3, markersGroup ); setElementParent ( marker4, markersGroup ); -- y listo, ahora solo habria que poner markersGroup en el event handler addEventHandler ( "onMarkerHit", markersGroup, function ( ) outputDebugString ( "alv" ) end )
  21. TRtam

    Target Player

    Mira el primer ejemplo de esta funcion: processLineOfSight tal vez puedas adaptarlo a lo que necesites
  22. TRtam

    dxDrawImage3d

    Tienes que restarle a la posicion X la mitad del tamaño y lo mismo con la posicion Y, aca te dejo un ejemplo: local x, y, z = getElementPosition ( player ) local z_ground = getGroundPosition( x, y, z ) local width = 2 local height = 2 x = x - width / 2 y = y - height / 2 dxDrawImage3D( x, y, z_ground+0.1, width, height, imagenk, tocolor( 0, 255, 255, 255 ), 0, x, y, z +1 )
  23. Replace your old openVIPpanel function with this: function openVIPpanel(thePlayer) account = getPlayerAccount(thePlayer) if isObjectInACLGroup("user."..getAccountName(account), aclGetGroup("VIP")) then triggerClientEvent (thePlayer, "openVIPWindow", thePlayer) else outputChatBox("¡No eres usuario V.I.P!.",thePlayer,255,0,0) triggerClientEvent ( thePlayer, "denegarSound", root ) end end Put this somewhere in client-side: function denegarSound ( ) playSound ( "denegar.mp3" ); end addEvent ( "denegarSound", true ) addEventHandler ( "denegarSound", root, denegarSound )
×
×
  • Create New...