Jump to content

Pirulax

Discord Moderators
  • Posts

    403
  • Joined

  • Last visited

Everything posted by Pirulax

  1. Yeah, this is when you are tired.....Thanks a lot Very amateur mistake by me. Dropped you a like (Reputation)
  2. Did i forgot to mention, that i added them?Yeah, i added them. <function export="addLog" type="server" /> <function export="saveLog" type="server" /> <function export="createLog" type="server" /> I tried to use the function from server.
  3. Okey, so i have made a script, a logging script, it logs litterally everything, and has 3 exported functions, they are used to create log files, but for some reason, when i want to call them from a separate script using call function["exports.*"] it just throws me an error.["failed to call 'fall_log:createLog'"].I can use the functions in the same script["fall_log"], but cant use somewhere else, for example in "fall_admin-system", indicating, that the script in "fall_log" works correctly, so any ideas?Here's my call[every argument is valid, and not not, if it matters.]: exports.fall_log:createLog("This is a test","fall_admin/log.json") I still dont rly want to give out the script for fall_log, but if i really need, then okey.
  4. Just think about it, why would server stream the music?The the function should be a shared function, not a client-only function.
  5. No.. I have a tuning-system, and i want to disable nitro recharging, so, i dont want infitenitro
  6. Hello, im wondering, is there any function to disable nitro-recharging?I made a nitro script, but it recharges the nitro..
  7. I think the Title says it all. What dxSetRenderTarget() is used for?And could you give me some example other than on the wiki?
  8. No, you misunderstand me, he had a resource called mtd_database, this is where he called dbConnectionm and then, he just exported the getConnection() function,it worked totally fine, but then he got this warning, do you understand me now?
  9. So, friend of mine got this error: Picture He was like: dbConnection was in use, this is why it happened, but i was like: thats impossible, so this is why i ask you guys. btw: This is just a question, and i dont need a script-fix for is, just an answer about it.Thx in advance.
  10. Solved the problem, placed the event into another res., isnt the best solution at all, but works
  11. It should work just perfectly, because with other commands it work. but, i'll take a look at the function Same. @NeXuS™
  12. but if i comment out the 7. line it doesnt throw any error. local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(sourcePlayer, playername) Yeah, im sure. @NeXuS™
  13. @NeXuS™ [string "?"]:34: attempt to call global 'type'(a number value) as it stays in the title.Im not totally sure, because that "34" is not the actual line where the error is, in the original script its a blank line.
  14. Okey, i have made this small function: addEvent("onClientWantToExecuteCommandHandler",true) addEventHandler("onClientWantToExecuteCommandHandler",resourceRoot,function(playername, item,value,count,source) if (getElementData(source,"acc:admin") or 0 >= 6) then local sourcePlayer = source local rovid = "#398FB1[GreenStone - Inventory] #ffffff" if id and item and value and count and source then local targetPlayer, targetPlayerName = exports.mta_main:findPlayer(sourcePlayer, playername) if targetPlayer then if giveItem(targetPlayer, tonumber(item), tostring(value), tonumber(count), 0) then -- 0 -> dutyitem if not (source==targetPlayer) then outputChatBox(rovid.. " Adott egy itemet neked: #43cd80".. getElementData(playerSource,"char:anick") .."#ffffff (" ..exports["mta_item2"]:getItemName(tonumber(item))..")", targetPlayer,255,255,255,true) end outputChatBox(rovid.. " Adtál egy itemet neki: #43cd80".. targetPlayerName:gsub("_", " ") .."#ffffff (" ..exports["mta_item2"]:getItemName(tonumber(item))..")", source,255,255,255,true) dbExec(con, adminlog, getElementData(playerSource, "char:anick"), getElementData(playerSource, "acc:id"), "GIVEITEM", getElementData(playerSource, "char:anick") .. " adott " .. count .. " db " .. exports["mta_item2"]:getItemName(tonumber(item)) .. " -t. Érték: " .. value .. "", getPlayerName(targetPlayer), getElementData(targetPlayer, "acc:id")) exports.mta_admin:outputAdminMessage("#43cd80" .. getElementData(playerSource, "char:anick") .. "#ffffff adott " .. count .. " darab " .. exports["mta_item2"]:getItemName(tonumber(item)) .. " -t #43cd80" .. targetPlayerName .. "#ffffff játékosnak.") else outputChatBox("#43cd80[" .. serverName .. " #43cd80- Inventory]: #ffffffNem fér el több tárgy az adott játékosnál!", playerSource, 255 ,255, 255, true) end end end end end) Its throwing the error on the line 7, but i dont know why...
  15. Would be useful for making repair scripts which hold the component in hand.
  16. The question is the same as the title: how to get width and height of a vehicle component?I dont think that there is any way to do it.
  17. I think, that there is some way to calculate it, image it: the getElementPosition(veh) returns the center of the veh, getVehicleComponentPosition(veh,part,"world") returns where to component is, then in theoretically you should be able to calculate them within the script. @NeXuS™ World positions solved. local cX,cY,cZ = getVehicleComponentPosition(veh,comp,"world") local pX,pY,pZ = getElementPosition(player) local offsetX,offsetY,offsetZ = (pX-cX),(pY-cY),(pZ-cZ) I'll solve rotations somehow. Edit: didnt solved.. forgot to use the calculated values in the attach function.
  18. are you sure about that? https://wiki.multitheftauto.com/wiki/Element You are right in some way, bcuz if you give the weapon to the player, then its only a texture.
  19. Just messed up the boneAttach. Okey, i will solve rotations somehow, but i still need to calculate X,Y,Z positions, and thats my biggest problem, by the way, if you want we can talk in hungarian,but only in PM.((Nem akarom hogy áthelyezzék a magyar Szekcióba.)) @NeXuS™
  20. Pirulax

    Streaming

    triggerClientEvent triggerServerEvent Tables. This is what you need.I have one script like you need, here it is: --clienet local lines = {} addEventHandler("onClientResourceStart",resourceRoot,function() setElementData(localPlayer, "endpos",Vector3(getElementPosition(localPlayer))) lines[localPlayer] = {} lines[localPlayer][1] = {Vector3(getElementPosition(localPlayer)),Vector3(getElementPosition(localPlayer))} local x,y = getScreenFromWorldPosition(2796.6591796875 ,-695.8740234375 ,57.99556350708) local browser = guiCreateBrowser(x,y,1000,1000,true,false,false) addEventHandler("onClientPreRender",root,function() local x,y,z = getElementPosition(localPlayer) for kk,vv in pairs(lines) do for k,v in pairs(vv) do if v[2] == 1 then v[2] = Vector3(getElementPosition(kk)) end if not v[2] or not v[1] then break end if not texture then break end if not getElementData(localPlayer,"showlines") then return end dxDrawLine3D(v[1],v[2],tocolor(170,170,170,255),1500) end end end) for k,v in pairs({"w","a","s","d"}) do bindKey(v,"down",function() setElementData(localPlayer, "startpos",Vector3(getElementPosition(localPlayer))) local index = #lines[localPlayer]+1 lines[localPlayer][index] = {getElementData(localPlayer, "endpos"),1} setElementData(localPlayer, "lastindex",index) if getElementData(localPlayer, "syncLINE") then local x,y,z = getElementData(localPlayer, "endpos"):getX(),getElementData(localPlayer, "endpos"):getY(),getElementData(localPlayer, "endpos"):getZ() local trigged = triggerServerEvent("syncLinesS",resourceRoot,localPlayer,index,x,y,z,1) end end) bindKey(v,"up",function() setElementData(localPlayer, "endpos",Vector3(getElementPosition(localPlayer))) local index = getElementData(localPlayer, "lastindex") lines[localPlayer][index] = { lines[localPlayer][index][1], Vector3(getElementPosition(localPlayer))} if getElementData(localPlayer, "syncLINE") then local x,y,z = getElementPosition(localPlayer) local x1,y1,z1 = lines[localPlayer][index][1]:getX(),lines[localPlayer][index][1]:getY(),lines[localPlayer][index][1]:getZ() local trigged = triggerServerEvent("syncLinesS",resourceRoot,localPlayer,index,x,y,z,x1,y1,z1) end end) end end) addCommandHandler("showlines",function() setElementData(localPlayer,"showlines",not getElementData(localPlayer,"showlines")) outputChatBox(" Vonalak mutatása " .. tostring(getElementData(localPlayer,"showlines"))) end,false) addCommandHandler("lines",function() setElementData(localPlayer,"syncLINE",not getElementData(localPlayer,"syncLINE")) outputChatBox(" sync state " .. tostring(getElementData(localPlayer,"syncLINE"))) end,false) addEvent("snycLinesCC",true) addEventHandler("snycLinesCC",getLocalPlayer(),function(p,index,x,y,z,xx,yy,zz) if p == localPlayer then return end if not lines[p] then lines[p] = {} end if xx == 1 and not yy and not zz then nd = 1 else nd = Vector3(xx,yy,zz) end lines[p][index] = {Vector3(x,y,z),nd} end) --server addEvent("syncLinesS",true) addEventHandler("syncLinesS",resourceRoot,function(p,index,x,y,z,xx,yy,zz) triggerClientEvent(root,"snycLinesCC",root,p,index,x,y,z,xx,yy,zz) end) when you start-up the script use /showlinesto enable drawing of the lines, and use / lines to enalbe syncing to other players.
  21. Okey, so im currently working on a repair script for my server, until this point everything worked, but now i need to calculate some offsets(world offset, and rotation offset too), and i have no idea how to do it.So, the basic idea is to hold every demounted component like this.Heres the script i made. --CLIENT SIDE local r = { ["door_lf_dummy"] = {90,0,-90}, ["door_rf_dummy"] = {90,0,-90}, ["door_lr_dummy"] = {90,0,-90}, ["door_rr_dummy"] = {90,0,-90}, } addEvent("addVehComponentToPlayer",true) function funkzson(veh,comp,player) setTimer(function() local rotx,roty,rotz = getElementRotation(player) setElementRotation(veh,rotx,rotx,rotz) for k in pairs(getVehicleComponents(veh)) do if not (k==comp) then setVehicleComponentVisible(veh,k,false) end end local cX,cY,cZ = getVehicleComponentPosition(veh,comp,"world") local vX,vY,vZ = getElementPosition(veh) local offsetX,offsetY,offsetZ = (vX-cX),(vY-cY),(cZ-vZ) exports.bone_attach:attachElementToBone(veh,player,2,0,-0.4,-0.65,r[comp][1],r[comp][2],r[comp][3]) setPedAnimation(player,"carry","crry_prtial",0,false,false,false) end,50,1) end addEventHandler("addVehComponentToPlayer",getLocalPlayer(),funkzson) --SERVER SIDE addCommandHandler("setcompstate",function(source,_,comp) local x,y,z = getElementPosition(source) local veh = createVehicle(440,x,y,z,rotx,roty,rotz) setElementCollisionsEnabled(veh,false) setVehicleDamageProof(veh,true) setElementData(veh,"onlyfixveh",true) triggerClientEvent("addVehComponentToPlayer",root,veh,comp,source) end) Ignore that i attached the server side triggerClientEvent to a command, i made it like this only for testing purposes. btw, maybe i will post the full script as a community script.
  22. I dont think that i undestand you correctly, but try getScreenFromWorldPosition.
  23. setElementAlpha, since a weapon is an element. If i helped you, press like
×
×
  • Create New...