Skip to content

Commit

Permalink
don't emit 3dme:sent3dme if it gets blocked
Browse files Browse the repository at this point in the history
  • Loading branch information
AvarianKnight committed Apr 6, 2021
1 parent c5bb3c3 commit 4c7f615
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@ RegisterCommand('me', (source, args) => {
// make sure they're not on cooldown (they could try spamming the command)
if (!meCooldown[source] || meCooldown[source] < GetGameTimer()) {
meCooldown[source] = GetConvarInt('3dme_cooldown', 1500) + GetGameTimer()
// useful for logging
emit('3dme:sent3dme', source, message)

// enable support for pma-voice, if the player has toggled it.
const proximity = Player(source).state.proximity * (GetConvar('voice_useNativeAudio', 'false') === 'true' && 3 || 1)
if (GetConvarInt('3dme_enableProximity', 0) && Math.floor(proximity) > GetConvarInt('3dme_maxRange', 25)) return emit('3dme:voiceRangeExploit', source)

// useful for logging
emit('3dme:sent3dme', source, message)


const plyCoords = GetEntityCoords(GetPlayerPed(source))
const players = getPlayers()
players.forEach((plySrc) => {
Expand Down

0 comments on commit 4c7f615

Please sign in to comment.