0 Üye ve 1 Ziyaretçi konuyu incelemekte.
Merhaba, DD sunucusu için PM okuma sistemi arıyorum elinde olan var mıdır ya da bunu nasıl kodlarız?
excludedGroups = get"ExcludedGroups" or {}chat_range=100ozel = {} function isPlayerInRangeOfPoint(player,x,y,z,range) local px,py,pz=getElementPosition(player) return ((x-px)^2+(y-py)^2+(z-pz)^2)^0.5<=rangeend function onChat(player,_,...) local px,py,pz=getElementPosition(player) local msg = table.concat({...}, " ") local nick=getPlayerName(player) local r,g,b = getPlayerNametagColor(player) if isPlayerMuted(player) then outputChatBox("[!] #FFFFFFMuteli olduğunuz için chat yazamazsınız !", player, 255, 0, 0, true) return end for _,v in ipairs(getElementsByType("player")) do if isPlayerInRangeOfPoint(v,px,py,pz,chat_range) then outputChatBox() end if isPlayerExcluded(v) then if ozel[v] == true then outputChatBox("#FF0000[msg okuma]#ffffff "..nick..": #babdc1"..msg,v,r,g,b,true) end end endendaddCommandHandler("msg",onChat)addCommandHandler("pm",onChat)addEventHandler("onPlayerLogin", root, function(_,hesap) if isPlayerExcluded(source) then ozel[source] = true endend)addEventHandler("onResourceStart", resourceRoot, function() for _,player in ipairs(getElementsByType("player")) do if isPlayerExcluded(player) then ozel[player] = true end endend) addCommandHandler("özel", function(oyuncu, _, deger) if isPlayerExcluded(oyuncu) then if deger then if deger == "aç" then ozel[oyuncu] = true outputChatBox("Özel konuşmaları görme açıldı.", oyuncu, 0,255,0, true) elseif deger == "kapat" then ozel[oyuncu] = nil outputChatBox("Özel konuşmaları görme kapatıldı.", oyuncu, 0,255,0, true) end else outputChatBox("Lütfen bir değer giriniz.", oyuncu, 255,0,0, true) outputChatBox("/özel aç", oyuncu, 0,255,0, true) outputChatBox("/özel kapat", oyuncu, 0,255,0, true) end else outputChatBox("Bu komutu kullanmak için yetkin yok", oyuncu, 0,255,0, true) end end) function isPlayerExcluded(player) local size = #excludedGroups if size ~= 0 then local accountName = getAccountName(getPlayerAccount(player)) for i=1, size do if isObjectInACLGroup("user." .. accountName, aclGetGroup(excludedGroups[i])) then return true end end end return falseend
<meta><script src="local_chat.lua" type="server" /> <settings> <setting name="*ExcludedGroups" value="[[ 'Console', 'Y.Kurucu', 'ServerOrtağı', 'BAdmi1n', 'Ad11min' ]]" friendlyname="ACL grupları" desc="Özel mesajları hangi grupların görüceği"/> </settings></meta>
server.luaKodexcludedGroups = get"ExcludedGroups" or {}chat_range=100ozel = {} function isPlayerInRangeOfPoint(player,x,y,z,range) local px,py,pz=getElementPosition(player) return ((x-px)^2+(y-py)^2+(z-pz)^2)^0.5<=rangeend function onChat(player,_,...) local px,py,pz=getElementPosition(player) local msg = table.concat({...}, " ") local nick=getPlayerName(player) local r,g,b = getPlayerNametagColor(player) if isPlayerMuted(player) then outputChatBox("[!] #FFFFFFMuteli olduğunuz için chat yazamazsınız !", player, 255, 0, 0, true) return end for _,v in ipairs(getElementsByType("player")) do if isPlayerInRangeOfPoint(v,px,py,pz,chat_range) then outputChatBox() end if isPlayerExcluded(v) then if ozel[v] == true then outputChatBox("#FF0000[msg okuma]#ffffff "..nick..": #babdc1"..msg,v,r,g,b,true) end end endendaddCommandHandler("msg",onChat)addCommandHandler("pm",onChat)addEventHandler("onPlayerLogin", root, function(_,hesap) if isPlayerExcluded(source) then ozel[source] = true endend)addEventHandler("onResourceStart", resourceRoot, function() for _,player in ipairs(getElementsByType("player")) do if isPlayerExcluded(player) then ozel[player] = true end endend) addCommandHandler("özel", function(oyuncu, _, deger) if isPlayerExcluded(oyuncu) then if deger then if deger == "aç" then ozel[oyuncu] = true outputChatBox("Özel konuşmaları görme açıldı.", oyuncu, 0,255,0, true) elseif deger == "kapat" then ozel[oyuncu] = nil outputChatBox("Özel konuşmaları görme kapatıldı.", oyuncu, 0,255,0, true) end else outputChatBox("Lütfen bir değer giriniz.", oyuncu, 255,0,0, true) outputChatBox("/özel aç", oyuncu, 0,255,0, true) outputChatBox("/özel kapat", oyuncu, 0,255,0, true) end else outputChatBox("Bu komutu kullanmak için yetkin yok", oyuncu, 0,255,0, true) end end) function isPlayerExcluded(player) local size = #excludedGroups if size ~= 0 then local accountName = getAccountName(getPlayerAccount(player)) for i=1, size do if isObjectInACLGroup("user." .. accountName, aclGetGroup(excludedGroups[i])) then return true end end end return falseendmeta.xmlKod<meta><script src="local_chat.lua" type="server" /> <settings> <setting name="*ExcludedGroups" value="[[ 'Console', 'Y.Kurucu', 'ServerOrtağı', 'BAdmi1n', 'Ad11min' ]]" friendlyname="ACL grupları" desc="Özel mesajları hangi grupların görüceği"/> </settings></meta>