Jump to content

Ernoso

Members
  • Posts

    8
  • Joined

  • Last visited

About Ernoso

  • Birthday 29/03/1998

Details

  • Gang
    EvoRust
  • Location
    Belo Horizonte, Brazil
  • Occupation
    Scripter
  • Interests
    Women

Recent Profile Visitors

798 profile views

Ernoso's Achievements

Newbie

Newbie (4/54)

0

Reputation

  1. Hey, guys! I need some help, please! I have a Rust server for MTA:SA, but there is lagging FPS a lot for all players and I think bone attach is the problem cause a lot of errors are appearing on debugscript like dup1055x Errors: http://prnt.sc/drdrf8 (IT DOESN'T STOP, IT'S LIKE A INFINITE LOOP!) This is my bone_attach_c file 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 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",root,putAttachedElementsOnBones) Please, help!!!
  2. Still not working, the message doesn't appears on the chat...
  3. Hello, guys! I have a simple problem in my groupsystem, there is a problem sending messages on teamsay, I'm trying to use cancelEvent and outputChatBox but the message doesn't appears on the chat, look at my function: function getPlayersInsideGroup (group) for i, allplayers in ipairs(getElementsByType("player")) do local pedGang = getElementData(allplayers,"Group") local theGang = group if ( pedGang == theGang ) then playersInside = allplayers return playersInside end end end function playerSentGroupMsg (message, messageType) cancelEvent() if ( messageType == 2 ) then if ( getElementData(source,"Group") ) then local grupinhdd = getElementData(source,"Group") local jogadores = getPlayersInsideGroup(grupinhdd) outputChatBox("[Group]"..getPlayerName(source)..": "..message,jogadores,0,255,0) end end end addEventHandler("onPlayerChat", getRootElement(), playerSentGroupMsg) The message doesn't appears on the chat and there is no erros on console or debugscript, any help?
  4. Thank you all guys! it's working now, sorry if i'm kinda late.
  5. Hi, I need some help here... well.. I simple script that saves what a col has and how many it has. local tentItensTable = { {"Assault Rifle"}, {"Motorcycle"}, } for i, data in ipairs(tentItensTable) do itens = getElementData(thecol,data[1]) end --[[ saving line --]] dbExec(thedatabase, "INSERT INTO bau_obj VALUES (?,?,?,?,?,?,?,?,?)", numeros, modelo, x, y, z, rx, ry, rz, itens) --[[ saving line --]] The "itens" will save how many items the col has that is inside the "tentItensTable", but it's not saving! it's saving everything, but it's not saving the items... Can you guys help me? Like: Item: Assault Rifle / Amount: 20
  6. Thank you, it's working now! I removed the createPostos() function from the timer and instead added a setElementData function! and I also changed the number 1 to 0 in the timer. This is how it looks now : function createPostos () for i,postos in ipairs(posicoesPostos) do local x,y,z = postos[1],postos[2],postos[3] postosCol = createColSphere(x,y,z,3) setElementData(postosCol,"postogasosa",true) setElementData(postosCol,"gasosanoposto",100) local patrolTime = setTimer( function() for i, postosdestruir in ipairs(getElementsByType("colshape")) do if getElementData(postosdestruir,"postogasosa") then setElementData(postosdestruir,"gasosanoposto",100) --instead of destroy all patrol colshapes, it just set to 100 the fuel again! outputServerLog("[Rust]: Patrolpoints respawned succesfully!") --just a warning on console end end end,5400000,0) --new time and 0 instead of 1 end end createPostos() --create patrolpoints on server start Thank you, Dealman!
  7. Hello, I need some help here! I'm making a new gamemode for a server, but there is an error that's appearing and it's making ' Network Trouble ', it's like a infinite error! This is what appears at console: logs.txt [2016-11-17 13:06:50] WARNING: Long execution (rustgamemode) [2016-11-17 13:06:51] WARNING: [rust]\rustgamemode\vehicles_System.lua:120: Bad argument @ 'setElementData' [Expected element at argument 1, got nil] [2016-11-17 13:06:51] WARNING: [rust]\rustgamemode\vehicles_System.lua:121: Bad argument @ 'setElementData' [Expected element at argument 1, got nil] and then the same errors appears again, it's like infinite ultil I shutdown the server. And there is the ' vehicles_System.lua (server-side)' file where the error appears : function createPostos () for i,postos in ipairs(posicoesPostos) do local x,y,z = postos[1],postos[2],postos[3] postosCol = createColSphere(x,y,z,3) setElementData(postosCol,"postogasosa",true) setElementData(postosCol,"gasosanoposto",100) local patrolTime = setTimer( function() for i, postosdestruir in ipairs(getElementsByType("colshape")) do if getElementData(postosdestruir,"postogasosa") then destroyElement(postosdestruir) createPostos() --respawn patrolstation (give them 100 fuel again) else -- end end end,3600000,1) --1 hour 'till respawn fuel again end end createPostos() --make the patrolstation colshape and give them 100 fuel Can you guys help me with this issue? I don't know how to fix it. Sorry for my bad english! hehe
×
×
  • Create New...