Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Jelle
- function vctChat(thePlayer, commandName, ...)
- local logged = getElementData(thePlayer, "loggedin")
- if(logged==1) and exports.integration:isPlayerVCTMember(thePlayer) then
- if not (...) then
- outputChatBox("SYNTAX: /".. commandName .. " [Message]", thePlayer, 255, 194, 14)
- else
- if getElementData(thePlayer, "hideVCTChat") then
- setElementData(thePlayer, "hideVCTChat", false)
- outputChatBox("VCT Chat - SHOWING",thePlayer)
- end
- local affectedElements = { }
- local message = table.concat({...}, " ")
- local players = exports.pool:getPoolElementsByType("player")
- local adminTitle = exports.global:getPlayerAdminTitle(thePlayer)
- local playerid = getElementData(thePlayer, "playerid")
- local accountName = getElementData(thePlayer, "account:username")
- for k, arrayPlayer in ipairs(players) do
- local logged = getElementData(arrayPlayer, "loggedin")
- if logged==1 and exports.integration:isPlayerVCTMember(thePlayer) then
- local hideVCTChat = getElementData(arrayPlayer, "hideVCTChat")
- if hideVCTChat then
- local string = string.lower(message)
- local account = string.lower(getElementData(arrayPlayer, "account:username"))
- if string.find(string, account) then
- table.insert(affectedElements, arrayPlayer)
- triggerClientEvent ( "playNudgeSound", arrayPlayer)
- outputChatBox("Mentioned in /v chat - "..accountName..": "..message, arrayPlayer)
- end
- else
- table.insert(affectedElements, arrayPlayer)
- outputChatBox("[VCT] ("..getElementData(thePlayer, "playerid")..") "..(exports.integration:isPlayerVehicleConsultant(thePlayer) and "Leader" or "Member" ).." " .. accountName .. " : " .. message, arrayPlayer, 222, 222, 31)
- end
- end
- end
- exports.logs:dbLog(thePlayer, 4, affectedElements, "VCT chat - Msg: "..message)
- end
- end
- end
- addCommandHandler( "v", vctChat, false, false)
- addCommandHandler( "vct", vctChat, false, false)
- -- Jelle
- function toggleVCTChat(thePlayer, commandName)
- local logged = getElementData(thePlayer, "loggedin")
- if logged==1 and isPlayerStaff(thePlayer) then
- local hideVCTChat = getElementData(thePlayer, "hideVCTChat") or false
- setElementData(thePlayer, "hideVCTChat", not hideVCTChat)
- outputChatBox("VCT Chat - "..(hideVCTChat and "SHOWING" or "HIDDEN").." /"..commandName.." to toggle it.",thePlayer)
- end
- end
- addCommandHandler("togglevct", toggleVCTChat, false, false)
- addCommandHandler("togv", toggleVCTChat, false, false)
- addCommandHandler("togglev", toggleVCTChat, false, false)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement