Jump to content


  • Posts

  • Joined

  • Last visited



  • Gang
    grove st
  • Location
    United States
  • Occupation
    learning as i go
  • Interests
    scripting 3d modeling texturing learning

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

greentumbleweed's Achievements


Transformer (11/54)



  1. Thank you very much this will help me do what im trying to do!
  2. 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)
  3. 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 )
  4. 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)
  5. 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)
  6. 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
  7. im not sure how to do this i knew i had to use random.math on server but idk how to pass it
  8. 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
  9. it shows on players now but it only shows on whoever typed the cmd and takes it away from the last player
  10. 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
  11. 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
  12. 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
  13. 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
  14. 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
  15. you can reduce resolution with: local scaleValue = screenY / devScreenY and it will all so reduce impact for lower end pc?
  • Create New...