Jump to content

onPlayerChat


Nasa47

Recommended Posts

local msgs = { 
['hello'] = "hi" 
} 
  
function chatt ( msg ) 
    if ( msg == msgs ) then 
        cancelEvent() 
        outputChatBox ("* ".. getPlayerName ( source ) .." : "..msgs [ msg ], source, 0, 255, 0, true ) 
    end 
end 
addEventHandler("onPlayerChat", root, chatt) 

هذا الكود مو جاي يزبط ولا في رسايل من الدي بق

Link to comment
local msgs = { 
['hi'] = "hello" 
} 
  
function chatt ( msg ) 
    if ( msgs[msg] ) then 
        cancelEvent() 
        outputChatBox ("* ".. getPlayerName ( source ) .." : "..msgs [ msg ], source, 0, 255, 0, true ) 
    end 
end 
addEventHandler("onPlayerChat", root, chatt) 

هذا الكود مو جاي يزبط ولا في رسايل من الدي بق

Link to comment
local msgs = { 
['hello'] = "hi" 
} 
  
function chatt ( msg ) 
    if string.find( msg, msgs ) then 
        if ( msgs [ msg ] ) then 
            cancelEvent() 
            outputChatBox ("* ".. getPlayerName ( source ) .." : "..msgs [ msg ], source, 0, 255, 0, true ) 
        end 
    end 
end 
addEventHandler("onPlayerChat", root, chatt) 

Link to comment

local gWords = { 
  [ "hi" ] = "hello" 
} 
  
addEventHandler( "onPlayerChat", root, function ( msg ) 
       for i,v in next, ( gWords ) do 
           msg = string.gsub( msg, i, v ) 
        end 
        cancelEvent ( true ) 
        outputChatBox ( "* ".. getPlayerName ( source ) .." : ".. msg, source, 0, 255, 0, true ) 
end ) 
Link to comment
local gWords = { 
  [ "hi" ] = "hello" 
} 
  
addEventHandler( "onPlayerChat", root, function ( msg ) 
       for i,v in next, ( gWords ) do 
           msg = string.gsub( msg, i, v ) 
        end 
        cancelEvent ( true ) 
        outputChatBox ( "* ".. getPlayerName ( source ) .." : ".. msg, source, 0, 255, 0, true ) 
end ) 

:cry: كودك يطلع الكلام مرتين انا ابي اذا كتبت هاي يطلع هيلو

Link to comment
local gWords = { 
  [ "hi" ] = "hello" 
} 
  
addEventHandler( "onPlayerChat", root, function ( msg ) 
       for i,v in next, ( gWords ) do 
           msg = string.gsub( msg, i, v ) 
        end 
        cancelEvent ( true ) 
        outputChatBox ( "* ".. getPlayerName ( source ) .." : ".. msg, source, 0, 255, 0, true ) 
end ) 

:cry: كودك يطلع الكلام مرتين انا ابي اذا كتبت هاي يطلع هيلو

طف مود play

وجرب السكربت على مود

fallout

...

Link to comment
يَ ناااس افهمووا

المشكلة مو في التكرااار, المشكلة انه يطلع لي الكلمة بلون ثاني, بدوون تغييير

انا ابييه يغير الكلمة

الكود مجرب و شغال

كم انا غبي :lol:

طيب الكود ذا يطلع اييي كلام, انا ابيه بسس اذا قال

hi

لان لو كتبت اي كلمة ثانية يطلعها لي, انا مابيه يطلعها

Link to comment

local gWords = { 
  [ "hi" ] = "hello" 
} 
  
addEventHandler( "onPlayerChat", root, function ( msg ) 
       for i,v in next, ( gWords ) do 
           msg = string.gsub( msg, i, v ) 
        end 
        cancelEvent ( true ) 
        outputChatBox ( "* ".. getPlayerName ( source ) .." : #FFFFFF".. msg, source, 0, 255, 0, true ) 
end ) 
Link to comment
local gWords = { 
  [ "hi" ] = "hello" 
} 
  
addEventHandler( "onPlayerChat", root, function ( msg ) 
       for i,v in next, ( gWords ) do 
           msg = string.gsub( msg, i, v ) 
        end 
        cancelEvent ( true ) 
        outputChatBox ( "* ".. getPlayerName ( source ) .." : #FFFFFF".. msg, source, 0, 255, 0, true ) 
end ) 

طيب ابيه اذا كتب كلام وفيه hi

يطلع نفس الكلام بس يستبدل الـ هاي

مثلا

hi all

يطلع

hello all

Link to comment
هو كذا ... جربته ؟

يب, وحاولت ازبطه بنفسي بس جاني سبام :lol:

addEventHandler( "onPlayerChat", root, function ( msg ) 
       for i,v in next, ( gWords ) do 
       if string.find(msg, v) then --هذي سببت سبام ض1 
           msg = string.gsub( msg, i, v ) 
        end 
        cancelEvent ( true ) 
        outputChatBox ( "* ".. getPlayerName ( source ) .." : #FFFFFF".. msg, source, 0, 255, 0, true ) 
        end 
        end ) 

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