Jump to content

greentumbleweed

Members
  • Posts

    80
  • Joined

  • Last visited

Everything posted by greentumbleweed

  1. anyone ever find this game mode?
  2. Thank you very much this will help me do what im trying to do!
  3. How can i make this text fade and stack on each hit? function dxDrawDamageAttacker(weapon_damage,damage_resist) addEventHandler("onClientRender", root, function() local screenW, screenH = guiGetScreenSize() local dmgrec = dxDrawText("-"..math.floor(weapon_damage * damage_resist * randomFloat(0.70, 0.85)), screenW * 0.6062, screenH * 0.4208, screenW * 0.7520, screenH * 0.4313, tocolor(46, 196, 20, 255), 1.00, "default", "left", "top", false, false, false, true, false) end) end addEvent("drawDamageAttacker", true) addEventHandler ( "onClientRender", getRootElement(), dxDrawDamageAttacker ) addEventHandler("drawDamageAttacker", root, dxDrawDamageAttacker)
  4. I want to combine these two functions into one and use tables where i can, im horrible with tables if anyone can help local tt7 = {} addEventHandler("onClientResourceStart", resourceRoot, function () tt7.low = dxCreateTexture('shader/low/camonet_east_co.bmp',"dxt5",true) tt7.medium = dxCreateTexture('shader/medium/camonet_east_co.bmp',"dxt5",true) tt7.high = dxCreateTexture('shader/img/camonet_east_co.bmp',"dxt5",true) shader = dxCreateShader("shader/fx/shader.fx") end) local ammo = 'ammotrn92tarp128' addEventHandler('pp', root, function() local shader = dxCreateShader("shader/fx/shader.fx") if setting == 1 then terrain = tt7.low elseif setting == 2 then terrain = tt7.medium elseif setting == 3 then terrain = tt7.high end if terrain then dxSetShaderValue(shader, 'Tex0', terrain) engineApplyShaderToWorldTexture (shader,ammo) end end ) local tt8 = {} addEventHandler("onClientResourceStart", resourceRoot, function () tt8.low = dxCreateTexture('shader/low/mountchillad.jpg',"dxt5",true) tt8.medium = dxCreateTexture('shader/medium/mountchillad.jpg',"dxt5",true) tt8.high = dxCreateTexture('shader/img/mountchillad.jpg',"dxt5",true) shader = dxCreateShader("shader/fx/shader.fx") end) local mountchillad = {'rock_country128','sw_rockgrassb1lod','desclifftypebs','sw_rockgrassb1','rocktbrn128lod','rocktbrn128_lod','rocktbrn128','rocktbrn_dirt2','sw_rockgrass1','cw2_mountdirtscree','rocktq128',"sm_rock2_desert",'des_crackeddirt1','des_redrock1','des_redrock2','cw2_mountrock','cs_rockdetail2'} addEventHandler('pp', root, function() local shader = dxCreateShader("shader/fx/shader.fx") if setting == 1 then terrain = tt8.low elseif setting == 2 then terrain = tt8.medium elseif setting == 3 then terrain = tt8.high end if terrain then dxSetShaderValue(shader, 'Tex0', terrain) for i=1, #mountchillad do engineApplyShaderToWorldTexture(shader, mountchillad[i]) end end end )
  5. im not sure how to prevent the peds death from repating when player dies ped is spawned and the killer shoots the ped resulting in the ped dying over and over also turning the col into a zombie function kilLDayZPlayer(killer,headshot,weapon,bag) if getElementData (source, "isDead") then return end setElementData(source,"isDead",true) if getPedOccupiedVehicle ( source ) then removePedFromVehicle ( source ) end pedCol = false local account = getPlayerAccount(source) if not account then return end killPed(source) triggerClientEvent(source,"hideInventoryManual",source) if not isElementInWater(source) then local x,y,z = getElementPosition(source) if getDistanceBetweenPoints3D(x,y,z,6000,6000,0)> 200 then local x,y,z = getElementPosition(source) local rotX,rotY,rotZ = getElementRotation(source) local skin = getElementModel(source) local ped = createPed(skin,x,y,z,rotZ) --setPedStat(ped,"MAX_HEALTH",999999) triggerClientEvent("AddDeathPedClothes",source,ped,source) pedCol = createColSphere(x,y,z,1.5) setTimer(function() if headshot == true then setPedHeadless(ped, true) setPedAnimation(ped,"knife","KILL_Knife_Ped_Die",1600,false,false,false,true) elseif not headshot == true then setPedAnimation(ped,"PED","KO_shot_stom",1600,false,false,false,true) end end,50,1) setTimer(function() killPed(ped) end,200,1) setTimer(destroyDeadPlayer,1800000,1,ped,pedCol) attachElements(pedCol,ped,0,0,0) setElementData(pedCol,"parent",ped) setElementData(pedCol,"playername",getPlayerName(source)) setElementData(pedCol,"deadman",true) setElementData(pedCol,"MAX_Slots",getElementData(source,"MAX_Slots")) local time = getRealTime() local hours = time.hour local minutes = time.minute setElementData(pedCol,"deadreason",getPlayerName(source).." is dead. Killer: "..(getPlayerName(killer) or "Unknown")..". Time of death: "..hours..":"..minutes) end end if killer then if not getElementData(source,"bandit") then addPlayerStats(killer,"humanity",math.random(-2500,-1000)) else addPlayerStats(killer,"humanity",math.random(1000,2500)) end setElementData(killer,"murders",getElementData(killer,"murders")+ 1) if 0 > getElementData(killer,"humanity") then setElementData(killer,"bandit",true) end if getElementData(source,"bandit")== true then setElementData(killer,"banditskilled",getElementData(killer,"banditskilled")+ 1) end if headshot == true then setElementData(killer,"headshots",getElementData(killer,"headshots")+ 1) end end if pedCol then for i,data in ipairs(playerDataTable)do if tonumber(getElementData(source,data[1]))then setElementData(pedCol,data[1],getElementData(source,data[1])) end end if getActiveVest(source) and getElementData(source,"vestLife") == getVestLife(getActiveVest(source)) then setElementData(pedCol,getActiveVest(source),1) end if getActiveHelmet(source) and getElementData(source,"helmetLife") == getHelmetLife(getActiveHelmet(source)) then setElementData(pedCol,getActiveHelmet(source),1) end local skinID = getElementData(source,"skin") local skin = getSkinNameFromID(skinID) setElementData(pedCol,skin,1) local backpackSlots = getElementData(source,"MAX_Slots") backpackName = getBackpackName(backpackSlots) if backpackName then setElementData(pedCol,backpackName,1) end end setTimer(setElementPosition,50,1,source,6000,6000,0) triggerClientEvent(source,"refreshInventoryManual",source) for i,itemm in pairs(playerDataTable) do setElementData(source,itemm[1],itemm[2]) end triggerClientEvent(source,"onClientPlayerDeathInfo",source) setAccountData(account,"isDead",true) setElementData(source,"isDead",true) triggerClientEvent("onRollMessageStart",getRootElement(),"#FFFFFF"..getPlayerName(source).." #FFFFFFwas killed",0,22,255,"died") setTimer(spawnDayZPlayer,5000,1,source) end addEvent("kilLDayZPlayer",true) addEventHandler("kilLDayZPlayer",getRootElement(),kilLDayZPlayer)
  6. I'm want to make the function run with a loop for 3 possible weapons and only give/ take away 1 weapon at a time. but it removes primary weapon from back when i equip secondary or vise versa also only equips secondary when equiping any weapon. function rearmPlayerWeapon(weaponName,slot,slot1,slot2,slot3) takeAllWeapons(source) setElementData(source,"currentweapon_"..slot,weaponName) weapon = getElementData(source,"currentweapon_1") if weapon then for id,item in pairs(weaponTable)do if weapon == item[1] and getElementData(source,item[1])>= 1 and getElementData(source,item[2])>= 1 and item[5] == 1 then ammoData,weapID = getWeaponAmmoType(weapon) removeWeaponBack() giveWeapon(source,weapID,getElementData(source,ammoData),slot1) end end end weapon2 = getElementData(source,"currentweapon_2") if weapon2 then for id,item in pairs(weaponTable)do if weapon2 == item[1] and getElementData(source,item[1])>= 1 and ((getElementData(source,item[2]) and getElementData(source,item[2])>= 1) or item[2] == "others") and item[5] == 2 then ammoData2,weapID2 = getWeaponAmmoType(weapon2) removeWeaponBackSec() giveWeapon(source,weapID2,getElementData(source,ammoData2),slot2) end end end weapon3 = getElementData(source,"currentweapon_3") if weapon3 then for id,item in pairs(weaponTable)do if weapon3 == item[1] and getElementData(source,item[1])>= 1 and item[5] == 3 then ammoData3,weapID3 = getWeaponAmmoType(weapon3) removeWeaponBackSpe() giveWeapon(source,weapID3,getElementData(source,ammoData3),slot3) end end end triggerClientEvent(source,"refreshInventoryManual",source) end addEvent("onPlayerRearmWeapon",true) addEventHandler("onPlayerRearmWeapon",getRootElement(),rearmPlayerWeapon)
  7. i read the page for triggerClientEvent and seen the argument but i didnt realize you can just use a variable for that there thanks a lot
  8. im not sure how to do this i knew i had to use random.math on server but idk how to pass it
  9. client side function endVol() local position = guiScrollBarGetScrollPosition(Cock2)/100 local Number = math.random(1,37) muzik = playSound("sounds/"..tostring(Number)..".mp3") setSoundVolume(muzik, position) end addEvent("endvol",true) addEventHandler("endvol", getRootElement(), endVol) server side function muzikS( ) triggerClientEvent( source,"endvol", source ) end addEventHandler( "onRoundFinish", root, muzikS ) im trying to get the same random song to play on all clients this plays different per client
  10. it shows on players now but it only shows on whoever typed the cmd and takes it away from the last player
  11. im tryin to make it show on player's skin via texture name this is working, but its only client side others cant see unless they type /dvoid #number ect originally this script was for vehicles. When the player entered the vehicle it would update the clients to show their effect number on their car and other clients would see the effect and still see their own effect as well. basically i just want it to update all clients that whoever typed the cmd updated their effect and all clients will see. been trying to avoid doing server side because the script did not use server side scripting working just fine ill post the original if you want to see what it did before i screwed with it lol
  12. Im trying to set the shader to peds with setElementData and an id for the effect this works but only renders per client im trying to make it render the effect for all clients but only apply the effect to yourself and not others with effect active
  13. I'm not sure the math on this, but I'm trying to make the velocity not drain as fast. However this is making it continually gain speed. vV = "w" iK_v = 1.02 -- inertia power sK_t = 50 Xperimental = true local sorc = getLocalPlayer() addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function(resource) bindKey(vV, "both", _coref_) end ) function _coref_(key, state) local veh = getPedOccupiedVehicle(sorc) if (veh) then if (getVehicleController(veh) == sorc) then if key == vV then if state == "up" then if Xperimental then cT3 = getTickCount() end sT = setTimer(function() local xs, ys, zs = getElementVelocity(veh) setElementVelocity(veh, xs*iK_v, ys*iK_v, zs*iK_v) end, sK_t, 0) elseif state == "down" then return end killTimer(sT) end end end end end
  14. This is server side and it's never been tested. It's a frame work you can build off of. If you need help feel free to ask Also please put <oop>true</oop> in the meta.xml file local distanceFromDoor = 20 local key = 'L' local Doors = {} Doors.__index = Doors local collection = {} function Door.new(objectid, x, y, z, rx, ry, rz, locked) if objectid and x and y and z then local self = setmetatable({},Door) self.id = objectid self.position = Vector3( x, y, z ) self.rotation = Vector3 ( rx, ry, rz ) or Vector3 ( 0, 0, 0 ) self.locked = locked or false self.obj = Object( self.id, self.position, self.rotation ) collection[#collection+1] = self return self end end function doorToggle(door) door.locked = not door.locked end setTimer(function() for i=1,#collection do if collection[i].locked then setElementFrozen(collection[i].obj,true) else setElementFrozen(collection[i].obj,false) end for e, plr in pairs(getElementsByType('player')) do local distance = getDistanceBetweenPoints3D(plr.position, collection[i].position) if distance < distanceFromDoor then bindKey(plr, key, 'down', doorToggle, collection[i]) else unbindKey(plr, key, 'down' doorToggle, collection[i]) end end end end, 50, 0) Example: local mydoor = Door.new( 1499,0 , 0, 3 )-- create the door mydoor.locked = true-- lock the door mydoor.locked = false-- unlock the door
  15. Not sure why, but it doesn't load the grass texture when i call the directory outside of the function, everything else works just fine. im lost lol No errors either. dxSetShaderValue(shader, 'Tex0', terrain) this is where it should be applied but its not for some reason
  16. you can reduce resolution with: local scaleValue = screenY / devScreenY and it will all so reduce impact for lower end pc?
  17. presume i have 163 of these, some with smaller tables ect, functions: addEvent('pp',true) addEventHandler('pp', root, function() if setting == 1 then terrain = dxCreateTexture('shader/low/1.png',"dxt5",true) elseif setting == 2 then terrain = dxCreateTexture('shader/medium/1.png',"dxt5",true) elseif setting == 3 then terrain = dxCreateTexture('shader/img/1.png',"dxt5",true) end if terrain then shader = dxCreateShader("shader/fx/shader.fx") dxSetShaderValue(shader, 'Tex0', terrain) local grass = {'sw_sandlod','desstones_dirt1','desertgryard256','grasspatch_64hv','desertgryard256lod','grasstype5_4','desgrasandblend','desgrasandblend_lod','grasslod','redcliffroof_la','grasstype4','sw_sandgrasslod','sw_sand','whitesand_256','dirtblendlitlod','des_dirt2gygrasslod','brngrss2stonesb','lodslgrass01','des_grass2dirt1','des_grass2dirt1lod','des_scrub1lod','des_grass2scrublod','rocktbrn128bllod','des_dirt2lod','des_dirt2grasslod','desgrassbrnlod','des_dirt1lod','des_yelrocklod','golf_fairway2','grassgrn256','lodgrass_128hv','pavementhexagon','desgrassbrnsnd','forestfloor256','forestfloor256lod','forestfloor256mudblend','grasslong256','des_dirt2stones','hiwayinsideblend1_256','greyground2sand','grasstype4_staw','grassshort2long256','grassdeep256','grasstype3dirt','grassdeep256','grass_lawn_128hv','tenniscourt1_256','hiwayinsideblend2_256','hiwayblend1_256','desegravelgrassroadla','dirtblendlit','sl_sfngrssdrt01','sl_sfngrass01','golf_greengrass','golf_fairway3','golf_fairway1','golf_heavygrass','golf_hvygras_cpark','grass_dirt_64hv','pavebsandend','grass_dry_64hv','grassdeadbrn256','sjmlahus28','sjmscorclawn3','grasstype510','grasstype510_10','roadblend:O','brngrss2stones','grasstype4-3','grasstype3','grasstype5_desdirt','dirtkb_64hv','desertgryard256grs2','des_dirt2grass','des_dirt1','grass','des_dirt1_glfhvy','des_dirt1_grass','grass_128hv','ffbranch_mountdirt','desmud2forstfloor','forestfloorblend','cw2_mountdirt2forest','con2sand1b','con2sand1a','desgrassbrn_grn','des_dirt2gygrass','ws_traingravelblend','sw_sand','newcrop3','sjmscorclawn','dirtgaz64b','bow_church_grass_gen','grasstype10_4blend','desertstones256forestmix','grifnewtex1x_las','grassdry_128hv','grass4dirtytrans','hedge1','sw_grass01d','sfn_rockhole','sfncn_rockgrass3','sfn_grass1','des_dirtgrassmixbmp','grasstype4_forestblend','grasstype4_10','grasstype10','des_dirtgrassmix_grass4','grass4dirty','dt_road2grasstype4','bow_church_grass_alt','grasstype4blndtodirt','desgreengrass','yardgrass1', 'grassgrnbrn256', 'des_grass2scrub', 'des_scrub1_dirt1b', 'des_scrub1_dirt1a', 'vgs_rockbot1a', 'vgs_rockmid1a', 'des_ripplsand','des_dirtgravel','des_roadedge2','des_panelconc','des_oldrunwayblend','grasstype5','grasstype5_dirt','desgrassbrn','hiway2sand1a','hiwaygravel1_256','hiwaygravel1_lod','des_oldrunway','grass4_des_dirt2','forestfloorbranch256','forestfloor3','des_dirt2grgrass','forestfloor3_forest','forestfloor_sones256','sw_sandgrass','sw_sandgrass4','sw_rockgrassb2','des_dirt2 trackl','des_dirtgrassmixb','des_dirtgrassmixc','desertstones256grass','desmuddesgrsblend','hiwayinsideblend3_256','desgrassbrn_lod','des_scrub1_lod','desgreengrasslod','grasstype7','sandgrndlod','concretedust2_lod','bow_church_grass_lod','des_dirt1_lod','vgsecoast02_lod','vgsecoast05_lod','vgs_rockbot1a_lod','vgn_ground8_lod','vgn_ground10_lod','vgn_ground3_lod','grassdry_lod','5af8d285','brickred'} for i=1, #grass do engineApplyShaderToWorldTexture(shader, grass[i]) end end end ) any idea on how i could speed up the loading of shaders on switching from low, medium, or high?
  18. setting = 1 local sx, sy = guiGetScreenSize() local dx, dy = 1920, 1080 -- GUI Window local guiWindow = guiCreateWindow(100/sx*dx, 160/sy*dy, 200/sx*dx, 160/sy*dy, 'Shader Resolution', false, false) local low = guiCreateRadioButton(20/sx*dx, 30/sy*dy, 150/sx*dx, 20/sy*dy, 'Low', false, guiWindow) local medium = guiCreateRadioButton(20/sx*dx, 60/sy*dy, 150/sx*dx, 20/sy*dy, 'Medium', false, guiWindow) local high = guiCreateRadioButton(20/sx*dx, 90/sy*dy, 150/sx*dx, 20/sy*dy, 'High', false, guiWindow) guiSetVisible(guiWindow, false) -- END bindKey('F1', 'down', function() guiSetVisible(guiWindow, not not guiGetVisible(guiWindow)) end) addEventHandler('onClientRender', root, function() if guiRadioButtonSetSelected(low) then setting = 1 elseif guiRadioButtonSetSelected(medium) then setting = 2 elseif guiRadioButtonSetSelected(high) then setting = 3 end end) function gg() --setting = 1 if setting == 1 then terrain = dxCreateTexture('image/testlow.jpg',"dxt5",true) elseif setting == 2 then terrain = dxCreateTexture('image/testmedium.jpg',"dxt5",true)33 elseif setting == 3 then terrain = dxCreateTexture('image/test.jpg',"dxt5",true) end shader = dxCreateShader("fx/shader.fx") dxSetShaderValue(shader, 'Tex0', terrain) engineApplyShaderToWorldTexture(shader, 'sw_sandlod') end addEvent("pp",true) addEventHandler("pp", getRootElement(), gg) save(setting) local myData = {} function save() local file = fileOpen('save.json') or fileCreate('save.json') local file = fileWrite(toJSON(myData)) fileClose(file) end function load() local file = fileOpen('save.json') if file then local buffer = fileRead(fileGetSize(file)) myData = fromJSON(buffer) fileClose(file) end end load(settings) I want to know how I can use save and load for the settings 1, 2, 3. this is a shader low, medium, high panel I've made.
  19. local weap = {shot=false,timer=false} addEventHandler("onClientPlayerWeaponFire", localPlayer, function() local rot = getPedCameraRotation(localPlayer) if (isTimer(weap.timer)) then killTimer(weap.timer); end if (not weap.shot) then setPedCameraRotation(localPlayer, -(rot-0.9)) weap.shot = true weap.timer = setTimer(setPedCameraRotation, 100, 1, localPlayer, -(rot+0.09)) else setPedCameraRotation(localPlayer, -(rot+0.9)) weap.shot = false weap.timer = setTimer(setPedCameraRotation, 100, 1, localPlayer, -(rot-0.09)) end end) how can i make the snap of rotation a bit smoother less fast yet still function properly? also is there a way to make vertical recoil with setPedCameraRotation?
  20. i dont understand when i export the repositioned original ped and import it back it loses its Envelop weights and everything is jacked
  21. the sun is making my custom objects dark when i can see it
  22. well that function is fine it would have to be my showInventory function but idk ive been trying this for a week now and i cant get it to work correctly do you have any idea about the first* error? function getMySlots() getPlayerCurrentSlots() getPlayerMaxAviableSlots() end function refreshNewInventory() if not getElementData ( localPlayer, "dayz:new_inv") then return end myInventory = exports.dayz:getMyInventory() lootInventory = exports.dayz:getLootInventory() mySlots = exports.dayz:getMySlots() lootSlots = exports.dayz:getLootSlots() if myInvOffset+itemQuant > #myInventory then if #myInventory > itemQuant then myInvOffset = #myInventory-itemQuant else myInvOffset = 0 end end if lootInventory then if lootInvOffset+itemQuant > #lootInventory then if #lootInventory > itemQuant then lootInvOffset = #lootInventory-itemQuant else lootInvOffset = 0 end end end local sack = exports.dayz:getPlayerSackName() or "Pocket" sackText = sack.." ("..mySlots[1].."/"..mySlots[2]..")" lootName = (getElementData(getLocalPlayer(),"lootname") or "Loot").." ("..lootSlots[1].."/"..lootSlots[2]..")" selectedFood = nil selectedMedicine = nil selectedSpec = nil selectedItemInMyInventory = nil selectedItemInLootInventory = nil selectingMainWeapon = false refreshFoodBoxes() refreshMedicineBoxes() refreshToolsBoxes() refreshPrimaryWeapons() refreshSecondaryWeapons() selectedVest = getElementData (localPlayer,"clothBody") if selectedVest == 0 then selectedVest = false end selectedHelmet = getElementData (localPlayer,"clothHead") if selectedHelmet == 0 then selectedHelmet = false end if sack then selectedSack = sack else selectedSack = nil end end
×
×
  • Create New...