Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2023-03-18, 20:36


VolvoB10ma







Wiek: 30
Na forum: 2612 dni
Posty: 10
Nick w MP: VolvoB10ma

Piwa: 5

Respekt: 50

Jak ustawic aby gracze bez premium mogli widziec czat premium, jedynie co potrafilem przelaczyc to aby gracze bez premium mogli pisac :P .

Kod:

--[[
Resource: OURGame
Developers: Split <split.programista@gmail.com>
Copyright <split.programista@gmail.com> 2015-2016
You have no right to use this code without my permission.
]]

local settings = {
['swearFilter'] = {
['enabled'] = true,
['swears'] = { -- Allows you to set the blocked swear words, syntax is ['WORD'] = 'REPLACEMENT'
['k****'] = '****',
['cwel'] = '****',
['k****?'] = '****',
['c w e l'] = '****',
['k u r w a'] = '****',
['cwelem'] = '******',
['c w e l e m'] = '****',
['k u r w ?'] = '****',
['szmata'] = '****',
['dziwka'] = '****',
['*****'] = '****',
['jajebie'] = '****',
['j***e'] = '****',
['*****'] = '****',
['*****'] = '****',
['k****'] = '****',
['frajer'] = '****',
['frajerze'] = '****',
['*****'] = '****',
['ja *****'] = '****',
['*****'] = '****',
['*****'] = '****',
['c***'] = '****',
['szmato'] = '****',
['dziwko'] = '****',
['peda?'] = '****',
['pedal'] = '****',
['peda?y'] = '****',
['frjerzy'] = '****',
['frajerka'] = '****',
['p****'] = '****',
['p****'] = '****',
['p****'] = '****',
['s********j'] = '****',
['suka'] = '****',
['sukinsyn'] = '****',
['wyjebie'] = '****',
['*****'] = '****',
['wypierdalaj'] = '****',
['****'] = '****',
['****'] = '****',
['k?rwa'] = '****',
['k?rva'] = '****',
['kurva'] = '****',
['k***'] = '****',
['sukinsyn'] = '****',
['*****'] = '****',
['*****'] = '****',
['*****'] = '****',
['wypierdalajcie'] = '****',
['k***'] = '****',
['k***'] = '****',
['k***'] = '****',
['wk?rwiajcie'] = '****',
['fk?rwiajcie'] = '****',
['k***'] = '****',
['wk?rwiacie'] = '****',
['wk?rwiony'] = '****',
['wkurviony'] = '****',
['wk?rviony'] = '****',
['jebne'] = '****',
['*****'] = '****',
['*****'] = '****',
['jebni?ty'] = '****',
['*****'] = '****',
['zjebusie'] = '****',
['k***'] = '****',
['k***'] = '****',
['k***'] = '****',
}
},
['antiSpamFilter'] = {
['enabled'] = true,
['execeptionGroups'] = 'Admin,Ghoul', -- Groups which can spam, eg. 'Admin,SuperModerator,Moderator'
['chatTimeOut'] = 1.5 -- Set in seconds.
},
}

local spam = { }

local wiadomosci = { }

local words = {"22003",":220","78.157","23.235","22015","22010","22020","22017","mtasa://"}

local stopChat = false

addEventHandler('onPlayerChat', root, function(msg, type)
cancelEvent()
if stopChat then
cancelEvent()
outputChatBox("Ⓘ #FFFFFFChat jest aktualnie wy??czony.", source, 255,255,0, true)
return end
if not getElementData(source,"player:sid") then
--outputChatBox("✘ #FFFFFFMusisz by? zalogowany.", source, 255, 0, 0, true)
return end

local tick=getTickCount()
if type==0 then
cancelEvent()
if ninjaban(msg) then
cancelEvent()
kickPlayer(plr, "Anty-Reklama")
triggerClientEvent(root, "admin:rendering", root, "* ["..getElementData(plr,"id").."]"..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").." zosta?(a) wyrzucony(a) przez System, pow?d: Reklama")
return end
if not isElement(source) then return end
local x,y,z=getElementPosition(source)
local sphere=createColSphere(x,y,z, 30)
local players=getElementsWithinColShape(sphere, 'player')
if getElementData(source, "mute:player") then
outputChatBox("✘ #FFFFFFJeste? wyciszony(a).", source, 255, 0, 0, true)
return
end
for i,v in pairs(players) do
local id=getElementData(source,"id")
local level = tonumber(getElementData(source, "player:level"))
local p_level = tonumber(getElementData(source, "premium:level"))
if not level and not p_level then
outputChatBox("#FFFFFF[#ffffff"..getElementData(source,"id").."#ffffff] #FFFFFF"..getPlayerName(source):gsub("#%x%x%x%x%x%x","")..":#FFFFFF "..msg:gsub("#%x%x%x%x%x%x",""), v, _, _, _, true)
elseif level == 1 then
cancelEvent()
outputChatBox("#FFFFFF[#009B00"..getElementData(source,"id").."#FFFFFF] #FFFFFF"..getPlayerName(source):gsub("#%x%x%x%x%x%x","")..":#FFFFFF "..msg:gsub("#%x%x%x%x%x%x",""), v, _, _, _, true)
elseif level == 2 then
cancelEvent()
outputChatBox("#FFFFFF[#ff0000"..getElementData(source,"id").."#FFFFFF] #FFFFFF"..getPlayerName(source):gsub("#%x%x%x%x%x%x","")..":#FFFFFF "..msg:gsub("#%x%x%x%x%x%x",""), v, _, _, _, true)
elseif level == 3 then
cancelEvent()
outputChatBox("#FFFFFF[#800000"..getElementData(source,"id").."#FFFFFF] #FFFFFF"..getPlayerName(source):gsub("#%x%x%x%x%x%x","")..":#FFFFFF "..msg:gsub("#%x%x%x%x%x%x",""), v, _, _, _, true)
elseif level == 4 then
cancelEvent()
outputChatBox("#FFFFFF[#1C86EE"..getElementData(source,"id").."#FFFFFF] #FFFFFF"..getPlayerName(source):gsub("#%x%x%x%x%x%x","")..":#FFFFFF "..msg:gsub("#%x%x%x%x%x%x",""), v, _, _, _, true)
elseif level == 5 then
cancelEvent()
outputChatBox("#FFFFFF[#FF8C00"..getElementData(source,"id").."#FFFFFF] #FFFFFF"..getPlayerName(source):gsub("#%x%x%x%x%x%x","")..":#FFFFFF "..msg:gsub("#%x%x%x%x%x%x",""), v, _, _, _, true)
elseif p_level == 1 then
cancelEvent()
outputChatBox("#FFFFFF[#C0FF00"..getElementData(source,"id").."#FFFFFF] #FFFFFF"..getPlayerName(source):gsub("#%x%x%x%x%x%x","")..":#FFFFFF "..msg:gsub("#%x%x%x%x%x%x",""), v, _, _, _, true) end
end
destroyElement(sphere)

local desc = string.format("[#0091ffLOCAL#ffffff] [%d] %s: %s",getElementData(source,"id"),getPlayerName(source):gsub("#%x%x%x%x%x%x",""),msg:gsub("#%x%x%x%x%x%x",""))
triggerClientEvent(root, "onDebugMessage", resourceRoot, desc:gsub("#%x%x%x%x%x%x",""),1, "CZAT")
triggerEvent("admin:addText", resourceRoot, desc)
outputServerLog(desc)
triggerClientEvent("onChatbubblesMessageIncome",source,msg:gsub("#%x%x%x%x%x%x",""),0)
elseif type==1 then
cancelEvent()
if ninjaban(msg) then
cancelEvent()
triggerClientEvent(root, "admin:rendering", root, "* "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").." ("..getElementData(source,"id")..") zosta?(a) wyrzucony(a) przez ANTY-REKLAMA")
kickPlayer (source, "ANTY-REKLAMA")
return end
if getElementData(source, "mute:player") then
outputChatBox("✘ #FFFFFFJeste? wyciszony(a).", source, 255, 0, 0, true)
return
end
local x,y,z=getElementPosition(source)
local sphere=createColSphere(x,y,z, 30)
local players=getElementsWithinColShape(sphere, 'player')
destroyElement(sphere)
for i,v in pairs(players) do
outputChatBox("** "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").." "..msg:gsub("#%x%x%x%x%x%x",""), v, 255, 128, 255)
end
local q = string.format("#ffffff[#ff00f2ME#ffffff] ["..getElementData(source,"id").."] "..getPlayerName(source):gsub("#%x%x%x%x%x%x","")..": "..msg:gsub("#%x%x%x%x%x%x",""))
triggerEvent("admin:addText", resourceRoot, q)
triggerClientEvent("onDebugMessage", resourceRoot, q,1, "/ME")
outputServerLog(q)
end
end)

addCommandHandler("g", function(plr, cmd, ...)
if getElementData(plr, "player:premium") == true then outputChatBox("✘ #FFFFFFMusisz posiada? konto Premium, by m?c pisa? na chacie dla Premium.", plr, 255, 0, 0, true) return end
if getElementData(plr, "mute:player") == true then outputChatBox("✘ #FFFFFFJeste? wyciszony(a), nie mo?esz pisa? na chacie dla Premium.", plr, 255, 0, 0, true) return end
if not ... then
local x = getElementData(plr,"player:pchatoff")
if x == false then
outputChatBox("✔ #FFFFFFPomy?lnie wy??czy?e?(a?) chat Premium.", plr, 0, 255, 0, true)
setElementData(plr,"player:pchatoff",true)
end
if x == true then
outputChatBox("✔ #FFFFFFPomy?lnie w??czy?e?(a?) chat Premium.", plr, 0, 255, 0, true)
setElementData(plr,"player:pchatoff",false)
end
return end
if stopChat then
cancelEvent()
outputChatBox("✔ #FFFFFFChat premium jest wy??czony.", plr, 0, 255, 0, true)
return end
if getElementData(plr,"player:pchatoff") then
cancelEvent()
outputChatBox("✘ #FFFFFFMasz wy??czony chat Premium. Aby ponownie go w??czy? wpisz /g", plr, 255, 0, 0, true)
return end
if ... then
local message = table.concat ( { ... }, " " )
local name = getPlayerName(plr):gsub("#%x%x%x%x%x%x","")
for _,p in pairs(getElementsByType("player")) do
if getElementData(p,"player:premium") and not getElementData(p,"player:pchatoff") then
outputChatBox("#FFC300G#ffffff> [#FFD700"..getElementData(plr,"id").."#ffffff] "..name.."#ffffff: "..message:gsub("#%x%x%x%x%x%x","").."", p, 255, 255, 255, true)
end
end
local desc = "[#ffdd00PREMIUM#ffffff] ["..getElementData(plr,"id").."] "..name..": "..message:gsub("#%x%x%x%x%x%x","")..""
triggerEvent("admin:addText", resourceRoot, desc)
outputServerLog(desc)
end
end)


addCommandHandler('do', function(source, cmd, ...)
local text=table.concat({...}, ' ')
if not text then return end
if ninjaban(msg) then
cancelEvent()
triggerClientEvent(root, "admin:rendering", root, "* "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").."("..getElementData(source,"id")..") zosta?(a) wyrzucony(a) przez ANTY-REKLAMA")
kickPlayer (source, "ANTY-REKLAMA")
return end
if getElementData(source, "mute:player") then
outputChatBox("✘ #FFFFFFJeste? wyciszony(a), nie mo?esz u?y? tej komendy.", source, 255, 0, 0, true)
return
end
local msg=table.concat({...}, " ")
local x,y,z=getElementPosition(source)
local sphere=createColSphere(x,y,z, 30)
local players=getElementsWithinColShape(sphere, 'player')
destroyElement(sphere)

for i,v in ipairs(players) do
outputChatBox("** "..msg.." (( "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").." )) **", v, 0, 160, 255)
end
triggerClientEvent("onDebugMessage", resourceRoot, "* "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").."(("..msg.."))",1, "/ME")
triggerEvent("admin:addText", resourceRoot, "[#00a2ffDO#ffffff] ["..getElementData(source,"id").."] "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").." (("..msg.."))",math.random(0,99))
outputServerLog("[DO] "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").." (("..msg.."))",math.random(0,99))

end)


function ninjaban(ip)
-- must pass in a string value
if ip == nil or type(ip) ~= "string" then
return false
end

-- check for format 1.11.111.111 for ipv4
local chunks = {ip:match("(%d+)%.(%d+)%.(%d+)%.(%d+)")}
if (#chunks == 4) then
for _,v in pairs(chunks) do
if (tonumber(v) < 0 or tonumber(v) > 255) then
return false
else
return true
end
end
else
return false
end

return false
end

function RGBToHex(red, green, blue, alpha)
return string.format("#%.2X%.2X%.2X", red,green,blue)
end

addEventHandler("onPlayerCommand", root, function(cmd)
if cmd == "shutdown" then cancelEvent() end
if cmd == "aexec" then cancelEvent() end
if cmd == "runcode" then cancelEvent() end
if cmd == "msg" then cancelEvent() end
if cmd == "nick" then cancelEvent() end
if cmd == "chgmypass" then cancelEvent() end
if cmd == "whowas" then cancelEvent() end
if cmd == "whois" then cancelEvent() end
if cmd == "sver" then cancelEvent() end
if cmd == "openports" then cancelEvent() end
if cmd == "help" then cancelEvent() end
if cmd == "debugdb" then cancelEvent() end
if cmd == "ase" then cancelEvent() end
if cmd == "stopall" then cancelEvent() end
if cmd == "register" then cancelEvent() end
if cmd == "showhud" then cancelEvent() end
if cmd == "showcol" then cancelEvent() end


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
borsuk
Wysłany: 2023-03-22, 19:39


!hejcob

Twórca Botów Discord.






Wiek: 25
Na forum: 1511 dni
Posty: 27
Nick w MP: Hejcob.gg

Piwa: 90

Respekt: 55,3

Masz tu kod jak to zrobic

Kod:

addEventHandler("onPlayerChat", root, function(message, messageType)
if messageType == 1 then -- check if message is a PM
local sender = source -- get the sender of the message
local accountName = getAccountName(getPlayerAccount(sender)) -- get the account name of the sender
if isObjectInACLGroup("user." .. accountName, aclGetGroup("Premium")) then -- check if the sender has Premium account
for _, recipient in ipairs(getElementsByType("player")) do -- loop through all players
local accountName = getAccountName(getPlayerAccount(recipient)) -- get the account name of the recipient
if not isObjectInACLGroup("user." .. accountName, aclGetGroup("Premium")) then -- check if the recipient doesn't have Premium account
outputChatBox("[PREMIUM] " .. getPlayerName(sender) .. ": " .. message, recipient, 255, 215, 0, true) -- send the message to the recipient
end
end
end
cancelEvent() -- cancel the original message event
end
end)


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
borsuk
Tagi: jak :: ustawic :: aby :: gracze :: bez :: premium :: mogli :: widziec :: czat :: premiu
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Jak ustawic aby gracze bez premium mogli widziec czat premiu Odpowiedz do tematu

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
Dodaj temat do Ulubionych
Wersja do druku