Jump to content

Atouk

Members
  • Posts

    221
  • Joined

  • Last visited

Everything posted by Atouk

  1. Atouk

    SHA1 a hash

    Hola, basicamente quiero convertir la siguiente consulta sql: local info, error = exports.sql:query_assoc_single( "SELECT CONCAT(SHA1(CONCAT(username, '%s')),SHA1(CONCAT(salt, SHA1(CONCAT('%s',SHA1(CONCAT(salt, SHA1(CONCAT(username, SHA1(password)))))))))) AS token FROM wcf1_user WHERE `username` = '%s' AND password = SHA1(CONCAT(salt, SHA1(CONCAT(salt, '" .. hash("sha1", password) .. "'))))", getPlayerHash( source ), getPlayerHash( source ), username ) Entonces, en conclusión, necesitaría ayuda para convertir esa consulta para usar https://wiki.multitheftauto.com/wiki/Hash y no sha1
  2. Hola, ¿Qué tal?.. Resulta que tengo un problema con crear un personaje, para ser especifico en realidad, en una linea en concreto. Después de varios debugs, me encontré con que no puede entrar al elseif, no puede hacer ese insert into, hasta lo inserté manualmente con los mismos argumentos y todo okey.. Si alguien me puede ayudar sería muy feliz function createCharacter( player, name, edad, genero, color, nacionalidad ) if player and p[ player ].userID then if exports.sql:query_assoc_single( "SELECT characterID FROM characters WHERE characterName = '%s'", name ) then triggerClientEvent( player, "players:characterCreationResult", player, 1 ) elseif exports.sql:query_free( "INSERT INTO characters (characterName, userID, nacionalidad, edad, color, genero) VALUES ('%s', " .. p[ player ].userID .. ", '"..tostring(nacionalidad).."', "..tonumber(edad)..", "..tonumber(color)..", "..tonumber(genero)..")", name ) then updateCharacters( player ) triggerClientEvent( player, "players:characterCreationResult", player, 0 ) return true end end return false end --- Aquí la llamada a la función anterior ( ambas en serverside ) addEvent( "gui:createCharacter", true ) addEventHandler( "gui:createCharacter", root, function( name, edad, genero, color, nacionalidad ) if source == client and type( edad ) == 'number' and type( genero ) == 'number' and type( color ) == 'number' and type( nacionalidad ) == 'string' then local error = verifyCharacterName( name ) if not error then exports.players:createCharacter( source, name, edad, genero, color, nacionalidad ) end end end ) --- El triggserServerEvent de parte del client está todo okey, no creo que sea necesario ponerlo aquí
  3. Atouk

    Ayuda funcion

    Hola, necesito ayuda con una funcion... El problema es que quiero que tome el valor del handling actual y no el original.... Por ejemplo: si el hand actual es 5. Que tome el de 5 + el upgrade. No que tome el original de GTA SA. Aqui el script: addEventHandler("tuning->PerformanceUpgrade", root, function(vehicle, data) if vehicle then if data then local vehicleModel = getElementModel(vehicle) if not data[1][2] then -- Default upgrade for _, property in ipairs(data) do setVehicleHandling(vehicle, property[1], nil, false) end else for _, property in ipairs(data) do local defaultHandling = getOriginalHandling(vehicleModel)[property[1]] setVehicleHandling(vehicle, property[1], defaultHandling, false) setVehicleHandling(vehicle, property[1], defaultHandling + property[2], false) end end end end end)
  4. Atouk

    Ayuda urgente!

    Porfavor, alguien que me ayude
  5. Atouk

    Ayuda urgente!

    Hola, tengo un problema: bad argument #1 to 'ipairs (table expected, got nil) En la linea 34. Este es el código: weaponAmmoTable = { [".45ACP 7 Balas"] = {{"M1911", 22}}, ["9x19mm SD"] = {{"M9 SD", 23}}, [".357 Magnum"] = {{"Colt Python", 24}}, ["9x19mm PDW"] = {{"PDW", 28}}, ["9x19mm MP5"] = {{"MP5A5", 29}}, ["7.62x39mm 30 Balas"] = {{"AK-47", 30}}, ["30Rnd STANAG"] = {{"M4", 31}}, ["Cartuchos 1866"] = {{"Winchester 1866", 25}}, ["Cartuchos 2Rnd."] = {{"Escopeta Recortada", 26}}, ["Cartuchos 8Rnd."] = {{"M1014", 27}}, ["5Rnd. M24"] = {{"M24", 34}}, [".303 British"] = {{"Lee Enfield", 33}}, ["M136 Rocket"] = {{"Heat-Seeking RPG", 36}, {"M136 Rocket Launcher", 35}}, others = { {"Paracaidas", 46}, {"Granada Cegadora", 17}, {"M84 Frag.", 16}, {"Cuchillo de Caza", 4}, {"Hacha", 8}, {"Binoculares", 43}, {"Bate", 5}, {"Pala", 6}, {"Palo de Golf", 2} } } getWeaponAmmoTypeName = function(weaponName) for i,weaponData in ipairs(weaponAmmoTable.others) do if weaponName == weaponData[1] then return weaponData[1], weaponData[2] end end for i,weaponData in ipairs(weaponAmmoTable[".45ACP 7 Balas"]) do if weaponName == weaponData[1] then return ".45ACP 7 Balas", weaponData[2] end end for i,weaponData in ipairs(weaponAmmoTable["9x19mm SD"]) do if weaponName == weaponData[1] then return "9x19mm SD", weaponData[2] end end for i,weaponData in ipairs(weaponAmmoTable[".357 Magnum"]) do if weaponName == weaponData[1] then return ".357 Magnum", weaponData[2] end end for i,weaponData in ipairs(weaponAmmoTable["9x19mm PDW"]) do if weaponName == weaponData[1] then return "9x19mm PDW", weaponData[2] end end for i,weaponData in ipairs(weaponAmmoTable["9x19mm MP5"]) do if weaponName == weaponData[1] then return "9x19mm MP5", weaponData[2] end end for i,weaponData in ipairs(weaponAmmoTable["7.62x39mm 30 Balas"]) do if weaponName == weaponData[1] then return "7.62x39mm 30 Balas", weaponData[2] end end for i,weaponData in ipairs(weaponAmmoTable["30Rnd STANAG"]) do if weaponName == weaponData[1] then return "30Rnd STANAG", weaponData[2] end end for i,weaponData in ipairs(weaponAmmoTable["Cartuchos 1866"]) do if weaponName == weaponData[1] then return "Cartuchos 1866", weaponData[2] end end for i,weaponData in ipairs(weaponAmmoTable["Cartuchos 8Rnd."]) do if weaponName == weaponData[1] then return "Cartuchos 8Rnd.", weaponData[2] end end for i,weaponData in ipairs(weaponAmmoTable["Cartuchos 2Rnd."]) do if weaponName == weaponData[1] then return "Cartuchos 2Rnd.", weaponData[2] end end for i,weaponData in ipairs(weaponAmmoTable["5Rnd. M24"]) do if weaponName == weaponData[1] then return "5Rnd. M24", weaponData[2] end end for i,weaponData in ipairs(weaponAmmoTable[".303 British"]) do if weaponName == weaponData[1] then return ".303 British", weaponData[2] end end for i,weaponData in ipairs(weaponAmmoTable["M136 Rocket"]) do if weaponName == weaponData[1] then return "M136 Rocket", weaponData[2] end end end
  6. Puedes usar: onClientMouseEnter https://wiki.multitheftauto.com/wiki/OnClientMouseEnter
  7. Atouk

    movimiento

    Hola castaño, como estas?. Decime si te sirve asi.. objectiveDynamite = createObject( 1654, x, y, z+2, 1, 1, 1, true) function move() moveObject(objectiveDynamite , 10000000 , x, y, z+2) end setTimer( move, 50, 0 ) Muchas gracias!
  8. Disculpa solid, es que estuve de mi tia. Link: http://pastebin.com/1psXYeDk
  9. Cuando uso el If not compruebo que el jugador no tenga ese skin y luego compruebo si es admin, pero no se porque dice alexs que esta mal. PD: para darle color tenes que poner los codigos mas o menos asi: #FF0000Hola como estas #FFF000Todo bien?
  10. Porque no pruebas asi: function AdminSkin( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) local playerSkin = getPlayerSkin ( thePlayer ) if not ( playerSkin == 213 ) and isObjectInACLGroup ( "user."..accName, aclGetGroup ( "Admin" ) ) then setPlayerSkin( thePlayer, 217) outputChatBox("#FF00FFEl administrador "..getPlayerName( thePlayer ).." esta en servicios para ayudarles!", thePlayer) else outputChatBox( "Este comando es solo para admins o ya estas en duty.", thePlayer ) end end addCommandHandler( "aduty", AdminSkin )
  11. Hola gente, disculpen por molestar de nuevo pero con este ultimo error que sea de su ayuda para arreglarlo no molestare mas porque ya estara listito mi servidor. El error es este: Infinite/too long execution pickups.lua (global scope) - Aborting; infinite running script: --[[ #---------------------------------------------------------------# ----* DayZ MTA Script pickups.lua *---- ----* Esse Script foi Modificado por Maikao da mtaZ.wikiforum.net ----* Criadores: Mawrin -L- -ffs-sniper ----* Skype: Pergunta no Posto ipiranga ----* *---- #---------------------------------------------------------------# ]] local itemTable = { farm = { { "Wood Pile", 1463, 0.4, 0, 13 }, { "Bandage", 1578, 0.5, 0, 4 }, { "Water Bottle", 2683, 1, 0, 6 }, { "Pasta Can", 2770, 1, 0, 6 }, { "Beans Can", 2601, 1, 0, 6 }, { "Burger", 2768, 1, 0, 6 }, { "Empty Soda Cans", 2673, 0.5, 0, 12 }, { "Scruffy Burgers", 2675, 0.5, 0, 12 }, { "British Assault Pack", 2406, 1, 0, 2.5 }, { "Patrol Pack", 2407, 1, 0, 3.5 }, { "Vest Pouch Pack", 2408, 1, 0, 2.2 }, { "Soda Bottle", 2647, 1, 0, 9 }, { "Coca Cola", 2648, 1, 0, 9 }, { "Whiskey Bottle", 1487, 1, 0, 9 }, { "Pepsi", 1488, 1, 0, 9 }, { "Montadew Soda", 1489, 1, 0, 9 }, { "Frank & Beans Can", 2602, 1, 0, 6 }, { "Sardines Can", 2603, 1, 0, 6 }, { "Empty Jerry Can", 1650, 1, 0, 10 }, { "Hunting Knife", 335, 1, 90, 4 }, { "Box of Matches", 328, 0.4, 90, 8 }, { "Revolver", 348, 1, 90, 0.2 }, { "Morphine Auto-Injector", 1579, 1, 0, 4 }, { "Tent", 1279, 1, 0, 0.5 }, { "Makarov PM", 346, 1, 90, 4 }, { "Painkiller", 2709, 3, 0, 3.5 }, { "M14 AIM", 357, 1, 90, 0.3 }, { "Remigton 870", 349, 1, 90, 0.3 }, { "Tire", 1073, 1, 0, 2 }, { "Tank Parts", 1008, 1, 0.8, 2 }, { "Civilian Clothing", 1241, 2, 0, 2.5 }, { "Rebel Clothing", 1241, 2, 0, 2.5 }, { "Urban Clothing", 1241, 2, 0, 2.5 }, { "Civilian[F] Clothing", 1241, 2, 0, 2.5 }, { "Survivor[F] Clothing",
  12. --Defines theVehicle property = "maxVelocity" value = --- --- Aca pones el valor del a velocidad( minimo 0.1 maximo 200000.0 ) setVehicleHandling ( theVehicle, property, value ) Espero que te sirva!
  13. Che te vas a enojar conmigo si te insulto?, porque sos un verdadero ídolo para mi!, cambiaste un numero y listo. Otro mas que me hace feliz luego de tiempo un capo me arreglo el ultimo bug de mi server, Muchas gracias Cib3R!!!!! ÍDOLO!! Fuegos artificiales para vos!, fiuuu boom fiuuu boom
  14. Porfavor, si alguien tiene alguna idea que la poste, gracias..
  15. Disculpen comunidad por molestar de nuevo, pero tengo un problema medio grave que es no poder equipar armas de la tabla others, el error esta en la linea 39, argumento 2(ammoData). script: weaponAmmoTable = { ["Makarov Mag"] = {{"Makarov PM", 22}}, ["M9SD Mag"] = {{"M9 SD", 23}}, [".45 ACP"] = {{"Revolver", 24}}, ["PDW Mag"] = {{"PDW", 28}}, ["MP5 Mag"] = {{"MP5A5", 29}}, ["30Rnd. AK"] = {{"AKS-74 Kobra", 30}}, ["30Rnd. STANAG"] = {{"M4A1 CCO", 31}}, ["8Rnd. Slugs"] = {{"Remington 870", 25}}, ["2Rnd. Slug"] = {{"Sawn-Off Shotgun", 26}}, ["SPAZ-12 Pellet"] = {{"SPAZ-12 Combat Shotgun", 27}}, ["DMR Mag"] = {{"DMR", 34}}, ["5Rnd. M24"] = {{"M14 AIM", 33}}, ["M136 Rocket"] = {{"Heat-Seeking RPG", 36},{"M136 Rocket Launcher", 35}}, ["others"] = {{"Parachute", 46},{"Satchel", 39},{"Tear Gas", 17},{"M67 Frag Grenade", 16},{"Hunting Knife", 4},{"Machete", 8},{"Binoculars", 43},{"Baseball Bat", 5},{"Hatchet", 2},{"Shovel", 6},{"Crowbar", 7}} } function getWeaponAmmoType ( weaponName ) for i, weaponData in ipairs ( weaponAmmoTable.others ) do if ( weaponName == weaponData [ 2 ] ) then return weaponData [ 1 ], weaponData [ 2 ] end end local ammoName, id = false, false for ammo, data in pairs ( weaponAmmoTable ) do if ( data [ 1 ] [ 1 ] == weaponName ) then ammoName, id = ammo, data [ 1 ] [ 2 ] break end end return ammoName, id end function rearmPlayerWeapon(weaponName, slot) takeAllWeapons(source) local ammoData, weapID = getWeaponAmmoType(weaponName) if getElementData(source, ammoData) <= 0 then triggerClientEvent(source, "displayClientInfo", source, "Rearm", shownInfos.nomag, 255, 22, 0) return end setElementData(source, "currentweapon_" .. slot, weaponName) local weapon = getElementData(source, "currentweapon_1") if weapon then local ammoData, weapID = getWeaponAmmoType(weapon) giveWeapon(source, weapID, getElementData(source, ammoData), true) triggerClientEvent( source, "playSoundEquipPrimary", source ) end local weapon = getElementData(source, "currentweapon_2") if weapon then local ammoData, weapID = getWeaponAmmoType(weapon) giveWeapon(source, weapID, getElementData(source, ammoData), false) triggerClientEvent( source, "playSoundEquipSecondary", source ) end local weapon = getElementData(source, "currentweapon_3") if weapon then local ammoData, weapID = getWeaponAmmoType(weapon) giveWeapon(source, weapID, getElementData(source, ammoData), false) triggerClientEvent( source, "playSoundEquipSpecial", source ) end if elementWeaponBack[source] then detachElementFromBone(elementWeaponBack[source]) destroyElement(elementWeaponBack[source]) elementWeaponBack[source] = false end setElementModel(source, getElementData(source, "skin")) end addEvent("onPlayerRearmWeapon", true) addEventHandler("onPlayerRearmWeapon", getRootElement(), rearmPlayerWeapon)
  16. Atouk

    [Ayuda]Nil Value

    Gracias a todos gente, nunca dejan de sorprenderme!
  17. Atouk

    [Ayuda]Nil Value

    Ahh disculpa getWeaponDamage es esta funcion: function getWeaponDamage(weapon) for i, weapon2 in ipairs(damageTable) do local t, weapon1 = getWeaponAmmoType(weapon2[1]) if weapon1 == weapon then if getElementData(getLocalPlayer(), "humanity") == 5000 and (weapon2[1] == "Makarov PM" or weapon2[1] == "M9 SD" or weapon2[1] == "PDW") then return weapon2[2] * 0.3 end return weapon2[2] end end end EDIT: Ciber estan bien los ends
  18. Hola gente, como estan?. Tengo un problema en mi server de DayZ que las armas NO DAÑAN! El problema es este: attempt to perform arhimeon global 'damage' ( a nil value ) Este es la funcion( linea 48 ): function playerGetDamageDayZ(attacker, weapon, bodypart, loss) cancelEvent() damage = 100 headshot = false if weapon == 37 then return end if getElementData(attacker, "zombie") then setElementData(getLocalPlayer(), "blood", getElementData(getLocalPlayer(), "blood") - gameplayVariables.zombiedamage) local number = math.random(1, 7) if number == 4 then setElementData(getLocalPlayer(), "bleeding", getElementData(getLocalPlayer(), "bleeding") + math.floor(loss * 10)) end end if weapon == 49 then if loss > 30 then setElementData(getLocalPlayer(), "brokenbone", true) playSound( 'sounds/brokenbone.mp3' ) setControlState("jump", true) setElementData(getLocalPlayer(), "blood", getElementData(getLocalPlayer(), "blood") - math.floor(loss * 10)) end setElementData(getLocalPlayer(), "blood", getElementData(getLocalPlayer(), "blood") - math.floor(loss * 5)) elseif weapon == 63 or weapon == 51 or weapon == 19 then setElementData(getLocalPlayer(), "blood", 0) if getElementData(getLocalPlayer(), "blood") <= 0 and not getElementData(getLocalPlayer(), "isDead") == true then triggerServerEvent("kilLDayZPlayer", getLocalPlayer(), attacker, headshot) end elseif weapon and weapon > 1 and attacker and getElementType(attacker) == "player" then do local number = math.random(1, -- s8) --> if number >= 6 or number <= 8 then setElementData(getLocalPlayer(), "bleeding", getElementData(getLocalPlayer(), "bleeding") + math.floor(loss * 10)) end local number = math.random(1, 7) if number == 2 then setElementData(getLocalPlayer(), "pain", true) end damage = getWeaponDamage(weapon) if bodypart == 9 then damage = damage * 1.5 headshot = true end if bodypart == 7 or bodypart == 8 then setElementData(getLocalPlayer(), "brokenbone", true) playSound( 'sounds/brokenbone.mp3' ) end playRandomHitSound() setElementData(getLocalPlayer(), "blood", getElementData(getLocalPlayer(), "blood") - math.random(damage * 0.75, damage * 1.25)) if not getElementData(getLocalPlayer(), "bandit") then setElementData(attacker, "humanity", getElementData(attacker, "humanity") - math.random(40, 200)) if 0 > getElementData(attacker, "humanity") then setElementData(attacker, "bandit", true) end else setElementData(attacker, "humanity", getElementData(attacker, "humanity") + math.random(40, 200)) if getElementData(attacker, "humanity") > 5000 then setElementData(attacker, "humanity", 5000) end if getElementData(attacker, "humanity") > 2000 then setElementData(attacker, "bandit", false) end end if getElementData(getLocalPlayer(), "blood") <= 0 and not getElementData(getLocalPlayer(), "isDead") then triggerServerEvent("kilLDayZPlayer", getLocalPlayer(), attacker, headshot, getWeaponNameFromID(weapon)) setElementData(getLocalPlayer(), "isDead", true) end end elseif weapon == 54 or weapon == 63 or weapon == 49 or weapon == 51 then setElementData(getLocalPlayer(), "blood", getElementData(getLocalPlayer(), "blood") - math.random(100, 1000)) local number = math.random(1, 5) if loss > 30 then setElementData(getLocalPlayer(), "brokenbone", true) playSound( 'sounds/brokenbone.mp3' ) setControlState("jump", true) end if loss >= 100 then setElementData(getLocalPlayer(), "blood", 49) setElementData(getLocalPlayer(), "bleeding", 50) end local number = math.random(1, 11) if number == 3 then setElementData(getLocalPlayer(), "pain", true) end if getElementData(getLocalPlayer(), "blood") <= 0 and not getElementData(getLocalPlayer(), "isDead") == true then triggerServerEvent("kilLDayZPlayer", getLocalPlayer(), attacker, headshot, getWeaponNameFromID(weapon)) setElementData(getLocalPlayer(), "isDead", true) end end end addEventHandler("onClientPlayerDamage", getLocalPlayer(), playerGetDamageDayZ) Espero respuestas, gracias!
  19. Naaa que proo, anduvo. Yo te juro que cuando la equipe y anduvo sonreí y dije, ' Que pedazo de Grozo ', Muchisimas gracias a todos y en especial avos castillo
  20. La cagaste ahora dice esto: attempt to index local 'weaponData' ( a number value )
  21. El nil debe ser el ammo, y por eso no te la equipa.
  22. No, me equipe la M4A1 CCO y el 2do argumento me dice nil, osea dice: M4A1; nil
  23. Dice nil cuando me equipo el arma, nose si te dice algo jaja
×
×
  • Create New...