在普通频道输入字符串如果是pi,则给出信息~!
- print("PLAYER_EVENT_ON_CHANNEL_CHAT.lua ............................OK")
-
- local PI=3.1415926
-
- local PlayerEventOnChannelChat=function(event, player, msg, _ , lang)
-
- if(msg=="pi") then
- local r=10
- s=PI*r*r
- player:SendBroadcastMessage("r = " .. tostring(r))
- player:SendBroadcastMessage("Area = " .. tostring(s))
- str = string.format("我叫:" .. player:GetName() .. "答案是: " .."|cFFFF0000 %s |r",tostring(s));
- player:SendAreaTriggerMessage(str);
-
- end
- end
- RegisterPlayerEvent(18,PlayerEventOnChannelChat)