MasterWayZ

Function for Local OOC

Jul 28th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.82 KB | None | 0 0
  1. function localOOC(thePlayer, commandName, ...)
  2.     if exports['freecam-tv']:isPlayerFreecamEnabled(thePlayer) then return end
  3.    
  4.     local logged = getElementData(thePlayer, "loggedin")
  5.     local dimension = getElementDimension(thePlayer)
  6.     local interior = getElementInterior(thePlayer)
  7.     local adminTitle = exports.global:getPlayerAdminTitle(thePlayer)
  8.  
  9.     if (logged==1) and not (isPedDead(thePlayer)) then
  10.         local muted = getElementData(thePlayer, "muted")
  11.         if not (...) then
  12.             outputChatBox("SYNTAX: /" .. commandName .. " [Message]", thePlayer, 255, 194, 14)
  13.         elseif (muted==1) then
  14.             outputChatBox("You are currenty muted from the OOC Chat.", thePlayer, 255, 0, 0)
  15.         elseif exports.integration:isPlayerHeadAdmin(thePlayer) and getElementData(thePlayer, "duty_admin") == 1 and getElementData(thePlayer, "hiddenadmin") == 0 then
  16.             local message = table.concat({...}, " ")
  17.             local result, affectedElements = exports.global:sendLocalText(thePlayer, "".. adminTitle .." " ..getPlayerName(thePlayer) .. ": (( " .. message .. " ))", 0, 204, 255)
  18.         elseif exports.integration:isPlayerLeadAdmin(thePlayer) and getElementData(thePlayer, "duty_admin") == 1 and getElementData(thePlayer, "hiddenadmin") == 0 then
  19.             local message = table.concat({...}, " ")
  20.             local result, affectedElements = exports.global:sendLocalText(thePlayer, "".. adminTitle .." " ..getPlayerName(thePlayer) .. ": (( " .. message .. " ))", 214, 51, 51)
  21.         elseif exports.integration:isPlayerSeniorAdmin(thePlayer) and getElementData(thePlayer, "duty_admin") == 1 and getElementData(thePlayer, "hiddenadmin") == 0 then
  22.             local message = table.concat({...}, " ")
  23.             local result, affectedElements = exports.global:sendLocalText(thePlayer, "".. adminTitle .." " ..getPlayerName(thePlayer) .. ": (( " .. message .. " ))", 255, 255, 0)
  24.         elseif exports.integration:isPlayerAdmin(thePlayer) and getElementData(thePlayer, "duty_admin") == 1 and getElementData(thePlayer, "hiddenadmin") == 0 then
  25.             local message = table.concat({...}, " ")
  26.             local result, affectedElements = exports.global:sendLocalText(thePlayer, "".. adminTitle .." " ..getPlayerName(thePlayer) .. ": (( " .. message .. " ))", 255, 194, 14)
  27.         elseif exports.integration:isPlayerTrialAdmin(thePlayer) and getElementData(thePlayer, "duty_admin") == 1 and getElementData(thePlayer, "hiddenadmin") == 0 then
  28.             local message = table.concat({...}, " ")
  29.             local result, affectedElements = exports.global:sendLocalText(thePlayer, "".. adminTitle .." " ..getPlayerName(thePlayer) .. ": (( " .. message .. " ))", 255, 153, 0)
  30.         else
  31.             local message = table.concat({...}, " ")
  32.             local result, affectedElements = exports.global:sendLocalText(thePlayer, getPlayerName(thePlayer) .. ": (( " .. message .. " ))", 196, 255, 255)
  33.         end
  34.     end
  35. end
  36. addCommandHandler("b", localOOC, false, false)
  37. addCommandHandler("LocalOOC", localOOC)
Advertisement
Add Comment
Please, Sign In to add comment