Skip to content

OnPlayerVoiceLevelChange

A player pressed the voice level key and asks for the next level.

level is the level they ask for, previous the one they speak at (both numbered from 1 in the SetVoiceLevels list). Return false to refuse: they stay where they are and nothing shows on their screen - tell them why if you want to. Nothing, nil or true lets the switch through. A player can switch at most five times a second; SetPlayerVoiceLevel does not come here.

function OnPlayerVoiceLevelChange(pid, level, previous)
-- ...
end
Parameter Type
pid number the player
level number the level asked for, from 1
previous number the level they speak at now, from 1

false refuses the switch

-- nobody shouts inside the chapel
function OnPlayerVoiceLevelChange(pid, level, previous)
if GetVoiceLevels()[level].name == "Shout" and IsPlayerInZone(pid, chapel) then
ShowInfoText(pid, "Not in the chapel.", 2500)
return false
end
end

SetVoiceLevels · SetPlayerVoiceLevel · the Voice chat group of the index