16 Mayıs 2014 Cuma

İtem Kopyalamayı Engelleme

   Merhaba arkadaşlar bu konumuzda serverde item kopyalamayı nasıl engelleyeceğimizi anlatacağız...


maxresdefault


"menu_client.lua" dosyasını açıyoruz...


Aşağıda bulunan kısmı buluyoruz  isToolbelt olarak aratarak bulabilirsiniz en aşağıda yer almaktadır.


---------------------------------------------------------


if isToolbeltItem(itemName) then
local col = getElementData(getLocalPlayer(), "currentCol")
triggerServerEvent("onPlayerTakeItemFromGround", getLocalPlayer(), itemName, col)
disableMenu()
return
end


-------------------------------------------------------


Yukarıda verilen kısmı aşağıda verilen kısım ile değiştiriyoruz...


--------------------------------------------------------


if isToolbeltItem(itemName) then
local col = getElementData(getLocalPlayer(), "currentCol")
if #getElementsWithinColShape(col, "player") > 1 or getNetworkStats().packetlossLastSecond > 1 then
return
end
x, y, z = getElementPosition(getLocalPlayer())
if pcount ~= nil and pcount < getTickCount() then
pcount = getTickCount() + 2000
x, y, z = getElementPosition(getLocalPlayer())
return false
elseif pcount == nil then
pcount = getTickCount() + 2000
x, y, z = getElementPosition(getLocalPlayer())
return false
end
local x1, y1, z1 = getElementPosition(getLocalPlayer())
if x1 ~= x or y1 ~= y or z1 ~= z then
pcount = nil
return false
end
pcount = nil
triggerServerEvent("onPlayerTakeItemFromGround", getLocalPlayer(), itemName, col)
disableMenu()
return
end


--------------------------------------------------------


Daha sonra aşağıda verilen kısmı buluyoruz...


--------------------------------------------------------


if getPlayerCurrentSlots() + getItemSlots(itemName) <= getPlayerMaxAviableSlots() then
do
local col = getElementData(getLocalPlayer(), "currentCol")
triggerServerEvent("onPlayerTakeItemFromGround", getLocalPlayer(), itemName, col)
disableMenu()
end
else


--------------------------------------------------------


Yukarıda gördüğünüz bu kısımıda aşağıda verdiğim kısımla değiştiriyorsunuz...


--------------------------------------------------------


if getPlayerCurrentSlots() + getItemSlots(itemName) <= getPlayerMaxAviableSlots() then
local col = getElementData(getLocalPlayer(), "currentCol")
if #getElementsWithinColShape(col, "player") > 1 or getNetworkStats().packetlossLastSecond > 1 then
return
end
x, y, z = getElementPosition(getLocalPlayer())
if pcount ~= nil and pcount < getTickCount() then
pcount = getTickCount() + 2000
x, y, z = getElementPosition(getLocalPlayer())
return false
elseif pcount == nil then
pcount = getTickCount() + 2000
x, y, z = getElementPosition(getLocalPlayer())
return false
end
local x1, y1, z1 = getElementPosition(getLocalPlayer())
if x1 ~= x or y1 ~= y or z1 ~= z then
pcount = nil
return false
end
pcount = nil
triggerServerEvent("onPlayerTakeItemFromGround", getLocalPlayer(), itemName, col)
disableMenu()
else


--------------------------------------------------------


Daha sonra dosyamızı kaydedip serverimize restart attıktan sonra item kopyalamayı engellemiş bulunmaktayız. Keyifli Oyunlar :)

Hiç yorum yok:

Yorum Gönder