Jump to content

onPlayerChat


Nasa47

Recommended Posts

Posted
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) 

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

Posted
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) 

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

Posted

كود مجنون فيك ضبط بس ابيه اذا كتب كلمه مع الكلمات اللي بالجدول يسوي الامر

مثلا :

اذا كتبت hi all

يطلع hello all

Posted
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) 

Posted

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 ) 
Posted
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: كودك يطلع الكلام مرتين انا ابي اذا كتبت هاي يطلع هيلو

Posted
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

...

Posted

يَ ناااس افهمووا

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

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

Posted
يَ ناااس افهمووا

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

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

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

Posted
يَ ناااس افهمووا

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

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

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

كم انا غبي :lol:

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

hi

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

Posted
يَ ناااس افهمووا

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

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

Posted

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 ) 
Posted
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

Posted
هو كذا ... جربته ؟

يب, وحاولت ازبطه بنفسي بس جاني سبام :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 ) 

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