addCommandHandler("torba",
function(player)
if(getResourceState(getResourceFromName("bone_attach")) == "running") then
if(getElementType(player) == "player") then
if getElementData(player, 'player:faction') == 'SAMC' then
if(getElementData(player, "bcase") ~= 1) then
setElementData(player, "bcase", 1)
case = createObject(1210,0,0,0)
exports.bone_attach:attachElementToBone(case,player,12,0,0.05,0.27,0,180,0)
cases[player] = case
elseif(getElementData(player, "bcase") == 1) then
setElementData(player, "bcase", 0)
exports.bone_attach:detachElementFromBone(cases[player])
destroyElement(cases[player])
end
end
end
else
outputChatBox("ERROR #1", player, 255, 50, 0)
end
end
)
Moredeczko to byl na torbe a mam na stawianie torby pomozesz tez zeby tylko SAMC moglo uzywac trej komendy i sory nie umiem napisac w lua masz kod
local torby = {}
function postaw(player)
local x, y, z = getElementPosition(player)
local obiekt = createObject(1210, x, y, z - 0.8)
setElementData(obiekt, "postawiono", true)
table.insert(torby, obiekt)
setElementData(obiekt, "postawil:gracz",getPlayerName(player))
end
addCommandHandler("t", postaw)
function podnies(player)
for i,v in pairs(torby) do
if not getElementData(v, "postawiono") then return end
if getElementData(v, "postawil:gracz")==getPlayerName(player) then
if isElement(v) then
destroyElement(v)
end
end
end
torby = {}
end
addCommandHandler("ut", podnies)
Ostatnio zmieniony przez DsJ3 2019-08-24, 13:11, w całości zmieniany 1 raz
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach