Jump to content

Jacobob14

Members
  • Posts

    266
  • Joined

  • Last visited

Everything posted by Jacobob14

  1. I don't know why give me this error the console http://prntscr.com/8zjw7m help me plis function chase_move (ped, oldTx, oldTy, oldTz, oldPx, oldPy, oldPz) if not ped then return end if (isElement(ped)) then if (getElementData ( ped, "status" ) == "chasing" ) and (getElementData (ped, "slothbot") == true) then setTimer ( function() setPedWeaponSlot (ped, weap) end, 850, 1) -- this is the line of the error end end end
  2. solucionado borren el post plis
  3. Jacobob14

    Help Table

    I do not understand what the problem when i insert data in Table all is well but when I try recover of the table data not work for i,top in ipairs(topslist) do outputChatBox(topslist[top].Score) end addEventHandler("onElementDataChange",root, function (data) if ( data == "money" ) and getElementType(source) == "player" then local money = getElementData(source,"money") topslist[source] = {Score = money, Name = getPlayerName(source)} end end )
  4. Jacobob14

    Help XML

    sorry again how could save the data in a table ? I would like to be saved like this format Teams = { ["citizen"] = { red = 0 , green = 100, blue = 40 } } i try something like this but it does not work red = xmlNodeGetAttribute ( teamName, "red" ) teamname = xmlNodeGetAttribute ( node, "name" ) table.insert(Teams, { [ teamname ] = { "red" = red}} )
  5. Jacobob14

    Help XML

    thank you very much for your great help
  6. Jacobob14

    Help XML

    I don't understand how I would use it? something like that function start() local file = xmlLoadFile ( "datos.xml" ) local children = xmlNodeGetChildren ( file ) for index, node in pairs ( children ) do for class, color in pairs ( xmlFindChild(node, 'color', 0) ) do outputChatBox(xmlNodeGetAttribute ( node, "name" )) end end end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), start)
  7. Jacobob14

    Help XML

    as I can do to get the other XML data color and skin id xml "Team1" > "0" green="75" blue="150" /> "287" /> "Team2" > "0" green="0" blue="250" /> "15" /> my script function start() local file = xmlLoadFile ( "datos.xml" ) local children = xmlNodeGetChildren ( file ) for index, node in pairs ( children ) do outputChatBox(xmlNodeGetAttribute ( node, "name" )) end end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), start)
  8. as could be done to put alpha only the mask and the texture has another alpha?
  9. as it could change the alpha of a shader so that does not leave very dark image ? /* Author: 50p Version: v1.0 Description: This shader allows you to mask a texture with a mask texture (black and white). */ texture ScreenTexture; sampler implicitInputTexture = sampler_state { Texture = ; }; texture MaskTexture; sampler implicitMaskTexture = sampler_state { Texture = ; }; float4 MaskTextureMain( float2 uv : TEXCOORD0 ) : COLOR0 { float4 sampledTexture = tex2D( implicitInputTexture, uv ); float4 maskSampled = tex2D( implicitMaskTexture, uv ); sampledTexture.a = (maskSampled.r + maskSampled.g + maskSampled.b) / 3.0f; return sampledTexture; } technique Technique1 { pass Pass1 { AlphaBlendEnable = true; SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; PixelShader = compile ps_2_0 MaskTextureMain(); } }
  10. Como puedo crear un dxProgress pero de varios rectangles algo como esto something like this
  11. but what I want is making a dxprogress but whit several rectangles something like this
  12. how I can make the image is not repeated at the end of map????? local rot = getPedCameraRotation(localPlayer) local px,py = getElementPosition(localPlayer) local tx,ty = (3000+px)/6000*mx, (3000-py)/6000*my local wx, hy, wx1, sy1 = tx-(alt/2),ty-(alt/2),alt,alt dxDrawImageSection(0, 0, 600, 600, wx, hy, wx1, sy1, "radar.png",-rot,0,0,tocolor(255,255,255,al))
  13. please you give me one example?
  14. how I can make a progress bar with some dxrectangles? something like this
  15. i try to make the radarareas in GTAV radar but does not work appear in different positions any help please? local mx,my = 3000,3000 local renderareas = dxCreateRenderTarget( 600, 600,true ) local renderradar = dxCreateRenderTarget( 342, 264,true ) local altura = 1500 function doDrawAreas() local vehicle = getPedOccupiedVehicle (localPlayer) if isPedInVehicle(localPlayer) then local vx,vy,vz = getElementVelocity(vehicle) velocidade = ( 1 + (vx^2 + vy^2 + vz^2)^(0.5) ) / 3.5 end local altd = altura * math.min(velocidade,2) - 80 dxSetRenderTarget( renderareas,true ) if getElementInterior(localPlayer) == 0 then for i, v in ipairs( getElementsByType('radararea') ) do local tick=abs(getTickCount()%1000-500) local aFactor=tick/500 local r,g,b,a = getRadarAreaColor(v) local w,h = getRadarAreaSize(v) local ax,ay = getElementPosition(v) local x,y = (3000+(ax))/6000*mx, (3000-(ay))/6000*my if isRadarAreaFlashing(v) then a=a*aFactor end dxDrawRectangle(x, (y-h) + 4 + (h/2), (w/2), (h/2), tocolor(r,g,b,a)) end end dxSetRenderTarget() local rot = getPedCameraRotation(localPlayer) local px,py = getElementPosition(localPlayer) local tx,ty = (3000+px)/6000*mx, (3000-py)/6000*my dxDrawImageSection(0,0, 600, 600, tx-(altd/2),ty-(altd/2),altd,altd, renderareas,-rot,0,0,tocolor(255,255,255,255)) end
  16. Jacobob14

    Help xml

    I just want the information according to the level of the player is correct as well? local file = xmlLoadFile ( "xml_file.xml" ); local children = xmlNodeGetChildren ( file ); for index, node in pairs ( children ) do if ( xmlNodeGetName ( node ) == "level" ) then local name = tonumber ( xmlNodeGetAttribute ( node, "name" ) ); local exp = tonumber ( xmlNodeGetAttribute ( node, "exp" ) ); local data1 = tonumber ( xmlNodeGetAttribute ( node, "data1" ) ); local data2 = tonumber ( xmlNodeGetAttribute ( node, "data2" ) ); if name == getElementData(localPlayer,"level") then outputChatBox ( "Name: ".. name ); outputChatBox ( "Exp: ".. exp ); outputChatBox ( "Data1: ".. data1 ); outputChatBox ( "Data2: ".. data2 ); end end end
  17. Jacobob14

    Help xml

    hi i want to make my own level system as I can do to detect exp and data 1 and data 2 level of each player "1" exp = "500" data1 = "100" data2="10" /> "2" exp = "1500" data1 = "200" data2="30" /> "3" exp = "3000" data1 = "300" data2="50" /> "4" exp = "6000" data1 = "400" data2="100" />
  18. hi am doing a scoreboard everything works fine but would like to know how I can sort players for his team as in the dxscoreboard of the comunity ServerPlayers = {} cache = 1 function scoreboarddx() dxDrawRectangle(x1*250, y1*300, x1*500, y1*500, tocolor(80, 80, 80, 160), false) dxDrawRectangle(x1*250, y1*250, x1*500, y1*50, tocolor(40, 40, 40, 240), false) dxDrawText("Name", x1*320, (204/768)*sY, (599/1366)*sX, (275/768)*sY, tocolor(255, 255, 255, 255), 1.20, "clear", "left", "center", false, false, false, false, false) number = 0 for i = cache, cache + 13 do if i <= #ServerPlayers then if ServerPlayers then if ServerPlayers[i] ~= nil and ServerPlayers[i] ~= false then local r, g, b if getElementType(ServerPlayers[i]) == "player" then r, g, b = getPlayerNametagColor ( ServerPlayers[i] ) else r, g, b = 255, 255, 255 end local nick = getPlayerName(ServerPlayers[i]) or getElementData(ServerPlayers[i],"name") dxDrawText(nick , x1*320, ((284 + number)/768)*sY, x1*438, (275/768)*sY, tocolor(r, g, b, 255), 1.20, "clear", "left", "center", false, false, false, true, false) dxDrawText(getElementData ( ServerPlayers[i], "level" ) or 0, (726/1366)*sX, ((284 + number)/768)*sY, (968/1366)*sX, (275/768)*sY, tocolor(255, 255, 255, 255), 1.20, "clear", "center", "center", false, false, false, false, false) number = number + 40 end end end end end function Players () local players = getElementsByType ( "player" ) ServerPlayers = nil ServerPlayers = {} for theKey,thePlayer in ipairs(players) do table.insert (ServerPlayers, thePlayer) end end
  19. intento hacer que la camara se mueva pero no funciona no se cual es el problema function moveCameraTo( class, skin ) local x, y, z, lx, ly, lz = getCameraMatrix () local camX, camY, camZ = class.cameraMngr.pos.x, class.cameraMngr.pos.y, class.cameraMngr.pos.z; local lookAtX, lookAtY, lookAtZ = class.cameraMngr.lookAt.x, class.cameraMngr.lookAt.y, class.cameraMngr.lookAt.z; local posx, posy, posz = interpolateBetween (x, y, z, camX, camY, camZ, 2000, "OutBounce" ) setCameraMatrix(posx, posy, posz,posx, posy, posz) end end
  20. this the spawn of 50p I'm trying to make when choosing a camera shake spawn function classSelected ( ) selectedRow = gridList:SelectedItem( ); if selectedRow ~= -1 then local data = split( gridList:ItemData( selectedRow, 1 ), string.byte(',') ); local classIndex = tonumber( data[ 1 ] ); local skinIndex = tonumber( data[ 2 ] ); local class = classGroups[ selectedGroup + 1 ].classes[ classIndex ]; local skin = classGroups[ selectedGroup + 1 ].classes[ classIndex ].skinMngr.skins[ skinIndex ]; start = getTickCount() addEventHandler ( "onClientRender", getRootElement(), moveCameraTo(class, skin ) ) if previousClass ~= classIndex then resizeWeaponsWnd( class.weaponMngr ); else teleportTempPed( skin ); end previousClass = classIndex; local classDescr = class.info; if classDescr then descrLabel:Text( classDescr ); info = classDescr descrGridList:Visible( true ); else descrGridList:Visible( false ); weaponsGrid:Visible( false ); end else descrGridList:Visible( false ); weaponsGrid:Visible( false ); end end function moveCameraTo( class, skin ) local x, y, z, lx, ly, lz = getCameraMatrix () local camX, camY, camZ = class.cameraMngr.pos.x, class.cameraMngr.pos.y, class.cameraMngr.pos.z; local lookAtX, lookAtY, lookAtZ = class.cameraMngr.lookAt.x, class.cameraMngr.lookAt.y, class.cameraMngr.lookAt.z; local camerax, cameray, cameraz = interpolateBetween (x, y, z, camX, camY, camZ, 2000, "OutBounce" ) setCameraMatrix(camerax, cameray, cameraz, camerax, cameray, cameraz ) if x == camX and y == camY and z == camZ then teleportTempPed( skin ) end end
  21. I'm trying to make a move with the camera but it does not work help please function moveCameraTo( class, skin ) local x, y, z, lx, ly, lz = getCameraMatrix () local camX, camY, camZ = class.cameraMngr.pos.x, class.cameraMngr.pos.y, class.cameraMngr.pos.z; local lookAtX, lookAtY, lookAtZ = class.cameraMngr.lookAt.x, class.cameraMngr.lookAt.y, class.cameraMngr.lookAt.z; local posx, posy, posz = interpolateBetween (x, y, z, camX, camY, camZ, 2000, "OutBounce" ) setCameraMatrix(posx, posy, posz,posx, posy, posz) if x == camX and y == camY and z == camZ then teleportTempPed( skin ) end end
  22. thanks man thank you very much and forgive my bad English
  23. Jacobob14

    help pliz

    which is the error I want you send money the player selects but does not work I do not know why ;( enviar = guiCreateButton( x3*655, y3*340, x3*70, y3*50, "enviar", false) edit2 = guiCreateEdit(x3*510, y3*340, x3*140, y3*50, "", false) addEventHandler("onClientResourceStart",getRootElement(), function() sWidth, sHeight = guiGetScreenSize() local x = sWidth/1000 local y = sHeight/1000 edit = guiCreateEdit(x*510, y*400, x*0, y*0, "", false) grid = guiCreateGridList(x*510, y*410, x*220, y*325, false) guiGridListSetSelectionMode(grid,2) guiSetVisible(edit, false) guiSetVisible(grid, false) guiSetVisible(edit2, false) guiSetVisible(enviar, false) addEventHandler ( "onClientGUIClick", grid, click ) column = guiGridListAddColumn( grid, "Nombre del Jugador", 0.9 ) if ( column ) then for id, player in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( grid ) guiGridListSetItemText ( grid, row, column, getPlayerName ( player ):gsub ( "#%x%x%x%x%x%x", "" ), false, false ) guiGridListSetItemData ( grid, row, column, getPlayerName ( player ) ) end addEventHandler ( "onClientGUIClick", grid, click, false ) end end) function click () local playerName = guiGridListGetItemData ( grid, guiGridListGetSelectedItem ( grid ), 1 ) guiSetText ( edit, playerName ) end function givem() local name = guiGetText ( edit ) local target = getPlayerFromName(name) local getmoney = guiGetText ( edit2 ) local money = tonumber ( getmoney ) if ( money ) then if (getPlayerMoney (source) < money) then outputChatBox ("#ff0000Error dinero insuficiente",225,255,255,true) else givePlayerMoney (target , money ) outputChatBox ("#ffffff Dinero enviado Exitosamente a: " ..name,255,225,255,true) takePlayerMoney(money) end else outputChatBox ("#ffBB00Error : La cantidad no es validad",225,255,255,true) end end addEventHandler ("onClientGUIClick", enviar, givem)
  24. as I can make a slothbot go faster and tried everything but I do not know how to do ;(
  25. Jacobob14

    help pliz

    iwant to know the exp is needed in the next level but it gives me error http://prntscr.com/3s57pe function lev(player) local level = exports.exp_system:getPlayerLevel ( player ) local name, expreq = exports.exp_system:getLevelData ( level ) local name1, expreq1 = exports.exp_system:getLevelData ( level+1 ) outputChatBox ( name ..": ".. expreq.." - "..expreq1, player ) setElementData(player,"expreq",expreq) setElementData(player,"expreq1",expreq1) end addEventHandler ( "onPlayerJoin", getRootElement(), lev ) addEventHandler ( "onPlayerLogin", getRootElement(), lev )
×
×
  • Create New...