Jump to content

Narutimmy

Members
  • Posts

    1,004
  • Joined

  • Last visited

Everything posted by Narutimmy

  1. amm si osea las colpshare tienen una data que es "tent" y quiero que todas las colpshare con esa data dentro de un area sean afectadas, el area la creo asi : local Area = createColCuboid(2040.0518798828,2354.2321777344,0, 155, 90, 200) ----x,y,z,ancho,largo,altura
  2. en minversion puse "1.5.1-9.07742.0" y me daba el error que te comento, con 1.5 y 1.5.1 todo bien
  3. Hola buenas estoy haciendo un script sencillo para limitar el numero de tents en una area pero no me funciona hasta donde las cuenta en general funciona pero cuando uso para comprobar si esta dentro del area me da 0 addEventHandler('onColShapeHit', Area, function (pHitElement) Tents = 0 LimitCOL = 20 for _,col in ipairs(getElementsByType("colshape")) do tnt = getElementData(col, "tent") if tnt then if isElement(col) then Tents = Tents+1 end end end if ( getElementData ( pHitElement , "gang" ) == GangLider ) then outputChatBox("Numero de Tents: "..Tents.."/"..LimitCOL, pHitElement, 255, 0, 0) end if Tents >= LimitCOL then ----destroyElement (getElementData(col, "parent")) end end) PD: estoy seguro que el area si existe
  4. Formato: 1.5.1-9.0rev.0 rev lo remplazas por la revision que quieras, puedes ver los ultimos aqui https://buildinfo.mtasa.com/index.php?Branch=1.5 Para la ultima revision: 1.5.1-9.07742.0 No me funciono si pongo eso da error dice que para entrar debo actualizar y al darle actualizar dice que no se encuentra.
  5. Me podrian ayudar con el script que publique?
  6. se supone si es limitada creo pero segun el provedor no llega al limite, con ayuda de ciber pudimos optimizarlo algo ya que gran problema era que en ahorro de banda ancha lo tenia en maximo, lo baje a ninguno y mejoro la conexion, aonque igual se satura con mas de 100 users.
  7. Hola buenas a todos, bueno sucede que tengo una idea quiero hacer una ruleta estilo CS Go, supongo la mayoria lo conoce, consiste en abrir 1 caja y sale una pantalla en la que salen la imagen de las posibles por ejemplo 10 cosas que salen en esa caja.... se mueven al azar las imagenes y se elige una, y esa imagen coincide con el premio, yo se hacerlo por medio de tablas que te de un arma al azar por ejemplo pero me gustaria hacerlo mas al estilo cs go. (min 0:55)
  8. Narutimmy

    Skin en DayZ

    Creo que no entendiste lo que pregunté, pero no importa pues ya lo resolví. Ahi una tabla para las skins que estan inventario, o puedes setearlo con elementdata con "skin" .
  9. Y si hay algun genio que lo pulsa 8000 veces?, creo que mi metodo es mas efectivo so algo asi pense ya que 1 no pasa mucho pero si varios se agarran a refresh.... explota el vps EDIT: De echo lo habia echo de esta forma: players = { } --SERVER function top(source) for i, account in ipairs ( getAccounts( ) ) do table.insert (players,{element = getAccountName(account),kills = getAccountData ( account, "TK" ) or 0,deaths = getAccountData ( account, "TD" ) or 0, gang = getAccountData ( account, "gang" ) or "None"} ) end table.sort (players,function ( a, b ) return ( tonumber ( a.kills ) or 0 ) > ( tonumber ( b.kills ) or 0 ) end) local time = getRealTime() local hours = time.hour local minutes = time.minute local dia = time.monthday local mes = time.month local ano = time.year-100 FechaUpdate = "["..dia.."/"..mes.."/"..ano.."] - "..hours..":"..minutes ----outputChatBox(players[1].element, source, 255, 0, 0) end
  10. No lose por eso lo publique , ese es el resource completo de la nada comienza ese problema tengo meses sin editar el resource, y de hace 2 dias comenzo a pasar esto. y pasa cada nose 3h por ejemplo , durante unos 30mins o mas.... este mismo error una y otra vez
  11. Hola tengo este sistema de grupos pero tengo un problema no lo e editado en los ultimos meses y ase unso 2 dias ahi un bug algo raro, de la nada comienza a hacer algun proceso infinito, me tira el mensaje de abortado, pero mientras lo aborta ya me subio a 100% CPU, y eso lo hace por ratos cada 30seg aprox ... Server: ------------------------------------------------------------------------------------ -- PROJECT: N/A -- RIGHTS: All rights reserved by developers -- FILE: groupSystem/group.slua -- DEVELOPER: Sebbe (Smart) ------------------------------------------------------------------------------------ local groupTable = {} local logging = false -- Set this to false if you don't want group stuff to be logged in your server.log local debugInfo = false -- Set this to false if you don't want to see see group logs in your debug mode. local GAC = {} -- index = account (string), [1] = group name, [2] = rank, [3] = warning level, [4] = date Joined, [5] = last time online (Not Available) local users = {} local myGang = {} local char = "[^0-9a-zA-Z_]" local rankCache = {} local db = dbConnect("sqlite", "group/database.db") dbExec(db, "CREATE TABLE IF NOT EXISTS groupmember (account TEXT, groupName TEXT, rank TEXT, warningLvl TEXT, joined TEXT, lastTime TEXT)") dbExec(db, "CREATE TABLE IF NOT EXISTS groups (name TEXT, leader TEXT, message TEXT, chatcolor TEXT, notecolor TEXT, date TEXT, turfcolor TEXT, cashflow TEXT)") dbExec(db, "CREATE TABLE IF NOT EXISTS groupRanks (groupName TEXT, name TEXT, permissions TEXT)") dbExec(db, "CREATE TABLE IF NOT EXISTS groupVault (groupName TEXT, leader TEXT)") playerTeam = createTeam("Player") --Some misc functions _outputDebugString = outputDebugString function outputDebugString(string) if (debugInfo) then _outputDebugString(string) end end function getTheTime() local time = getRealTime() local date = string.format("%02d/%02d/%02d", time.monthday, (time.month+1), (time.year-100) ) local time = string.format("%02d:%02d", time.hour, time.minute) return date, time end MTAoutput = outputChatBox function outputChatBox(message, player, r, g, b, bool) if (isElement(message) and getElementType(message) == "player") then MTAoutput(player, message, r, g, b, bool) else MTAoutput(message, player, r, g, b, bool) end end function groupLog(group, message) if (logging) then outputServerLog("GROUP: "..group.." - "..message) end --[[ if (debugInfo) then outputDebugString("GROUP: "..group.." - "..message) end ]] end --Lets start local permToTable = { [1] = "invite", [2] = "promote", [3] = "demote", [4] = "kick", [5] = "warn", [6] = "delete", [7] = "deposit", [8] = "withdraw", [9] = "editInfo", [10] = "viewLog", [11] = "viewBlacklist", [12] = "addBlacklist", [13] = "modifyAlliance", [14] = "modifyRanks", } function GetAccount(plr) if (plr and isElement(plr)) then return getAccountName(getPlayerAccount(plr)) end end function loadGroupRanks(query) local the_table = dbPoll(query, 0) if (the_table) then for ind, data in pairs(the_table) do if (not rankCache[data.groupName]) then rankCache[data.groupName] = {} end if (not rankCache[data.groupName][data.name]) then rankCache[data.groupName][data.name] = {} end local JSONtable = fromJSON(data.permissions) for ind, value in pairs(JSONtable) do if (value and ind) then rankCache[data.groupName][data.name][ind] = true end end end end end dbQuery(loadGroupRanks, db, "SELECT * FROM groupRanks") function loadGroupStuff(query) local g_table = dbPoll(query, 0) if (not g_table) then return end for ind, data in ipairs(g_table) do groupTable[data.name] = {data.leader, data.message, data.chatcolor, data.notecolor, data.date, data.turfcolor, data.cashflow} end end dbQuery(loadGroupStuff, db, "SELECT * FROM groups") function loadClientGroup(query) local g_table = dbPoll(query, 0) if (not g_table) then return end for ind, data in ipairs(g_table) do if (getAccount(data.account)) then local player = getAccountPlayer(getAccount(data.account)) users[data.groupName] = {} table.insert(users[data.groupName], data.account) if (player) then setElementData(player, "gang", data.groupName) myGang[player] = data.groupName end GAC[data.account] = {data.groupName, data.rank, data.warningLvl, data.joined, data.lastTime or 0} end end end dbQuery(loadClientGroup, db, "SELECT * FROM groupmember") function addRank(group, rank, permissionTable) if (not rankCache[group]) then rankCache[group] = {} end --rankCache[group][rank] = {fromJSON(permissionTable)} dbExec(db, "INSERT INTO groupRanks VALUES (?, ?, ?)", tostring(group), tostring(rank), permissionTable) dbQuery(loadGroupRanks, db, "SELECT * FROM groupRanks") end function removeRank(group, rank) if (not rankCache[group]) then return true end if (rankCache[group][rank]) then rankCache[group][rank] = nil dbExec(db, "DELETE FROM groupRanks WHERE name=? AND groupName=?", tostring(rank), tostring(group)) dbQuery(loadGroupRanks, db, "SELECT * FROM groupRanks") return true end end function isRank(group, rank) if (not rankCache[group]) then return false end return rankCache[group][rank] end function groupMemberLogin() if (GAC[GetAccount(source)]) then myGang[source] = GAC[GetAccount(source)][1] setElementData(source, "gang", GAC[GetAccount(source)][1]) setPlayerTeam(source,playerTeam) local date, time = getTheTime() local date = date.." - "..time GAC[GetAccount(source)][5] = date end end addEventHandler("onPlayerLogin", root, groupMemberLogin) function groupMemberQuit() if (GAC[GetAccount(source)]) then local date, time = getTheTime() local date = date.." - "..time GAC[GetAccount(source)][5] = date end end addEventHandler("onPlayerQuit", root, groupMemberQuit) function getGroupMembers(group) local temp = {} for ind, data in pairs(users) do if (ind == group) then table.insert(temp, data[1]) end end return temp end function getPlayerGroup(player) if (not GAC[GetAccount(player)]) then return false end return GAC[GetAccount(player)][1] end function getPlayerGroupRank(player) if (not GAC[GetAccount(player)]) then return false end return GAC[GetAccount(player)][2] end function getPlayerWarningLevel(player) if (not GAC[GetAccount(player)]) then return false end return GAC[GetAccount(player)][3] end function getGroupBankAmount(group) if (not groupTable[group]) then return end return groupTable[group][7] end function getPlayerJoinDate(player) if (not GAC[GetAccount(player)]) then return false end return GAC[GetAccount(player)][4] end function getHexCode(r, g, b) if (r and g and b) then return string.format("#%.2X%.2X%.2X", r, g, b) end end function getGroupChatColor(group) if (not groupTable[group]) then return 255, 255, 255 end local color = fromJSON(groupTable[group][3]) return color[1], color[2], color[3] end function getGroupTurfColor(group) if (not groupTable[group]) then return 255, 255, 255 end local color = fromJSON(groupTable[group][6]) return color[1], color[2], color[3] end function outputGroupMessage(message, group) for ind, data in pairs(GAC) do if (data[1] == group) then local acc = getAccount(ind) if (getAccountPlayer(acc)) then local color = fromJSON(groupTable[group][3]) local hex = getHexCode(color[1], color[2], color[3]) outputChatBox("[CAMP] "..message, getAccountPlayer(acc), 9,249,17, true) groupLog(group, message) end end end end function checkGroupAccess(player, actionID) local rank = getPlayerGroupRank(player) local group = getPlayerGroup(player) if (not rankCache[group]) then return false end if (rankCache[group] and rankCache[group][rank]) then if (tostring(actionID)) then for ind, data in pairs(permToTable) do if (data == actionID) then actionID = ind break end
  12. de echo si lo pense, ya le usado, pero no me funciona en server solo client..
  13. El problema es que intento hacer un top score all time.... entonces ahi muchos que ya no juegan pero son lugar 1 o 2... y la idea es que otros intenten superarlos. Lo otro que pensaba parecido a lo que me dijistes que al iniciar el server me genere la tabla y todo hastas ahi bien, y luego solicitar esa tabla desde el cliente.
  14. hola, bueno estoy haciendo un resource una lista de jugadores el problema es que mi internal pesa unos 400mb, entonces al generar la lista o mas bien al objetener a los jugadores registrados da un lag por unos 10segundos aprox.... en cambio si lo ago en una internal de 2 o 3 cuentas es al instante, como podria optimizarlo?
  15. Espero y eso sea, tengo 2 dias aprox usandolo asi y ya no he tenido ese problema, ayer jugue aprox 10h, en mi servidor y ni una vez me paso.
  16. Bueno hace tiempo me pasaron el fix que era el bug se daba porque en las posiciones regresaba NaN, entonces el fix era poner en bone_attach_c.lua esto : if (not tonumber(tostring(objx)) or not tonumber(tostring(objy)) or not tonumber(tostring(objz))) then return end if (not tonumber(tostring(offrx)) or not tonumber(tostring(offry)) or not tonumber(tostring(offrz))) then return end Pero ese es el que hace que se despegue del cuerpo cada tanto al regresarle NaN y no ser un numero. tons lo cambie a algo mas sencillo... offrx,offry,offrz = getEulerAnglesFromMatrix(txx,txy,txz,tyx,tyy,tyz,tzx,tzy,tzz) if (tonumber(tostring(objx)) or tonumber(tostring(objy)) or tonumber(tostring(objz))) then setElementPosition(element,objx,objy,objz) end if ( tonumber(tostring(offrx)) or tonumber(tostring(offry)) or tonumber(tostring(offrz))) then setElementRotation(element,offrx,offry,offrz,"ZXY") end y Listo se Arreglo, o almenos eso creo no e visto mas ese bug. Creo el problema era por el "return " no estoy seguro . Agan la Prueba y me dicen si ayude en algo ^^
  17. Hola buenas a todos vengo con un problema o duda.... pasa que tengo un VPS en NFO muy bien el host, pero nose si es problema de ellos o de mi configuracion del mtaserver , ya que no me da el bando de ancha para 100 jugadores, el consumo de ram y CPU todo bien ni un 40% del VPS, pero si por ejemplo tengo 100 jugadores conectados y yo activo un resource de nose 5mb? bueno a nose... 60 de 100 jugadores les carga como si nada, a 30 se les lagea y les descarga muy lento o mas bien sale la barra de carga pero no carga hasta que los primeros 60 ayan terminado, y a los 10 restantes les suele dar timeout y ya cuando todos terminaron ellos descargan. Esto mismo afecta al lag del server o mas bien a la sync a la hora de haber varios usuarios o PVP, ahi mucha desincronizacion.... que podria ser? Esto es lo que muestra el VPS
  18. Hola buenas, necesito ayuda porque yam e canso este resource, todo bien se pegan las cosas al ped, pero cuando vas traquilo caminando o lo que sea cada... nose 5mins? o menos las cosas se despegan y quedan flotando en el aire por unos 10seg aprox, pasado eso se vuelven a pegar a la persona a la que estaban. Tengo el bone attach parcheado que me pasaron aqui hace tiempo pero nose como arreglar eso :I PD: No da error en debug ni nada. attached_ped = {} attached_bone = {} attached_x = {} attached_y = {} attached_z = {} attached_rx = {} attached_ry = {} attached_rz = {} function attachElementToBone(element,ped,bone,x,y,z,rx,ry,rz) if not (isElement(element) and isElement(ped)) then return false end if getElementType(ped) ~= "ped" and getElementType(ped) ~= "player" then return false end bone = tonumber(bone) if not bone or bone < 1 or bone > 20 then return false end x,y,z,rx,ry,rz = tonumber(x) or 0,tonumber(y) or 0,tonumber(z) or 0,tonumber(rx) or 0,tonumber(ry) or 0,tonumber(rz) or 0 attached_ped[element] = ped attached_bone[element] = bone attached_x[element] = x attached_y[element] = y attached_z[element] = z attached_rx[element] = rx attached_ry[element] = ry attached_rz[element] = rz if setElementCollisionsEnabled then setElementCollisionsEnabled(element,false) end if script_serverside then triggerClientEvent("boneAttach_attach",root,element,ped,bone,x,y,z,rx,ry,rz) end return true end function detachElementFromBone(element) if not element then return false end if not attached_ped[element] then return false end clearAttachmentData(element) if setElementCollisionsEnabled then setElementCollisionsEnabled(element,true) end if script_serverside then triggerClientEvent("boneAttach_detach",root,element) end return true end function isElementAttachedToBone(element) if not element then return false end return isElement(attached_ped[element]) end function getElementBoneAttachmentDetails(element) if not isElementAttachedToBone(element) then return false end return attached_ped[element],attached_bone[element], attached_x[element],attached_y[element],attached_z[element], attached_rx[element],attached_ry[element],attached_rz[element] end function setElementBonePositionOffset(element,x,y,z) local ped,bone,ox,oy,oz,rx,ry,rz = getElementBoneAttachmentDetails(element) if not ped then return false end return attachElementToBone(element,ped,bone,x,y,z,rx,ry,rz) end function setElementBoneRotationOffset(element,rx,ry,rz) local ped,bone,x,y,z,ox,oy,oz = getElementBoneAttachmentDetails(element) if not ped then return false end return attachElementToBone(element,ped,bone,x,y,z,rx,ry,rz) end if not script_serverside then function getBonePositionAndRotation(ped,bone) bone = tonumber(bone) if not bone or bone < 1 or bone > 20 then return false end if not isElement(ped) then return false end if getElementType(ped) ~= "player" and getElementType(ped) ~= "ped" then return false end if not isElementStreamedIn(ped) then return false end local x,y,z = getPedBonePosition(ped,bone_0[bone]) local rx,ry,rz = getEulerAnglesFromMatrix(getBoneMatrix(ped,bone)) return x,y,z,rx,ry,rz end end ------------------------------------ function clearAttachmentData(element) attached_ped[element] = nil attached_bone[element] = nil attached_x[element] = nil attached_y[element] = nil attached_z[element] = nil attached_rx[element] = nil attached_ry[element] = nil attached_rz[element] = nil end function forgetDestroyedElements() if not attached_ped[source] then return end clearAttachmentData(source) end addEventHandler(script_serverside and "onElementDestroy" or "onClientElementDestroy",root,forgetDestroyedElements) function forgetNonExistingPeds() local checkedcount = 0 while true do for element,ped in pairs(attached_ped) do if not isElement(ped) then clearAttachmentData(element) end checkedcount = checkedcount+1 if checkedcount >= 1000 then coroutine.yield() checkedcount = 0 end end coroutine.yield() end end clearing_nonexisting_peds = coroutine.create(forgetNonExistingPeds) setTimer(function() coroutine.resume(clearing_nonexisting_peds) end,1000,0) script_serverside = true data_sent = {} function sendAttachmentData() if data_sent[client] then return end triggerClientEvent(client,"boneAttach_sendAttachmentData",root, attached_ped, attached_bone, attached_x, attached_y, attached_z, attached_rx, attached_ry, attached_rz ) data_sent[client] = true end addEvent("boneAttach_requestAttachmentData",true) addEventHandler("boneAttach_requestAttachmentData",root,sendAttachmentData) function removeDataSentFlag() data_sent[source] = nil end addEventHandler("onPlayerQuit",root,removeDataSentFlag) function sendReadyMessage() triggerServerEvent("boneAttach_requestAttachmentData",root) end addEventHandler("onClientResourceStart",resourceRoot,sendReadyMessage) function getAttachmentData(ped,bone,x,y,z,rx,ry,rz) for element,att_ped in pairs(ped) do setElementCollisionsEnabled(element,false) attached_ped[element] = att_ped attached_bone[element] = bone[element] attached_x[element] = x[element] attached_y[element] = y[element] attached_z[element] = z[element] attached_rx[element] = rx[element] attached_ry[element] = ry[element] attached_rz[element] = rz[element] end end addEvent("boneAttach_sendAttachmentData",true) addEventHandler("boneAttach_sendAttachmentData",root,getAttachmentData) function initAttach() addEvent("boneAttach_attach",true) addEvent("boneAttach_detach",true) addEventHandler("boneAttach_attach",root,attachElementToBone) addEventHandler("boneAttach_detach",root,detachElementFromBone) end addEventHandler("onClientResourceStart",resourceRoot,initAttach) bone_0,bone_t,bone_f = {},{},{} bone_0[1],bone_t[1],bone_f[1] = 5,nil,6 --head bone_0[2],bone_t[2],bone_f[2] = 4,5,8 --neck bone_0[3],bone_t[3],bone_f[3] = 3,nil,31 --spine bone_0[4],bone_t[4],bone_f[4] = 1,2,3 --pelvis bone_0[5],bone_t[5],bone_f[5] = 4,32,5 --left clavicle bone_0[6],bone_t[6],bone_f[6] = 4,22,5 --right clavicle bone_0[7],bone_t[7],bone_f[7] = 32,33,34 --left shoulder bone_0[8],bone_t[8],bone_f[8] = 22,23,24 --right shoulder bone_0[9],bone_t[9],bone_f[9] = 33,34,32 --left elbow bone_0[10],bone_t[10],bone_f[10] = 23,24,22 --right elbow bone_0[11],bone_t[11],bone_f[11] = 34,35,36 --left hand bone_0[12],bone_t[12],bone_f[12] = 24,25,26 --right hand bone_0[13],bone_t[13],bone_f[13] = 41,42,43 --left hip bone_0[14],bone_t[14],bone_f[14] = 51,52,53 --right hip bone_0[15],bone_t[15],bone_f[15] = 42,43,44 --left knee bone_0[16],bone_t[16],bone_f[16] = 52,53,54 --right knee bone_0[17],bone_t[17],bone_f[17] = 43,42,44 --left ankle bone_0[18],bone_t[18],bone_f[18] = 53,52,54 --right angle bone_0[19],bone_t[19],bone_f[19] = 44,43,42 --left foot bone_0[20],bone_t[20],bone_f[20] = 54,53,52 --right foot function putAttachedElementsOnBones() for element,ped in pairs(attached_ped) do --setElementStreamable(ped,false) if not isElement(element) then clearAttachmentData(element) elseif isElementStreamedIn(ped) then local bone = attached_bone[element] local x,y,z = getPedBonePosition(ped,bone_0[bone]) local xx,xy,xz,yx,yy,yz,zx,zy,zz = getBoneMatrix(ped,bone) local offx,offy,offz = attached_x[element],attached_y[element],attached_z[element] local offrx,offry,offrz = attached_rx[element],attached_ry[element],attached_rz[element] local objx = x+offx*xx+offy*yx+offz*zx local objy = y+offx*xy+offy*yy+offz*zy local objz = z+offx*xz+offy*yz+offz*zz local rxx,rxy,rxz,ryx,ryy,ryz,rzx,rzy,rzz = getMatrixFromEulerAngles(offrx,offry,offrz) local txx = rxx*xx+rxy*yx+rxz*zx local txy = rxx*xy+rxy*yy+rxz*zy local txz = rxx*xz+rxy*yz+rxz*zz local tyx = ryx*xx+ryy*yx+ryz*zx local tyy = ryx*xy+ryy*yy+ryz*zy local tyz = ryx*xz+ryy*yz+ryz*zz local tzx = rzx*xx+rzy*yx+rzz*zx local tzy = rzx*xy+rzy*yy+rzz*zy local tzz = rzx*xz+rzy*yz+rzz*zz offrx,offry,offrz = getEulerAnglesFromMatrix(txx,txy,txz,tyx,tyy,tyz,tzx,tzy,tzz) if (not tonumber(tostring(objx)) or not tonumber(tostring(objy)) or not tonumber(tostring(objz))) then return end if (not tonumber(tostring(offrx)) or not tonumber(tostring(offry)) or not tonumber(tostring(offrz))) then return end setElementPosition(element,objx,objy,objz) setElementRotation(element,offrx,offry,offrz,"ZXY") else setElementPosition(element,getElementPosition(ped)) end end end addEventHandler("onClientPreRender",getRootElement(),putAttachedElementsOnBones) sx,sy,sz = 0,0,3 tx,ty,tz = 0,0,4 fx,fy,fz = 0,1,3 function getMatrixFromPoints(x,y,z,x3,y3,z3,x2,y2,z2) x3 = x3-x y3 = y3-y z3 = z3-z x2 = x2-x y2 = y2-y z2 = z2-z local x1 = y2*z3-z2*y3 local y1 = z2*x3-x2*z3 local z1 = x2*y3-y2*x3 x2 = y3*z1-z3*y1 y2 = z3*x1-x3*z1 z2 = x3*y1-y3*x1 local len1 = 1/math.sqrt(x1*x1+y1*y1+z1*z1) local len2 = 1/math.sqrt(x2*x2+y2*y2+z2*z2) local len3 = 1/math.sqrt(x3*x3+y3*y3+z3*z3) x1 = x1*len1 y1 = y1*len1 z1 = z1*len1 x2 = x2*len2 y2 = y2*len2 z2 = z2*len2 x3 = x3*len3 y3 = y3*len3 z3 = z3*len3 return x1,y1,z1,x2,y2,z2,x3,y3,z3 end function getEulerAnglesFromMatrix(x1,y1,z1,x2,y2,z2,x3,y3,z3) local nz1,nz2,nz3 nz3 = math.sqrt(x2*x2+y2*y2) nz1 = -x2*z2/nz3 nz2 = -y2*z2/nz3 local vx = nz1*x1+nz2*y1+nz3*z1 local vz = nz1*x3+nz2*y3+nz3*z3 return math.deg(math.asin(z2)),-math.deg(math.atan2(vx,vz)),-math.deg(math.atan2(x2,y2)) end function getMatrixFromEulerAngles(x,y,z) x,y,z = math.rad(x),math.rad(y),math.rad(z) local sinx,cosx,siny,cosy,sinz,cosz = math.sin(x),math.cos(x),math.sin(y),math.cos(y),math.sin(z),math.cos(z) return cosy*cosz-siny*sinx*sinz,cosy*sinz+siny*sinx*cosz,-siny*cosx, -cosx*sinz,cosx*cosz,sinx, siny*cosz+cosy*sinx*sinz,siny*sinz-cosy*sinx*cosz,cosy*cosx end function getPointInFrontOfPoint(x, y, z, rZ, dist) local offsetRot = math.rad(rZ) local vx = x + dist * math.cos(offsetRot) local vy = y + dist * math.sin(offsetRot) return vx, vy, z end function math.round(number, decimals, method) decimals = decimals or 0 local factor = 10 ^ decimals if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor else return tonumber(("%."..decimals.."f"):format(number)) end end if not script_serverside then function getBoneMatrix(ped,bone) local x,y,z,tx,ty,tz,fx,fy,fz x,y,z = getPedBonePosition(ped,bone_0[bone]) if bone == 1 then local x6,y6,z6 = getPedBonePosition(ped,6) local x7,y7,z7 = getPedBonePosition(ped,7) tx,ty,tz = (x6+x7)*0.5,(y6+y7)*0.5,(z6+z7)*0.5 elseif bone == 3 then local x21,y21,z21, x31,y31,z31 x21,y21,z21 = getPedBonePosition(ped,21) x31,y31,z31 = getPedBonePosition(ped,31) if math.round(x21, 2) == math.round(x31, 2) and math.round(y21, 2) == math.round(y31, 2) and math.round(z21, 2) == math.round(z31, 2) then x21,y21,z21 = getPedBonePosition(ped,21) local _,_,rZ = getElementRotation(ped) tx,ty,tz = getPointInFrontOfPoint(x21, y21, z21, rZ, 0.0001) else tx,ty,tz = (x21+x31)*0.5,(y21+y31)*0.5,(z21+z31)*0.5 end else tx,ty,tz = getPedBonePosition(ped,bone_t[bone]) end fx,fy,fz = getPedBonePosition(ped,bone_f[bone]) local xx,xy,xz,yx,yy,yz,zx,zy,zz = getMatrixFromPoints(x,y,z,tx,ty,tz,fx,fy,fz) if bone == 1 or bone == 3 then xx,xy,xz,yx,yy,yz = -yx,-yy,-yz,xx,xy,xz end return xx,xy,xz,yx,yy,yz,zx,zy,zz end end
  19. eso es lo que quiero editar, por ahora cree 10 variaciones standar, que seteo con un element data a cada skin.
  20. Hola gente, bueno algo sencillo, estoy haciendo un script para poner un gorro a un ped todo bien, el problema es que cada ped tiene el tamaño de la cabeza de diferente tamaño entonces no puedo ajustarlo a todos y cada uno de ellos porque tomaria mucho tiempo, tons me pregunto si ahi alguna forma de hacerlo relativo ya que unos tiene la cabeza mas chica o mas grande que otros.
  21. Lo que ha preguntado es juntar todas las funciones en el mismo archivo para tener un control mas organizado de las tablas, no habló en ningun momento de Cliente-Servidor para colocar Shared Puedes crear funciones que tengas en un solo script, y de esa forma, tienes 'todo en el msmo sitio' Si mas o menos era eso peor ya quedo , pasa que yo les ponia el "local" tons solo servian en 1...
  22. Hola tengo un resouce que tiene una table que necesito, pero el resouce esta dividio en mas o menos 15 scripts (Archivos) y esa table esta en 10 de 15.... entonces cuando quiero modificar la tabla debo modificarlas todas, me pregunto como puedo hacer para que solo sea 1 sola table y que afecte a todos los scripts del resource?
  23. GRACIAS A TODOS, por ayudarme el quem e sirvio fue el de Asus, ya termine el Resource
×
×
  • Create New...