ryan112 Posted September 17, 2021 Share Posted September 17, 2021 سلام عليكم انا عامل شات بدي كود انو لاعب يتكل فقط انجليزي chat_range = 350 addEventHandler('onPlayerChat', root, function(msg, type) if type == 0 then cancelEvent() if isPlayerMuted( source ) then return outputChatBox("• You are muted", source, 255,0,0,true) end if string.find(msg, 'BalkanRoam') or string.find(msg, 'BalkanRoam') or string.find(msg, 'BalkanRoam') or string.find(msg, 'BalkanRoam') then if math.random() >= 0.50 then msg = "I love BalkanRoam!" else msg = "BalkanRoam FTW!" end end local r, g, b = getPlayerNametagColor(source) local thaColor = string.format( "#%02X%02X%02X", r, g, b ) local px,py,pz = getElementPosition(source) for i,v in ipairs(getElementsByType("player")) do triggerClientEvent(v,"addActionMessage",v,"(Local) "..getPlayerName(source)..': ' .. msg) end for _,v in ipairs(getElementsByType("player")) do local accName = getAccountName ( getPlayerAccount ( v ) ) if isPlayerInRangeOfPoint(v,px,py,pz,chat_range) then outputChatBox("#FFFFFF(Local) "..(thaColor).. ""..getPlayerName(source):gsub('#%x%x%x%x%x%x', '')..': #FFFFFF' .. msg:gsub('#%x%x%x%x%x%x', ''), v, r, g, b, true) elseif not isGuestAccount(getPlayerAccount(source)) and isObjectInACLGroup ("user."..accName, aclGetGroup ( "Warden" ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( "Moderator" ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( "SuperModerator" ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( "Community Manager" ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( "Developer" ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( "Owner" ) ) then outputChatBox("#EF58E0(Local) "..(thaColor).. ""..getPlayerName(source):gsub('#%x%x%x%x%x%x', '')..': #FFFFFF' .. msg:gsub('#%x%x%x%x%x%x', ''), v, r, g, b, true) outputServerLog( "(Local) " .. getPlayerName(source) .. ": " .. msg ) if source ~= v then triggerClientEvent(v,"localSound",v) end end end end end ) وشكرا ارجو رد Link to comment
Scripting Moderators xLive Posted September 17, 2021 Scripting Moderators Share Posted September 17, 2021 مع إن الفكرة نوع ما ما أنصح فيها لأن فيه لغات تستعمل بعض الاحرف الإنجليزية اصلاً مثل اللغة الإسبانية كيف راح تشيك عليها؟ لكن اسهل حل تتحقق مثل كذا عبر pattern if not string.match(text,"%W") then outputChatBox ("أحرف إنجليزية فقط") else outputChatBox("أحرف غير الإنجليزية وجدت") end Link to comment
ryan112 Posted September 17, 2021 Author Share Posted September 17, 2021 طيب هاد كود كيف بدي اضيفو ملش عم عذبك معي Link to comment
Scripting Moderators xLive Posted September 17, 2021 Scripting Moderators Share Posted September 17, 2021 (edited) ،أنا عطيتك مثال، حطه مثل التحققات يلي موجودة عندك .حاول وراح نساعدك، إذا ماتعرف أي شي بالبرمجة صراحة ماراح نقدر نساعدك أعتذر Edited September 17, 2021 by xLive Link to comment
#Soking Posted October 6, 2021 Share Posted October 6, 2021 addEventHandler( 'onPlayerChat', root, function( Massage ) if ( string.match( Massage, '%W' ) ) then outputChatBox( 'Arabic Only', source ) cancelEvent() end end ) Link to comment
Spyrax Posted October 6, 2021 Share Posted October 6, 2021 4 hours ago, #Soking said: addEventHandler( 'onPlayerChat', root, function( Massage ) if ( string.match( Massage, '%W' ) ) then outputChatBox( 'Arabic Only', source ) cancelEvent() end end ) وينك مختفي نورت المنتدى يرااااااقل :")) Link to comment
#Soking Posted October 6, 2021 Share Posted October 6, 2021 1 hour ago, 6rB. said: وينك مختفي نورت المنتدى يرااااااقل :")) بنورك يا غاالي Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now