Jump to content

طلب فنكشن


Recommended Posts

Posted

السلام عليكم ورحمة الله وبركاتهـ ..

بغيت اسوي تيمين..

الاول تيم للهجولة

والثاني للحرب

ابي الفنكشن الي يمنع الكلام في ال teamsay

عشان ما يسبون هناك وكذا ..

اتمنى انكم فهمتوني والسلام عليكم :arrowdown:

مبرمج مبتدأ

Posted

0: normal message

1: action message (/me)

2: team message

اظن تابل افاده من قبل وش فايدة ذا الرد :|

+ انواع الرسائل اللي انت كتبتها موجودة بلويكي :|

 

 

Posted
addEventHandler("onPlayerChat",root, 
function (msg,type) 
if (type == 2) then 
cancelEvent () 
end 
  end  
    ) 

كذا ^؟

مبرمج مبتدأ

Posted
addEventHandler("onPlayerChat",root, 
function (msg,type) 
if (type == 2) then 
cancelEvent () 
end 
  end  
    ) 

كذا ^؟

يفترض انك تجرب بنفسك قبل ما تسأل

CiTLh.png
Posted
local function playerChat(message, messageType) 
    if messageType == 2 then  
                cancelEvent() 
    end 
end 
addEventHandler("onPlayerChat", root, playerChat) 

 

 

Posted
local function playerChat(message, messageType) 
    if messageType == 2 then  
                cancelEvent() 
    end 
end 
addEventHandler("onPlayerChat", root, playerChat) 

؟abo_7mod ايش الفرق بين كودك و كود

CiTLh.png
Posted

تمام اشتغل

طيب مثلاً كيف اخلي فقط تيم واحد يقدر يتكلم بالتي ساي

سويت الكود هذا وما اشتغل

addEventHandler("onPlayerChat",root, 
function (msg,type) 
if (type == 2) then 
if (getPlayerTeam(source) ~= "admin") then 
cancelEvent () 
end 
  end 
    end) 

مبرمج مبتدأ

Posted
server.lua:4: Bad argument @ 'getTeamName' [Expected team at argument 1, got player] 

debug ^

addEventHandler("onPlayerChat",root, 
function (msg,type) 
if (type == 2 or type == 1) then 
if (getTeamName(source) ~= "admin") then 
cancelEvent () 
end 
  end 
    end) 

مبرمج مبتدأ

Posted

ما ظنيت اني اقدر اسويها لكن جربت بنفسي ,

اظن انها خطأ ممكن تساعدني

addEventHandler("onPlayerChat",root, 
function (msg,type) 
  
if (type == 2 or type == 1) then 
if (getPlayerTeam(source)(getTeamName(source)) ~= "admin") then 
cancelEvent () 
end 
  end 
    end) 

مبرمج مبتدأ

Posted
addEventHandler("onPlayerChat", root, 
function(msg, type) 
    if (type == 2 or type == 1) then 
        if (getTeamName(getPlayerTeam(source)) ~= "admin") then 
            cancelEvent() 
        end 
    end 
end) 

CiTLh.png
Posted

تمّت الافادة اخوي تابل على الاقل حاولت بـــ نفسي ..

بآرك الله بك ,

يوماً سعيداً

مبرمج مبتدأ

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...