Jump to content

مساعدة: onPlayerChat


Recommended Posts

السلام عليكم سويت ذا الكود البسيط لما اللاعب يكتب شي يجيب اسمة ويحط قبلة كلمة

Server

ويسوي الكتابة حمرة

addEventHandler('onPlayerChat',root, 
    function(msg) 
        if string.find(msg,'***') then 
            kickPlayer ( source, "كلام ممنوع" ) 
        else 
            outputChatBox("Server: " .. getPlayerName( source ) .. "#ff0000 " ..   msg, root, 231, 255, 10, true) 
        end 
    end 
) 

بس الحين ابي اشيل الشات الرئيسي لأن اذا ما شلتة راح يطلع الكلام الي اللاعب كتبة مرتين كيف اشيلة ؟

Link to comment

وقف مود freeroam

أو

playercolors

وجرب الكود هذه

addEventHandler('onPlayerChat',root, 
    function(msg) 
            outputChatBox("Server: " .. getPlayerName( source ) .. "#ff0000 " ..  msg, root, 255, 0, 0, true) 
        end 
) 

ليش كنت حاطط kickplayer

وخارابيط؟

Link to comment
وقف مود freeroam

أو

playercolors

وجرب الكود هذه

addEventHandler('onPlayerChat',root, 
    function(msg) 
            outputChatBox("Server: " .. getPlayerName( source ) .. "#ff0000 " ..  msg, root, 255, 0, 0, true) 
        end 
) 

ليش كنت حاطط kickplayer

وخارابيط؟

لأن بدل ال *** كنت كاتب كلمات سب حتى لما اللاعب يسب ينطرد

+ طفيت ال

Freeroam

وبعدة يطلع الجات

وكذلك

playercolors

وما صار شي

Link to comment

اعتقد قصدك زي كذا

addEventHandler('onPlayerChat',root, 
    function(msg) 
        if string.find(msg,'***') then 
            kickPlayer ( source, "كلام ممنوع" ) 
            cancelEvent() 
        else 
            outputChatBox("Server: " .. getPlayerName( source ) .. "#ff0000 " ..   msg, root, 231, 255, 10, true) 
        end 
    end 
) 

Link to comment
وقف مود freeroam

أو

playercolors

وجرب الكود هذه

addEventHandler('onPlayerChat',root, 
    function(msg) 
            outputChatBox("Server: " .. getPlayerName( source ) .. "#ff0000 " ..  msg, root, 255, 0, 0, true) 
        end 
) 

ليش كنت حاطط kickplayer

وخارابيط؟

لأن بدل ال *** كنت كاتب كلمات سب حتى لما اللاعب يسب ينطرد

+ طفيت ال

Freeroam

وبعدة يطلع الجات

وكذلك

playercolors

وما صار شي

-- Server Side !  
addEventHandler('onPlayerChat',root, 
    function(msg) 
       outputChatBox("Server: " .. getPlayerName( source ) .. "#ff0000 " ..  msg, root, 255, 0, 0, true) 
       cancelEvent() 
end 
) 

:)

Link to comment
^مشكورين

:)

طيب فيه طريقه احسن اذا بتحط اكثر من كلمه

تسوي جدول وتحط فيه الكلمات وتسوي لوب :arrowleft::arrowleft:

مشكلتي الوحيدة للحين ما اعرف استخدم الجدول مع اللوب :/

بس أعرف اساسيات الجدول

واعرف اساسيات اللوب

Link to comment

:mrgreen: خل اللوب يولي مادري شدخله شطحت

خذ الكود من جانب سيرفر

Words = { 
    ["حيوان"] = true, -- << تقدر تضيف كلام زياده تسوي نفس الشيء  
}  
  
addEventHandler ( "onPlayerChat", root, function ( msg ) 
    local word = msg 
        if ( Words[word] ) then 
            cancelEvent (    ) 
            outputChatBox ( "* تم صكك ميوت لكلامكـ السيء", source, 255, 0, 0, true ) 
            setPlayerMuted ( source, true ) 
            setTimer ( function (    ) 
            setPlayerMuted ( source, false ) 
            outputChatBox ( "#00FF00* تم فك الميوت والرجاء عدم تكرار الكلام السيء", source , 255, 255, 255, true ) 
        end, 30000, 10, true ) -- هنا حط وقت الميوت الي تبيه 
    end 
end ) 

Edited by Guest
Link to comment
:mrgreen: خل اللوب يولي مادري شدخله شطحت

خذ الكود من جانب سيرفر

Words = { 
    ["حيوان"] = true, -- << تقدر تضيف كلام زياده تسوي نفس الشيء  
}  
  
addEventHandler ( "onPlayerChat", root, function ( msg ) 
    local word = msg 
        if ( Words[word] ) then 
            cancelEvent (    ) 
            outputChatBox ( "* تم صكك ميوت لكلامكـ السيء", source , 255, 0, 0, true ) 
            setPlayerMuted ( source, true ) 
            setTimer ( function (    ) 
            setPlayerMuted ( source, false ) 
            outputChatBox ( "#00FF00* تم فك الميوت والرجاء عدم تكرار الكلام السيء", source , 255, 255, 255, true ) 
        end, 30000, 10, true ) -- هنا حط وقت الميوت الي تبيه 
    end 
end ) 

وشكرا

بس وش ذي ال

true جنب الكلمة

وش شغلها ؟

Link to comment
:mrgreen: خل اللوب يولي مادري شدخله شطحت

خذ الكود من جانب سيرفر

Words = { 
    ["حيوان"] = true, -- << تقدر تضيف كلام زياده تسوي نفس الشيء  
}  
  
addEventHandler ( "onPlayerChat", root, function ( msg ) 
    local word = msg 
        if ( Words[word] ) then 
            cancelEvent (    ) 
            outputChatBox ( "* تم صكك ميوت لكلامكـ السيء", source , 255, 0, 0, true ) 
            setPlayerMuted ( source, true ) 
            setTimer ( function (    ) 
            setPlayerMuted ( source, false ) 
            outputChatBox ( "#00FF00* تم فك الميوت والرجاء عدم تكرار الكلام السيء", source , 255, 255, 255, true ) 
        end, 30000, 10, true ) -- هنا حط وقت الميوت الي تبيه 
    end 
end ) 

وشكرا

بس وش ذي ال

true جنب الكلمة

وش شغلها ؟

معنها ان الكلمة شغاله

لو كانت False

راح تكون عدمها مثل وجودها

Link to comment

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...