mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-10-14 14:44:55 +02:00
Full Distribution
This commit is contained in:
22
data/chatchannels/scripts/worldchat.lua
Normal file
22
data/chatchannels/scripts/worldchat.lua
Normal file
@@ -0,0 +1,22 @@
|
||||
function onSpeak(player, type, message)
|
||||
local playerAccountType = player:getAccountType()
|
||||
if player:getLevel() == 1 and playerAccountType < ACCOUNT_TYPE_GAMEMASTER then
|
||||
player:sendCancelMessage("You may not speak into channels as long as you are on level 1.")
|
||||
return false
|
||||
end
|
||||
|
||||
if type == TALKTYPE_CHANNEL_Y then
|
||||
if playerAccountType >= ACCOUNT_TYPE_GAMEMASTER then
|
||||
type = TALKTYPE_CHANNEL_O
|
||||
end
|
||||
elseif type == TALKTYPE_CHANNEL_O then
|
||||
if playerAccountType < ACCOUNT_TYPE_GAMEMASTER then
|
||||
type = TALKTYPE_CHANNEL_Y
|
||||
end
|
||||
elseif type == TALKTYPE_CHANNEL_R1 then
|
||||
if playerAccountType < ACCOUNT_TYPE_GAMEMASTER and not getPlayerFlagValue(player, PlayerFlag_CanTalkRedChannel) then
|
||||
type = TALKTYPE_CHANNEL_Y
|
||||
end
|
||||
end
|
||||
return type
|
||||
end
|
Reference in New Issue
Block a user