LauraCC69 Posted September 1, 2020 Share Posted September 1, 2020 hey there , so i got a radio script but chat and instead of chat i want to make it voice lemme give u the chat exemple This script is used to join a channel ( frequence ) and saved to the database and at the same time to verify if the player have the item 86(radio) or not ```function tuneRadio(player,command,freki) if getElementData(player,"loggedIn") then if not tonumber(freki) or not freki or not math.floor(tonumber(freki)) then outputChatBox(exports.fv_engine:getServerSyntax("Use","red").."/"..command.." [Frequency]",player,255,255,255,true); return; end local freki = math.floor(tonumber(freki)); if exports.fv_inventory:hasItem(player,86) then setElementData(player,"char >> radiof",freki); outputChatBox(exports.fv_engine:getServerSyntax("Chat","servercolor").."You have successfully set the frequency of your radio! Frequency: "..exports.fv_engine:getServerColor("servercolor",true)..freki..white..".",player,255,255,255,true); else outputChatBox(exports.fv_engine:getServerSyntax("Chat","red").."You don't have a radio!",player,255,255,255,true); end end end addCommandHandler("tuneradio",tuneRadio,false,false); ``` And this script is used to chat in the radio chat between the players in the same radio frequence or channel function sendRadio(player,command,...) if getElementData(player,"loggedIn") then if (getElementData(player,"char >> radiof") or 0) == 0 then outputChatBox(exports.fv_engine:getServerSyntax("Chat","red").."No radio frequency is set",player,255,255,255,true); return; end local msg = table.concat({...}, " "); if exports.fv_inventory:hasItem(player,86) then for k,v in pairs(getElementsByType("player")) do if getElementData(v,"loggedIn") then if getElementData(player,"char >> radiof") == getElementData(v,"char >> radiof") then outputChatBox("#00D0FF" .. getElementData(player,"char >> name") .. " says (radio): ".. msg, v, 255, 255, 255, true); triggerClientEvent(v,"radio.sound",v); end end end local x,y,z = getElementPosition(player); for k,v in pairs(getElementsByType("player",_,true)) do if not isPedDead(v) and v ~= player then local x1,y1,z1 = getElementPosition(v); local distance = getDistanceBetweenPoints3D(x,y,z,x1,y1,z1); if distance < 10 then if getElementDimension(player) == getElementDimension(v) and getElementInterior(player) == getElementInterior(v) then outputChatBox(getElementData(player,"char >> name") .. " says (radio): ".. msg, v, 255, 255, 255, true); triggerClientEvent(v,"radio.sound",v); end end end end else outputChatBox(exports.fv_engine:getServerSyntax("Chat","red").."You don't have a radio!",player,255,255,255,true); end end end addCommandHandler("r",sendRadio,false,false); addCommandHandler("Rádió",sendRadio,false,false); So what i want to do is when a player selects a channel instead of type /r and write in the radio chat he will be able to voice chat in it for exemple i type /r to get my radio on using dxdrawimage and talk and when i want to stop it ill do the same command and the dx will get off thanks Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now