Jump to content

aka Blue

Members
  • Posts

    2,106
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by aka Blue

  1. Como pone en el título, estoy buscando algún script de primera persona adaptado para usar en vehículo. ¿Alguien sabe dónde puedo encontrarlo? Gracias de antemano!
  2. Hi, do you have this font @Dzsozi? I was searching for it but is so expensive.
  3. @Marx_404 No estaría mal abrir un Roleplay ahora, ya que hay 2 servidores contados y de ambos mucha gente se ha ido buscando algo mejor o algo innovador. Usando la base de Paradise puedes crear cosas chulas, el tema es que ahora mismo nadie se quiere poner a crear un servidor. La verdad, llevo tiempo esperando un DayZ Roleplay o algo parecido. Creo que un servidor así llegaría bastante lejos dependiendo de cómo se lleve. Eso sí, si esperas una media de usuarios de 100 o 200 diarios y activos, la verdad, no creo que MTA sea el lugar apropiado.
  4. @.:CiBeR:. Sí, ha servido, gracias Ciber! Ahora mi duda es, para cargar los datos y crear los vehículos, hay que hacer ésto, no? addEventHandler( "onResourceStart", resourceRoot, function( ) checkCreate = dbQuery ( vehDB , "CREATE TABLE IF NOT EXISTS vehicles (id INTEGER PRIMARY KEY,model TEXT,owner TEXT,x TEXT,y, TEXT,z TEXT)" ) local result = dbPoll( checkCreate, -1 ) if result and #result > 0 then for i=1, #result do local id, model, owner, x, y, z = result[i][1], result[i][2], result[i][3], result[i][4], result[i][5], result[i][6] veh[id] = createVehicle( model, tonumber( x ), tonumber( y ), tonumber( z ) ) vehID[ veh[id] ] = id end end end ) Gracias por la ayuda!
  5. Vale, ahora tengo un problema. Lo que quiero hacer es hacer una especie de ID para un vehículo y guardarlo en la base de datos SQLite. Tengo esto actualmente pero no sé como hacer que al crear el vehículo se almacene la ID correctamente. ¿Alguna ayuda? local a_veh = { } local vehDB = dbConnect( "sqlite", "databaseVehs.db" ) local veh = { } local vehID = { } addEventHandler( "onResourceStart", resourceRoot, function( ) local checkCreate = dbQuery ( vehDB , "CREATE TABLE IF NOT EXISTS vehicles (id TEXT,model TEXT,owner TEXT)" ) end ) addCommandHandler( "cveh", function( player, _, car ) local veh = getVehicleModelFromName( car ) if veh then local acc = getAccountName( getPlayerAccount( player ) ) if acc then local qh = dbQuery ( connection , "INSERT INTO vehicles (model,owner) VALUES (?,?)", car , acc ) local result, _, id = dbPoll ( qh, -1 ) if result then outputChatBox( "Vehículo insertado en la base de datos, id: "..tonumber( id ) ) else outputChatBox( "?", player, 255, 0, 0 ) end else outputChatBox( "?", player, 255, 0, 0 ) end end end )
  6. @.:CiBeR:. Muchas gracias Ciber, lo testearé mas tarde
  7. Because you use a player argument but its not defined. ¿Understand?. When you trigger to server, take sure you send the getLocalPlayer in the server too, something like this, see: -- Client triggerServerEvent( "m4", resourceRoot, getLocalPlayer( ) ) -- Server addEvent( "m4", true ) addEventHandler( "m4", root, function ( player ) local p_coins = exports.coinsystem:getPlayerCoin(player) if tonumber( p_coins ) >= 400 then giveWeapon(player, 31, 2000) exports.coinsystem:takePlayerCoin(player, 400) outputChatBox("you bought a M4.", player, 0, 255, 0, false) else outputChatBox("you don't have enough coins!", player, 255, 0, 0, false) end end )
  8. Uou get this error because the Export, returns nil. So you can try this: function buyWeapon( player, command ) local p_coins = exports.coinsystem:getPlayerCoin( player ) if tonumber( p_coins ) >= 1 then giveWeapon(player, 31, 2000) exports.coinsystem:takePlayerCoin(player, prize) outputChatBox("you bought a M4.", player, 0, 255, 0, false) else outputChatBox("you don't have enough coins!", player, 255, 0, 0, false) end end
  9. Buenas. La GM de Paradise tiene la opción de devolver la ID la cual corresponde a x dato insertado en una base de datos. Me gustaría saber cómo obtener este dato usando funciones SQLite. local vehicleID, error = exports.sql:query_insertid( "INSERT INTO vehicles (model, posX, posY, posZ, rotX, rotY, rotZ, numberplate, color1, color2, respawnPosX, respawnPosY, respawnPosZ, respawnRotX, respawnRotY, respawnRotZ, interior, dimension, respawnInterior, respawnDimension) VALUES (" .. table.concat( { model, x, y, z, 0, 0, rz, '"%s"', color1, color2, x, y, z, 0, 0, rz, getElementInterior( player ), getElementDimension( player ), getElementInterior( player ), getElementDimension( player ) }, ", " ) .. ")", getVehiclePlateText( vehicle ) ) Gracias de antemano.
  10. @saygoodbye Gracias, me ha servido! El problema es que no se coloca exactamente en el centro pero igualmente, gracias por tu ayuda, me ayudará a crear paneles con más rapidez.
  11. @Hit+ Gracias pero el tema está en que yo quiero utilizar los algoritmos que he usado hasta ahora. El problema si no me equivoco del tuyo es que no se adapta a todas las resoluciones y eso es un problema
  12. Search the colt texture and try to remplace it. Now that i think, its not possible. You need to create a colt object in the ped's hand and change the texture.
  13. Buenas. Desde hace mucho tiempo llevo usando mi método para el dibujado de ventanas/imágenes/textos y líneas DX. Quisiera saber si hay alguna forma de centrarlo, ya sea multiplicando o dividiendo por algún número ya que, manual lleva un tiempo y no siempre queda correctamente. Este es el método que uso: local sx, sy = guiGetScreenSize( ) local sourceX, sourceY = 1336, 768 dxDrawRectangle( sx*( 20/sourceY ), sy*( 200/sourceY ), sx*( 150/sourceX ), sy*( 200/sourceY ), tocolor( ... ) )
  14. @Avagard I dont try it but i think is possible, replacing the colt/uzi/mp4 texture...
  15. I dont test it buy, i think it should work shader.fx file // Variable to fetch the texture from the script texture gTexture; // My nice technique. Requires absolutely no tools, worries nor skills technique TexReplace { pass P0 { // Set the texture Texture[0] = gTexture; // LET THE MAGIC DO ITS MAGIC! } } client.lua file local texture = dxCreateTexture( "lapd.png" ) -- Here you add the path of the edited .png file of the police addCommandHandler( "jacket", function( cmd ) local shader = dxCreateShader( "shader.fx", 0, 0, true, "ped" ) -- We load the shader (or create) setElementModel( localPlayer, 280 ) -- We add the police clothes to the player engineApplyShaderToWorldTexture( shader, "lapd1", localPlayer ) -- We apply the shader to the model dxSetShaderValue( shader, "gTexture", texture ) -- We apply the texture to the shader outputChatBox( "¡Hi! You set the jacket to the officer" ) end ) And here you have the script with the meta, etc. http://www74.zippyshare.com/v/WWBHahoV/file.html Hope i help you!
  16. @Tomas Podría venirme bien también, gracias Tomas!
  17. Para no crear otro tema. ¿Se podría hacer pero con el nivel de vida, etc? Me vendría bastante bien. Gracias!
  18. @MickeyPoo This is the .png file of the .txd file. All you need to do is export this image from the edited skin of the police and make it work with shaders in MTA. If you bring me that .png image of the edited police i will make it for you for free
  19. INFORMACIÓN Bueno, como dice el título, ahora que tengo un tiempo libre me gustaría realizar un servicio de scripts económicos por 3$ máximo por script. Incluyo GUI si es necesario. El único método de pago que acepto actualmente es PayPal y el contacto por aquí por el foro mediante MP o mensaje privado. Haré solo los scripts que puedan tener ese precio normalmente. Ejemplo: Sistema de vestir a CJ Sistema de logueo Sistema de selección de skin Sistema de noticias mediante GUI Sistema de agenda para RP con guardado SQL (?) Gente seria, por favor. Gracias por la atención!
  20. Thanks so much for sharing this. It's going to help me a lot!
  21. Nuevo script: 25/04/2017 Este script de nametags al estilo SA:MP cuenta con una barra de vida y barra de chaleco indicando el nivel de cada uno de los estados. Se puede modificar a vuestro gusto. Se añade el nametag únicamente si el jugador está logueado, esto se puede editar también: SERVER-SIDE addEventHandler( "onPlayerQuit", getRootElement( ), function( ) triggerClientEvent( root, "nmtgs:removePlayer", root, source ) end ) addEventHandler( "onPlayerLogout", getRootElement( ), function( ) triggerClientEvent( root, "nmtgs:removePlayer", root, source ) end ) addEventHandler( "onPlayerLogin", getRootElement( ), function( ) triggerClientEvent( root, "nmtgs:addPlayer", root, source ) end ) CLIENT-SIDE local players = { } addEvent( "nmtgs:addPlayer", true ) addEventHandler( "nmtgs:addPlayer", getRootElement( ), function( player ) players[ player ] = player end ) addEvent( "nmtgs:removePlayer", true ) addEventHandler( "nmtgs:removePlayer", getRootElement( ), function( player ) if players[ player ] then players[ player ] = nil end end ) addEventHandler( "onClientRender", root, function() local cx, cy, cz = getCameraMatrix() local lx, ly, lz = getElementPosition( localPlayer ) local jugadores = getElementsByType( "player" ) for i=1, #jugadores do local p = jugadores[i] if players[ p ] then local x, y, z = getElementPosition( p ) local dist = getDistanceBetweenPoints3D( lx, ly, lz, x, y, z ) if dist < 15 then if isLineOfSightClear( lx, ly, lz, x, y, z, true, false, false, true, false, false, false, localPlayer ) then local name = getPlayerName( p ) local bone = { getPedBonePosition( p, 5 ) } local c = { getScreenFromWorldPosition( bone[1], bone[2], bone[3]+0.3 ) } local width, health = 80, getElementHealth( p ) local armor = getPedArmor( p ) if c[1] and c[2] then dxDrawText(name, c[1], c[2]-38, c[1], c[2], tocolor( 0, 0, 0 ), 1.5, "default-bold", "center", "center") dxDrawText(name, c[1], c[2]-40, c[1], c[2], tocolor( 255, 255, 255 ), 1.5, "default-bold", "center", "center") dxDrawRectangle( c[ 1 ] - ( width / 1.90 ), c[ 2 ] - 4, width+3, 11, tocolor( 0, 0, 0, 255 ) ) dxDrawRectangle( c[ 1 ] - ( width / 2 ), c[ 2 ] - 2.3, width, 8, tocolor( 150, 0, 0, 255 ) ) dxDrawRectangle( c[ 1 ] - ( width / 2 ), c[ 2 ] - 2.3, width * ( health / 100 ), 8, tocolor( 255, 0, 0, 255 ) ) if armor and tonumber( armor ) > 0 then dxDrawRectangle( c[ 1 ] - ( width / 1.90 ), c[ 2 ] + 10, width+3, 11, tocolor( 0, 0, 0, 255 ) ) dxDrawRectangle( c[ 1 ] - ( width / 2 ), c[ 2 ] + 11.3, width, 8, tocolor( 150, 150, 150, 150 ) ) dxDrawRectangle( c[ 1 ] - ( width / 2 ), c[ 2 ] + 11.3, width * ( armor / 100 ), 8, tocolor( 255, 255, 255, 255 ) ) end end end end end end end ) IMÁGENES
  22. Gracias @danibayez, justamente lo que quería hacer!
  23. Buenas tardes. Estoy creando un pequeño sistema de nametags y me gustaría saber como es que podría dibujar una barra de vida usando las coordenadas que me ofrece la función getScreenFromWorldPosition Actualmente tengo ésto: local font = dxCreateFont( "Font.otf", 15 ) addEventHandler( "onClientRender", root, function() local cx, cy, cz = getCameraMatrix() local lx, ly, lz = getElementPosition( localPlayer ) local jugadores = getElementsByType( "player" ) for i=1, #jugadores do local p = jugadores[i] --if players[ p ] then local x, y, z = getElementPosition( p ) local dist = getDistanceBetweenPoints3D( lx, ly, lz, x, y, z ) if dist < 15 then if isLineOfSightClear( lx, ly, lz, x, y, z, true, false, false, true, false, false, false, localPlayer ) then local name = getPlayerName( p ) local bone = { getPedBonePosition( p, 5 ) } local c = { getScreenFromWorldPosition( bone[1], bone[2], bone[3]+0.3 ) } local r, g, b = getPlayerNametagColor ( p ) --local puntos = getElementData( p, "puntos" ) or 0 --local health = getElementHealth( p ) if c[1] and c[2] then dxDrawText(name, c[1], c[2]-38, c[1], c[2], tocolor( 0, 0, 0 ), 1.5, "default-bold", "center", "center") dxDrawText(name, c[1], c[2]-40, c[1], c[2], tocolor( 255, 255, 255 ), 1.5, "default-bold", "center", "center") if getElementData( p, "adminduty" ) == true then dxDrawImage( c[1], c[2]+22, 20, 20, "staff.png", 0, 0, 0, tocolor( 0, 0, 0 ) ) dxDrawImage( c[1], c[2]+20, 20, 20, "staff.png", 0, 0, 0, tocolor( 255, 145, 0 ) ) end end end end --end end end ) Gracias de antemano!
×
×
  • Create New...