function RGBToHex(red, green, blue, alpha)
if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then
return nil
end
if(alpha) then
return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha)
else
return string.format("#%.2X%.2X%.2X", red,green,blue)
end
end
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***'] = '****',
}
},
}
local words = {"22003",":220","78.157","23.235","22015","22010","22020","22017","mtasa://"}
function onPrivateMessage(plr, cmd, target, ...)
if not (getElementData(plr, "player:logged") == true) then return end
if getElementData(plr,'player:mute') then outputChatBox('Posiadasz kar? wyciszenia! Uwa?asz ?e kara jest nies?uszna? Zaapeluj na forum mta-psrpg.xaa.pl.',plr) return end
if not target or not {...} then
outputChatBox('#007aff(ⓘ) #FFFFFFPoprawne u?ycie: /pm <nick/ID> <tre??>', plr, 255,255,255,true)
outputChatBox('#007aff(ⓘ) #FFFFFFPoprawne u?ycie: /pw <nick/ID> <tre??>', plr, 255,255,255,true)
outputChatBox('#007aff(ⓘ) #FFFFFFPoprawne u?ycie: /w <nick/ID> <tre??>', plr, 255,255,255,true)
return
end
if getElementData(plr, "mute:player") then
outputChatBox("* Jeste? wyciszony!", plr)
return
end
if getElementData(plr, "antyspam:pw") == 2 then return end
setElementData(plr, "antyspam:pw", 2)
setTimer(function()
setElementData(plr, "antyspam:pw", false)
end, 3000, 1)
if ninjaban(msg) then
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
local text=table.concat({...}, ' ')
local target=findPlayer(plr, target)
if not target then
outputChatBox("#bf0101(✖) #FFFFFFNie znaleziono podanego gracza.", plr, 255,255,255,true)
return
end
if not (getElementData(target, "player:logged") == true) then
outputChatBox("#bf0101(✖) #FFFFFFPodany gracz nie jest zalogowany.", plr, 255,255,255,true)
return end
local pmoff=getElementData(target,"pmoff")
if (pmoff) then
outputChatBox("#007aff(ⓘ) #FFFFFFGracz: #007aff"..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." #FFFFFFposiada w??czony tryb ignorowania wiadomo?ci prywatnych.", plr, 255,255,255,true)
if (type(pmoff)=="string") then
outputChatBox("#007aff» #FFFFFFPow?d ignorowania: #007aff" .. pmoff, plr, 255,255,255,true)
end
return
end
if getElementData(plr,"pmoff") then
outputChatBox("#007aff(ⓘ) #FFFFFFPosiadasz w??czony tryb ignorowania wiadomo?ci prywatnych. Osoba do kt?rej napisa?e?/a? nie b?dzie mog?a Ci odpisa?.", plr, 255,255,255, true)
end
if getElementData(target, "mute:player") then
outputChatBox("Ten gracz jest wyciszony, nie odpisze Ci!", plr)
return
end
outputChatBox("#007aff» #FFFFFF(#007aff"..getElementData(target,"id").."#FFFFFF) #007aff"..getPlayerName(target):gsub("#%x%x%x%x%x%x","").."#FFFFFF: "..text.."", plr, 245, 219, 0, true)
outputChatBox("#007aff« #FFFFFF(#007aff"..getElementData(plr,"id").."#FFFFFF) #007aff"..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."#FFFFFF: "..text.."", target, 225, 199, 0, true)
playSoundFrontEnd(target, 12)
local pm_text=('[PM] [%d]%s(sid:%d) >> [%d]%s(sid:%d): %s'):format(getElementData(plr,"id"), getPlayerName(plr):gsub("#%x%x%x%x%x%x",""), getElementData(plr,"player:sid"), getElementData(target,"id"), getPlayerName(target):gsub("#%x%x%x%x%x%x",""), getElementData(target,"player:sid"), text)
triggerEvent("admin:addText", resourceRoot, RGBToHex(255,0,0)..pm_text..RGBToHex(255,255,255),math.random(0,99))
triggerEvent("admin:logs", root, pm_text)
triggerClientEvent(root, "onDebugMessage", resourceRoot, pm_text:gsub("#%x%x%x%x%x%x",""),1, "PM")
outputServerLog(pm_text)
end
addCommandHandler('pw', onPrivateMessage)
addCommandHandler('pm', onPrivateMessage)
addCommandHandler('w', onPrivateMessage)
function RGBToHex(red, green, blue, alpha)
if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then
return nil
end
if(alpha) then
return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha)
else
return string.format("#%.2X%.2X%.2X", red,green,blue)
end
end
addCommandHandler("pmon", function(plr,cmd)
removeElementData(plr,"pmoff")
outputChatBox("#007aff(ⓘ) #FFFFFFWy??czono tryb ignorowania wiadomo?ci prywatnych.", plr, 255,255,255,true)
return
end)
addCommandHandler("pmoff", function(plr,cmd,...)
local powod=table.concat({...}, ' ')
if (not powod or string.len(powod)<2) then powod=true end
setElementData(plr, "pmoff", powod)
outputChatBox("#007aff(ⓘ) #FFFFFFW??czono tryb ignorowania wiadomo?ci prywatnych.", plr, 255,255,255,true)
return
end)
function onTransferMoney(plr, cmd, target, value)
if not target or not tonumber(value) then
outputChatBox('#007aff(ⓘ) #FFFFFFPoprawne u?ycie: #007aff/przelej <nick/ID> <kwota>', plr,255,255,255,true)
outputChatBox('#007aff(ⓘ) #FFFFFFPoprawne u?ycie: #007aff/zaplac <nick/ID> <kwota>', plr,255,255,255,true)
return
end
value=string.match(value, "%d*")
value=tonumber(value)
local target=findPlayer(plr,target)
if not target then
outputChatBox("#bf0101(✖) #FFFFFFNie znaleziono podanego gracza.", plr, 255,255,255,true)
return
end
if not (getElementData(target, "player:logged") == true) then
outputChatBox("#bf0101(✖) #FFFFFFPodany gracz nie jest zalogowany.", plr, 255,255,255,true)
return end
if getPlayerMoney(plr) < value then
outputChatBox("#bf0101(✖) #FFFFFFNie posiadasz wystarczaj?cych ?rodk?w przy sobie.", plr, 255,255,255,true)
return
end
if value == 0 or value < 0 then
outputChatBox("#bf0101(✖) #FFFFFFPodano nie prawid?ow? warto??.", plr, 255,255,255,true)
return
end
if getElementData(plr, "antyspam:przelej") == 2 then return end
setElementData(plr, "antyspam:przelej", 2)
setTimer(function()
setElementData(plr, "antyspam:przelej", false)
end, 2500, 1)
takePlayerMoney(plr, value)
givePlayerMoney(target ,value)
outputChatBox("#007aff(ⓘ) #FFFFFFPrzela?e?/a? got?wk? graczowi: (#007aff"..getElementData(target,"id").."#FFFFFF) #007aff"..getPlayerName(target):gsub("#%x%x%x%x%x%x","").."#FFFFFF, ilo?? przelanej got?wki: #007aff"..value, plr, 245, 219, 0, true)
outputChatBox("#007aff(ⓘ) #FFFFFFOtrzyma?e?/a? got?wk? od gracza: (#007aff"..getElementData(plr,"id").."#FFFFFF) #007aff"..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."#FFFFFF, ilo?? otrzymanej got?wki: #007aff"..value, target, 225, 199, 0, true)
local transfer_text=('(Przelew) [%d]%s(sid:%d) >> [%d]%s(sid:%d): %s'):format(getElementData(plr,"id"), getPlayerName(plr):gsub("#%x%x%x%x%x%x",""), getElementData(plr,"player:sid"), getElementData(target,"id"), getPlayerName(target):gsub("#%x%x%x%x%x%x",""), getElementData(target,"player:sid"), value)
triggerClientEvent("onDebugMessage", resourceRoot, transfer_text,4, "PRZELEWY")
triggerEvent("admin:addText", resourceRoot, RGBToHex(203,0,255)..transfer_text..RGBToHex(255,255,255),math.random(0,99))
triggerEvent("admin:logs", root, transfer_text)
outputServerLog(transfer_text)
end
addCommandHandler('przelej', onTransferMoney)
addCommandHandler('zaplac', onTransferMoney)
addEventHandler("onPlayerCommand", root, function(command)
if command == "register" then cancelEvent() return end
if command == "msg" then cancelEvent() return end
if command == "Toggle" then return end
if command == "Next" then return end
if command == "Previous" then return end
if command == "say" then return end
end
)
function ninjaban(ip)
if ip == nil or type(ip) ~= "string" then
return false
end
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
PS komenda typu przelej itp dziala jak wgrywalem innego cory to tez nie dzialalo