Jump to content

Problem with little script on chat


MitnickP56

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)

Link to comment

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)

 

Link to comment
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

 

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