MitnickP56 Posted October 24, 2016 Share Posted October 24, 2016 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
!#NssoR_) Posted October 24, 2016 Share Posted October 24, 2016 Source The source of this event is the player who sent the chatbox message. Link to comment
MitnickP56 Posted October 24, 2016 Author Share Posted October 24, 2016 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. Link to comment
Walid Posted October 24, 2016 Share Posted October 24, 2016 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
MitnickP56 Posted October 24, 2016 Author Share Posted October 24, 2016 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
Walid Posted October 24, 2016 Share Posted October 24, 2016 1 minute ago, MitnickP56 said: working ty np Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now