Mods MTA Online Dayz

terça-feira, 20 de outubro de 2015

Sistema De Montar Tenda igual Ao Rust
Coisas Modificadas : Voce Agora Pode Escolher Aonde Sua Tenda Sera Montada,A Tenda E Criada Na Sua Frente,Meio invisivel,E Voce Pode Mover Ela.

Como Mover A Tenda??

Teclas 8 E 2: Move A Tenda Para Frente E Para Tras
Teclas 6 E 4 : Move A Tenda Para Os Lados.
Scroll Do Mause : Quando Girado ,A Tenda Rotaciona.

Como Colocar A Tenda Apos Ter Movido Ela De Lugar???

E So Apertar Enter E A Tenda Sera Criada Aonde Voce Escolheu.

                                                                 Tuturial

1- Va Na Sua Pasta Do DAYZ E Abra O Arquivo "SurvivorSystem.lua"

2- Procure Por : onPlayerPitchATent

3- Voce Ira Ver Uma Funçao , Substitua Ela Completamente Por Este Codigo :





function onPlayerPitchATent (itemName)
------------------
if getElementData(source,"inCraftPlaceObj") == true then return end
------------------
 setElementData(source,itemName,getElementData(source,itemName)-1)
------------------
 triggerClientEvent(source,"hideInventoryManual",source)
------------------
local x,y,z = getElementPosition(source)
local xr,yr,zr = getElementRotation(source)
px, py, pz = getElementPosition(source)
prot = getPedRotation(source)
local offsetRot = math.rad(prot+90)
local vx = px + 5 * math.cos(offsetRot)
local vy = py + 5 * math.sin(offsetRot)
local vz = pz + 2
local vrot = prot+180
------------------
tent = createObject(3243,vx,vy,z-1,0,0,vrot)
setObjectScale(tent,1.3)
setElementAlpha(tent,150)
------------------
setElementFrozen(source,true)
setElementData(source,"inCraftPlaceObj",true)
setElementCollisionsEnabled(tent, false)
------------------
bindKey(source,"num_8", "down",eightTentPressed)
bindKey(source,"num_2", "down",twoTentPressed)
bindKey(source,"num_6", "down",sixTentPressed)
bindKey(source,"num_4", "down",fourTentPressed)
bindKey(source,"mouse_wheel_up", "down",upTentPressed)
bindKey(source,"mouse_wheel_down", "down",downTentPressed)
bindKey(source,"enter", "down",doneTentPressed)
------------------
 outputChatBox("Use the 'numeric keys' and the 'Mouse Scroll' to control your object.", source)
 outputChatBox("Press 'Enter' to put the Tent in the Map.", source)
------------------
 wellImSorry = setTimer( function()
 forceEnd (source)
 end,60000,1)
------------------
end
addEvent("onPlayerPitchATent",true)
addEventHandler("onPlayerPitchATent",getRootElement(),onPlayerPitchATent)

function eightTentPressed (source)
local tx,ty,tz = getElementPosition(tent)
 setElementPosition(tent,tx,ty+0.5,tz)
end
function twoTentPressed ()
local tx,ty,tz = getElementPosition(tent)
 setElementPosition(tent,tx,ty-0.5,tz)
end
function sixTentPressed ()
local tx,ty,tz = getElementPosition(tent)
 setElementPosition(tent,tx+0.5,ty,tz)
end
function fourTentPressed ()
local tx,ty,tz = getElementPosition(tent)
 setElementPosition(tent,tx-0.5,ty,tz)
end
function upTentPressed ()
local trx,try,trz = getElementRotation(tent)
 setElementRotation(tent,trx,try,trz-2)
end
function downTentPressed ()
local trrx,trry,trrz = getElementRotation(tent)
 setElementRotation(tent,trrx,trry,trrz+2)
end

function forceEnd (source)
------------------
 killTimer(wellImSorry)
------------------
 setElementData(source,"Tent",getElementData(source,"Tent")+1)
------------------
 setElementFrozen(source, false)
 setElementData(source,"inCraftPlaceObj",false)
----------------
 destroyElement(tent)
----------------
 outputChatBox("You didn't made the Tent in the time, try again.", source)
----------------
end

function doneTentPressed (source)
------------------
 killTimer(wellImSorry)
------------------
 outputChatBox("You made a Tent!", source)
------------------
 setElementFrozen(source, false)
 setElementData(source,"inCraftPlaceObj",false)
------------------
 unbindKey(source,"num_8", "down",eightTentPressed)
 unbindKey(source,"num_2", "down",twoTentPressed)
 unbindKey(source,"num_6", "down",sixTentPressed)
 unbindKey(source,"num_4", "down",fourTentPressed)
 unbindKey(source,"mouse_wheel_up", "down",upTentPressed)
 unbindKey(source,"mouse_wheel_down", "down",downTentPressed)
 unbindKey(source,"enter", "down",doneTentPressed)
------------------
 setObjectScale(tent,1.3)
 setElementAlpha(tent,255)
 setElementCollisionsEnabled(tent,true)
 
 local nx,ny,nz = getElementPosition(tent)
 tentCol = createColSphere(nx,ny,nz,4)
 attachElements (tentCol,tent,0,0,0)
 setElementData(tentCol,"parent",tent)
 setElementData(tent,"parent",tentCol)
 setElementData(tentCol,"tent",true)
 setElementData(tentCol,"vehicle",true)
 setElementData(tentCol,"MAX_Slots",100)
------------------
end
4- Salve O Arquivo

5- Va Testar

Se Voce FEZ Tudo Isso E Testou, Volte Aqui E Deixe Um Comentario Sobre Oque Voce Achou, Se Voces Gostarem  Vou Ate Fazer Uma Versao Com Ware Fance.

0 comentários:

Postar um comentário

 

Volte Sempre !