-
Notifications
You must be signed in to change notification settings - Fork 9
/
peeper.xml
36 lines (29 loc) · 1.1 KB
/
peeper.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?xml version="1.0" encoding="UTF-8"?>
<mod name="peeper" version="1.0" author="slawkens" contact="slawkens@gmail.com" enabled="yes">
<config name="peeper-config"><![CDATA[
-- anonymously or display peeper name?
anonymous = "no"
-- ignore players with access (will not show message when they look on someone)
hiddenAccess = 3
-- message color (type)
messageType = MESSAGE_STATUS_DEFAULT
]]></config>
<event type="look" name="peeper-event" event="script"><![CDATA[
domodlib('peeper-config')
local config = {
anonymous = getBooleanFromString(anonymous),
hiddenAccess = hiddenAccess,
messageType = messageType
}
function onLook(cid, thing, position, lookDistance)
if(isPlayer(thing.uid) and cid ~= thing.uid and getPlayerAccess(cid) < config.hiddenAccess) then
doPlayerSendTextMessage(thing.uid, config.messageType, (config.anonymous and "Someone" or getPlayerName(cid)) .. " is looking at you.")
end
return true
end
]]></event>
<event type="login" name="peeper-login" event="buffer"><![CDATA[
registerCreatureEvent(cid, "peeper-event")
_result = true
]]></event>
</mod>