Sign in to follow this  
MitnickP56

Problem with little script on chat

Recommended Posts

Hi.

I'm trying to create script which doing outputChatBox when GUY from name/serial will say smth on chat box. My code:

serialhaza = {
["2B2BEE3C8B7C95BA25F714E7867557F2"] = true
}
function nahaza(thePlayer)
local hazik = string.find(getPlayerName(thePlayer), "Haze", 1, true)
if  hazik or serialhaza[getPlayerSerial(thePlayer)]then
outputChatBox("haz ciapaty pedal",thePlayer)
end
end   
addEventHandler("onPlayerChat",root,nahaza)

Share this post


Link to post
6 minutes ago, NssoR said:

Source

The source of this event is the player who sent the chatbox message.

Yes. I'm tried now to change source-> theplayer and nothing. I have no idea how the fix it.

Share this post


Link to post

Try this 

local serialhaza = {
   ["2B2BEE3C8B7C95BA25F714E7867557F2"] = true
}

function nahaza(message, messageType)
    if messageType == 0 then 
        local hazik = string.find(getPlayerName(source), "Haze", 1, true)
        if  hazik or serialhaza[getPlayerSerial(source)] then
            outputChatBox("haz ciapaty pedal",source)
        end
    end 
end   
addEventHandler("onPlayerChat",root,nahaza)

 

Share this post


Link to post
1 hour ago, Walid said:

Try this 


local serialhaza = {
   ["2B2BEE3C8B7C95BA25F714E7867557F2"] = true
}

function nahaza(message, messageType)
    if messageType == 0 then 
        local hazik = string.find(getPlayerName(source), "Haze", 1, true)
        if  hazik or serialhaza[getPlayerSerial(source)] then
            outputChatBox("haz ciapaty pedal",source)
        end
    end 
end   
addEventHandler("onPlayerChat",root,nahaza)

 

working ty

 

Share this post


Link to post

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.