Jump to content

Mateito14

Members
  • Posts

    50
  • Joined

  • Last visited

Everything posted by Mateito14

  1. Hola, estoy haciendo un script para spawnear un auto y aparezca dentro, también que si spawnea un auto se destruya el anterior, el problema es que cuando spawneas otro se frena el auto, hay alguna forma de hacer que cambie el auto y no se frene? El script. function SpawnVeh ( vehid ) if isPedInVehicle(source)==true then destroyElement (veh) end if isElement( veh ) then destroyElement( veh ) end local x,y,z = getElementPosition(source) local rx,ry,rz = getElementRotation(source) veh = createVehicle(vehid, x,y,z, rx, ry, rz) warpPedIntoVehicle ( source, veh ) end addEvent ("obtVeh", true) addEventHandler ("obtVeh", getRootElement(), SpawnVeh)
  2. hola, ando buscando host para pagar por rapipago o bitcoin, encontré uno por rapipago pero me pareció caro.
  3. Gracias, había tratado de hacer algo con el "onResourceStop" pero no me funcionaba, este funciono , gracias.
  4. Hola. Necesito que me ayuden con esto, hice para que las armas no hagan daño que me salio bien pero el problema es que al parar el script las armas siguen sin hacer daño . Que hago? El Script addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() weaponList = { "colt 45", "silenced", "deagle", "shotgun", "sawed-off", "combat shotgun", "uzi", "mp5", "ak-47", "m4", "tec-9", "rifle", "sniper", "minigun" } for _,weapon in ipairs( weaponList ) do for _,skill in ipairs( { "poor", "std", "pro" } ) do setWeaponProperty(weapon, skill, "damage", 0) end end end)
  5. La verdad es que no entiendo mucho esto de interpolate, logre hacer esto por el video de Bc. Voy a hacer el panel sin la animación, Gracias por la ayuda .
  6. Probé y mas o menos se ajusto en la resolución 1024x768 solo que que el botón de cerrar no quedo en la esquina como yo quería y en la resolución 1366x768 quedo todo mal
  7. Es como que se ajusta todo menos el dxDrawRectangle principal que tiene la animación. function window () scX, scY = guiGetScreenSize() local screenX = 1366 local screenY = 768 local sx = 1/screenX local sy = 1/screenY xdDrawAnimWindow("Panel de armas", scX * (345*sx), scY * (364*sy), tocolor(51, 51, 51, 200),"default-bold","OutBack") end function gui() alphaQuit = 200 alphaKnife = 200 alphaKatana = 200 alphaPistola = 200 alphaPistolaS = 200 alphaDeagle = 200 alphaTec = 200 alphaMP5 = 200 quit = guiCreateButton(0.615, 0.256, 0.017, 0.031, "", true) addEventHandler("onClientGUIClick",quit,onClickQuit) addEventHandler( "onClientMouseEnter",quit,onEnterQuit) addEventHandler("onClientMouseLeave",quit,onLeaveQuit) knife = guiCreateButton(531, 242, 126, 20, "", false) addEventHandler("onClientGUIClick",knife,onClickknife) addEventHandler( "onClientMouseEnter",knife,onEnterknife) addEventHandler("onClientMouseLeave",knife,onLeaveknife) katana = guiCreateButton(531, 272, 126, 20, "", false) addEventHandler("onClientGUIClick",katana,onClickKatana) addEventHandler( "onClientMouseEnter",katana,onEnterKatana) addEventHandler("onClientMouseLeave",katana,onLeaveKatana) pistola = guiCreateButton(531, 302, 126, 20, "", false) addEventHandler("onClientGUIClick",pistola,onClickPistola) addEventHandler( "onClientMouseEnter",pistola,onEnterPistola) addEventHandler("onClientMouseLeave",pistola,onLeavePistola) pistolas = guiCreateButton(531, 332, 126, 20, "", false) addEventHandler("onClientGUIClick",pistolas,onClickPistolaS) addEventHandler( "onClientMouseEnter",pistolas,onEnterPistolaS) addEventHandler("onClientMouseLeave",pistolas,onLeavePistolaS) deagle = guiCreateButton(531, 362, 126, 20, "", false) addEventHandler("onClientGUIClick",deagle,onClickDeagle) addEventHandler( "onClientMouseEnter",deagle,onEnterDeagle) addEventHandler("onClientMouseLeave",deagle,onLeaveDeagle) tec = guiCreateButton(531, 392, 126, 20, "", false) addEventHandler("onClientGUIClick",tec,onClickTec) addEventHandler( "onClientMouseEnter",tec,onEnterTec) addEventHandler("onClientMouseLeave",tec,onLeaveTec) mp5 = guiCreateButton(531, 422, 126, 20, "", false) addEventHandler("onClientGUIClick",mp5,onClickMP5) addEventHandler( "onClientMouseEnter",mp5,onEnterMP5) addEventHandler("onClientMouseLeave",mp5,onLeaveMP5) uzi = guiCreateButton(710, 242, 126, 20, "", false) addEventHandler("onClientGUIClick",uzi,onClickUzi) addEventHandler( "onClientMouseEnter",uzi,onEnterUzi) addEventHandler("onClientMouseLeave",uzi,onLeaveUzi) shotgun = guiCreateButton(710, 272, 126, 20, "", false) addEventHandler("onClientGUIClick",shotgun,onClickSht) addEventHandler( "onClientMouseEnter",shotgun,onEnterSht) addEventHandler("onClientMouseLeave",shotgun,onLeaveSht) spaz = guiCreateButton(710, 302, 126, 20, "", false) addEventHandler("onClientGUIClick",spaz,onClickSpaz) addEventHandler( "onClientMouseEnter",spaz,onEnterSpaz) addEventHandler("onClientMouseLeave",spaz,onLeaveSpaz) recortada = guiCreateButton(710, 332, 126, 20, "", false) addEventHandler("onClientGUIClick",recortada,onClickRec) addEventHandler( "onClientMouseEnter",recortada,onEnterRec) addEventHandler("onClientMouseLeave",recortada,onLeaveRec) m4 = guiCreateButton(710, 362, 126, 20, "", false) addEventHandler("onClientGUIClick",m4,onClickM4) addEventHandler( "onClientMouseEnter",m4,onEnterM4) addEventHandler("onClientMouseLeave",m4,onLeaveM4) ak = guiCreateButton(710, 392, 126, 20, "", false) addEventHandler("onClientGUIClick",ak,onClickAK) addEventHandler( "onClientMouseEnter",ak,onEnterAK) addEventHandler("onClientMouseLeave",ak,onLeaveAK) sniper = guiCreateButton(710, 422, 126, 20, "", false) addEventHandler("onClientGUIClick",sniper,onClickSnp) addEventHandler( "onClientMouseEnter",sniper,onEnterSnp) addEventHandler("onClientMouseLeave",ak,onLeaveSnp) guiSetAlpha(quit, 0) guiSetAlpha(knife, 0) guiSetAlpha(katana, 0) guiSetAlpha(pistola, 0) guiSetAlpha(pistolas, 0) guiSetAlpha(deagle, 0) guiSetAlpha(tec, 0) guiSetAlpha(mp5, 0) guiSetAlpha(uzi, 0) guiSetAlpha(shotgun, 0) guiSetAlpha(spaz, 0) guiSetAlpha(recortada, 0) guiSetAlpha(m4, 0) guiSetAlpha(ak, 0) guiSetAlpha(sniper, 0) end local _dxDrawRectangle = dxDrawRectangle local _dxDrawText = dxDrawText function dxDrawRectangle( x, y, w, h, color, postGUI, relative ) if ( relative ) then sx, sy = guiGetScreenSize() pX, pY = ( sx/ 1366 ), ( sy / 768 ) x, y, w, h = pX*x, pY*y, pX*w, pY*h end _dxDrawRectangle( x, y, w, h, color, postGUI ); end function dxDrawText( txt, x, y, w, h, color, size, font, align, bottom, clip, wordwrap, colorCode, postGUI, relative ) if ( relative ) then sx, sy = guiGetScreenSize() pX, pY = ( sx / 1366 ), ( sy / 768 ) x, y, w, h = pX*x, pY*y, pX*w, pY*h end _dxDrawText( txt, x, y, w, h, color, size, font, align, bottom, clip, wordwrap, colorCode, postGUI); end function dxgui() dxDrawRectangle(841, 194, 24, 24, tocolor(255, 0, 0, alphaQuit), false, true) dxDrawText("X", 841, 194, 865, 221, tocolor(255, 255, 255, 255), 2.00, "default-bold", "center", "center", false, false, false, false, true) --botones --izquierda dxDrawRectangle(531, 242, 126, 20, tocolor(255, 255, 255, alphaKnife), false, true) --KNIFE dxDrawText("Knife LVL:1", 534, 242, 653, 261, tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center", false, false, false, false, true) dxDrawRectangle(531, 272, 126, 20, tocolor(255, 255, 255, alphaKatana), false, true) --katana dxDrawText("Katana LVL:1", 534, 302, 653, 261, tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center", false, false, false, false, true) dxDrawRectangle(531, 302, 126, 20, tocolor(255, 255, 255, alphaPistola), false, true) --pistola dxDrawText("Pistola LVL:1", 534, 362, 653, 261, tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center", false, false, false, false, true) dxDrawRectangle(531, 332, 126, 20, tocolor(255, 255, 255, alphaPistolaS), false, true) --pistolaS dxDrawText("Pistola S LVL:1", 534, 422, 653, 261, tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center", false, false, false, false, true) dxDrawRectangle(531, 362, 126, 20, tocolor(255, 255, 255, alphaDeagle), false, true) --Deagle dxDrawText("Deagle LVL:1", 534, 482, 653, 261, tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center", false, false, false, false, true) dxDrawRectangle(531, 392, 126, 20, tocolor(255, 255, 255, alphaTec), false, true) --Tec dxDrawText("Tec-9 LVL:1", 534, 542, 653, 261, tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center", false, false, false, false, true) dxDrawRectangle(531, 422, 126, 20, tocolor(255, 255, 255, alphaMP5), false, true) --MP5 dxDrawText("MP5 LVL:1", 534, 602, 653, 261, tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center", false, false, false, false, true) --derecha dxDrawRectangle(710, 242, 126, 20, tocolor(255, 255, 255, alphaUzi), false, true)--Uzi dxDrawText("Uzi LVL:1", 892, 242, 653, 261, tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center", false, false, false, false, true) dxDrawRectangle(710, 272, 126, 20, tocolor(255, 255, 255, alphaSht), false, true) --Shotgun dxDrawText("Shotgun LVL:1", 892, 302, 653, 261, tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center", false, false, false, false, true) dxDrawRectangle(710, 302, 126, 20, tocolor(255, 255, 255, alphaSpz), false, true) --Spaz dxDrawText("Spaz LVL:1", 892, 362, 653, 261, tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center", false, false, false, false, true) dxDrawRectangle(710, 332, 126, 20, tocolor(255, 255, 255, alphaRec), false, true) --Recortada dxDrawText("Recortada LVL:1", 892, 422, 653, 261, tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center", false, false, false, false, true) dxDrawRectangle(710, 362, 126, 20, tocolor(255, 255, 255, alphaM4), false, true) --M4 dxDrawText("M4 LVL:1", 892, 482, 653, 261, tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center", false, false, false, false, true) dxDrawRectangle(710, 392, 126, 20, tocolor(255, 255, 255, alphaAk), false, true) --ak47 dxDrawText("AK-47 LVL:1", 892, 542, 653, 261, tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center", false, false, false, false, true) dxDrawRectangle(710, 422, 126, 20, tocolor(255, 255, 255, alphaSnp), false, true) --Sniper dxDrawText("Sniper LVL:1", 892, 602, 653, 261, tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center", false, false, false, false, true) end --botones function onClickQuit() hideAll() end function onEnterQuit() alphaQuit = 255 local sound = playSound("seleccionar.wav") setSoundVolume(sound, 1.0) end function onLeaveQuit() alphaQuit = 200 end function onEnterknife() alphaKnife = 255 local sound = playSound("seleccionar.wav") setSoundVolume(sound, 1.0) end function onLeaveknife() alphaKnife = 200 end function onEnterKatana() alphaKatana = 255 local sound = playSound("seleccionar.wav") setSoundVolume(sound, 1.0) end function onLeaveKatana() alphaKatana = 200 end function onEnterPistola() alphaPistola = 255 local sound = playSound("seleccionar.wav") setSoundVolume(sound, 1.0) end function onLeavePistola() alphaPistola = 200 end function onEnterPistolaS() alphaPistolaS = 255 local sound = playSound("seleccionar.wav") setSoundVolume(sound, 1.0) end function onLeavePistolaS() alphaPistolaS = 200 end function onEnterDeagle() alphaDeagle = 255 local sound = playSound("seleccionar.wav") setSoundVolume(sound, 1.0) end function onLeaveDeagle() alphaDeagle = 200 end function onEnterTec() alphaTec = 255
  8. Cambie todo pero se sigue viendo así
  9. Lo había usado antes y después para tratar de que no aparezca "None" trate de hacer algo con exports.gang_system:getPlayerGang ( source )
  10. Hola estoy creando mi primer panel DX y me fue bien, configure para que se vea bien en todas las resoluciones pero al probar el panel en otra resolución se ve mal. Les dejo unas fotos 1366x768 resolución donde cree el panel 1024x768 resolución donde probé el panel Acá les dejo una parte del script function window () scX, scY = guiGetScreenSize() local screenX = 1366 local screenY = 768 local sx = 1/screenX local sy = 1/screenY xdDrawAnimWindow("Panel de armas", scX * (345*sx), scY * (364*sy), tocolor(51, 51, 51, 200),"default-bold","OutBack") end --botones function gui() local ancho, alto = guiGetScreenSize () alphaQuit = 200 alphaKnife = 200 alphaKatana = 200 alphaPistola = 200 alphaPistolaS = 200 alphaDeagle = 200 alphaTec = 200 alphaMP5 = 200 quit = guiCreateButton(0.615*ancho, 0.256*alto, 0.017*ancho, 0.031*alto, "", false) addEventHandler("onClientGUIClick",quit,onClickQuit) addEventHandler( "onClientMouseEnter",quit,onEnterQuit) addEventHandler("onClientMouseLeave",quit,onLeaveQuit) knife = guiCreateButton(531, 242, 126, 20, "", false) addEventHandler("onClientGUIClick",knife,onClickknife) addEventHandler( "onClientMouseEnter",knife,onEnterknife) addEventHandler("onClientMouseLeave",knife,onLeaveknife) guiSetAlpha(quit, 0) guiSetAlpha(knife, 0) end --botones dx function dxgui() scX, scY = guiGetScreenSize() local screenX = 1366 local screenY = 768 local sx = 1/screenX local sy = 1/screenY dxDrawRectangle(scX * (841*sx), scY * (194*sy), scX * (24*sx), scY * (24*sy), tocolor(255, 0, 0, alphaQuit)) dxDrawText("X", scX * (841*sx), scY * (194*sy), scX * (865*sx), scY * (221*sy), tocolor(255, 255, 255, 255), 2.00, "default-bold", "center", "center") dxDrawRectangle(scX * (531*sx), scY * (242*sy), scX * (126*sx), scY * (20*sy), tocolor(255, 255, 255, alphaKnife)) --KNIFE dxDrawText("Knife LVL:1", scX * (534*sx), scY * (242*sy), scX * (653*sx), scY *(261*sy), tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center") end function onClickQuit() cerrarTodo() end function onEnterQuit() alphaQuit = 255 end function onLeaveQuit() alphaQuit = 200 end function onEnterknife() alphaKnife = 255 local sound = playSound("seleccionar.wav") setSoundVolume(sound, 1.0) end function onLeaveknife() alphaKnife = 200 end function main(key, keyState) showCursor(true) removeEventHandler("onClientRender", getRootElement(), dxgui) removeEventHandler("onClientRender", getRootElement(), window) start = getTickCount() addEventHandler("onClientRender", getRootElement(), window) setTimer ( function() local sound = playSound("open.wav") setSoundVolume(sound, 1.0) end, 800, 1 ) setTimer ( function() guiContenido() addEventHandler ( "onClientRender", getRootElement(), dxgui ) end, 1500, 1 ) end bindKey ( "F2", "down", main ) function cerrarTodo() showCursor(false) removeEventHandler("onClientRender", getRootElement(), dxgui) removeEventHandler("onClientRender", getRootElement(), window) start2 = getTickCount() addEventHandler ( "onClientRender", getRootElement(), cerrar ) setTimer ( function() removeEventHandler("onClientRender", getRootElement(), cerrar) end, 1500, 1 ) end function xdDrawAnimWindow(text,alto,ancho,color,font,anim) local x, y = guiGetScreenSize() btAncho = ancho btAlto = alto/20 local now = getTickCount() local elapsedTime = now - start local endTime = start + 1500 local duration = endTime - start local progress = elapsedTime / duration local x1, y1, z1 = interpolateBetween ( 0, 0, 0, ancho, alto, 255, progress, anim) local x2, y2, z2 = interpolateBetween ( 0, 0, 0, btAncho, btAlto, btAlto/11, progress, anim) posx = (x/2)-(x1/2) posy = (y/2)-(y1/2) dxDrawRectangle ( posx, posy-y2, x2, y2, color ) dxDrawRectangle ( posx, posy, x1, y1, tocolor ( 0, 0, 0, 200 ) ) dxDrawText ( text, 0, -(y1)-y2, x, y, tocolor ( 255, 255, 255, 255 ), z2, font,"center","center") end function cerrar() ancho = 345 alto = 364 local now2 = getTickCount() local elapsedTime2 = now2 - start2 local endTime2 = start2 + 1500 local duration2 = endTime2 - start2 local progress2 = elapsedTime2 / duration2 local x3, y3, z3 = interpolateBetween ( ancho, alto, 0, 0, 0, 0, progress2, "OutBack") posx = (x/2)-(x3/2) posy = (y/2)-(y3/2) dxDrawRectangle ( posx, posy, x3, y3, tocolor ( 0, 0, 0, 200 ) ) end Que mas tengo que configurar para que se vea bien?
  11. Me sirvió , muchas gracias.
  12. No me funciono, gracias por responder . Lo veo bien lol. elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Everyone")) then cancelEvent() local lvl = getElementData(source, "level") local r, g, b = getPlayerNametagColor(source) local gang = exports.gang_system:getPlayerGang ( source ) or "N/A" outputChatBox( "#FFFFFF["..gang.."] " .. getPlayerName ( source ) ..":#FFFFFF " .. text, getRootElement(), r, g, b, true ) outputServerLog("CHAT: [user] " .. getPlayerName ( source ) .. ": " .. text) Sigue apareciendo None
  13. No me funciono, gracias por responder .
  14. Hola, estuve haciendo para que en el chat aparezca la gang que eres y funciona, el problema es que si no eres de una gang aparece [None] y yo quiero que no aparezca nada . elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Everyone")) then cancelEvent() local lvl = getElementData(source, "level") local r, g, b = getPlayerNametagColor(source) local gang = exports.gang_system:getPlayerGang ( source) outputChatBox( "#FFFFFF["..gang.."] " .. getPlayerName ( source ) ..":#FFFFFF " .. text, getRootElement(), r, g, b, true ) outputServerLog("CHAT: [user] " .. getPlayerName ( source ) .. ": " .. text)
  15. Hola. Bueno necesito que me ayuden a encontrar un script de un panel de que podías spawnear vehículos "raros", podías spawnear como un tiburón, vagones, carrito de supermercado, unas aviones raras, un submarino, etc... Yo antes lo tenia pero borre mi sv y lo perdí.
  16. Problema solucionado. No se como pero esta arreglado .
  17. No, no toque nada, y probe con uno modificado por mi que solo cambiaba el mensaje al kickear y tampoco anduvo.
  18. Hola desde ayer que reinicie mi sv el admin panel no busca mas resources, ya reinstale mta y sigue el error. En la consola me pone esto cuando voy a la pestaña Resources : ERROR: admin\server\admin_serverprefs.lua:88: admin\server\admin_settings.lua:33: bad argument #1 to 'sub' (string expected, got table)
  19. Hola, como andan? Bueno mi problema es el siguiente, le puse una fuente propia al resource drawyourlevel pero al momento de subir de nivel la fuente de la exp requerida se quita. function dxsetText ( ) local text = "" local UP = tonumber ( getElementData ( localPlayer, "level" ) ) or 0 if ( UP == 1 ) then text = " /60" elseif ( UP == 2 ) then text = " /100" elseif ( UP == 3 ) then text = " /150" elseif ( UP == 4 ) then text = " /200" elseif ( UP == 5 ) then text = " /2000" elseif ( UP == 6 ) then text = " /10000" elseif ( UP == 7 ) then text = " /4000" elseif ( UP == 8 ) then text = " /8000" elseif ( UP == 9 ) then text = " /12000" elseif ( UP == 10 ) then text = " /16000" elseif ( UP == 11 ) then text = " /20000" elseif ( UP == 12 ) then text = " /24000" elseif ( UP == 13 ) then text = " /28000" elseif ( UP == 14 ) then text = " 32000" elseif ( UP == 15 ) then text = " /36000" elseif ( UP == 16 ) then text = " /40000" elseif ( UP == 17 ) then text = " /44000" elseif ( UP == 18 ) then text = " /48000" elseif ( UP == 19 ) then text = " /52000" elseif ( UP == 20 ) then text = " /56000" elseif ( UP == 21 ) then text = " /66000" elseif ( UP == 22 ) then text = " /78000" elseif ( UP == 23 ) then text = " /87000" elseif ( UP == 24 ) then text = " /99000" elseif ( UP == 25 ) then text = " /110000" elseif ( UP == 26 ) then text = " /119000" elseif ( UP == 27 ) then text = " /127000" elseif ( UP == 28 ) then text = " /139000" elseif ( UP == 29 ) then text = " /148000" elseif ( UP == 30 ) then text = " /156000" elseif ( UP == 31 ) then text = " /166000" elseif ( UP == 32 ) then text = " /179000" elseif ( UP == 33 ) then text = " /187000" elseif ( UP == 34 ) then text = " /198000" elseif ( UP == 35 ) then text = " /209000" end if isElement(GUIEditor_Label[5]) then destroyElement(GUIEditor_Label[5]) end GUIEditor_Label[5] = guiCreateLabel(1150, 394, 100, 25,text,false) guiSetFont ( GUIEditor_Label[5], "default-bold-small" ) expfont = guiCreateFont("CFJacquesParizeau-Regular.ttf",15) --Font guiSetFont( GUIEditor_Label[5], expfont ) end addEventHandler ( "onClientResourceStart", resourceRoot, dxsetText ) addEventHandler ( "onClientElementDataChange", localPlayer, function ( dataName ) if ( dataName == "level" ) then dxsetText ( ) end end ) Yo creo que es por el destroyElement(GUIEditor_Label[5]), pero si lo quito se ponen mal los números al subir de nivel. Tambien intente usar getLevelData para que directamente muestre la experiencia requerida en un label como el nivel y la exp ganada pero no me salio.
  20. Ahora lo voy a probar hacer, cuando hice el post no tenia ni idea de lo que me habías dicho
×
×
  • Create New...