Jump to content

joaoMartins1234545

Members
  • Posts

    4
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

joaoMartins1234545's Achievements

Vic

Vic (3/54)

0

Reputation

  1. Hey there, im using a script for a indication of active voice. So, it should work like this: whenever a player press Z, the dxDrawText changes color. Whenever the player stop talking(pressing Z), the dxDrawText change to the original color. The bug is, im only getting the first color transition, and it keeps like this till I restart the script. Can some one help? local drawDistance = 30 local isPlayerIdVisible = true voiceOn = {} g_StreamedInPlayers = {} function onVoice() if source ~= localPlayer then if isElementStreamedIn(source) then voiceOn[source] = true else voiceOn[source] = false end end end addEventHandler("onClientPlayerVoiceStart", root, onVoice) function offVoice() if source ~= localPlayer then voiceOn[source] = false end end addEventHandler("onClientPlayerVoiceStop", root, offVoice) function onClientRender() local cx, cy, cz, lx, ly, lz = getCameraMatrix() for k, player in pairs(g_StreamedInPlayers) do if isElement(player) and isElementStreamedIn(player) then do local vx, vy, vz = getPedBonePosition(player, 4) local dist = getDistanceBetweenPoints3D(cx, cy, cz, vx, vy, vz) if dist < drawDistance and isLineOfSightClear(cx, cy, cz, vx, vy, vz, true, false, false) then if getElementData(player, 'invisible') then return end local x, y = getScreenFromWorldPosition(vx - 0.10, vy, vz + 0.30) if x and y then local ID = getElementData(player, "ID") or "N/A" local w = dxGetTextWidth(ID, 0.1, "arial") local h = dxGetFontHeight(1, "arial") local color = tocolor(255, 255, 255) dxDrawText("("..ID..")", x - 1 - w / 1, y - 1 - h - 2, w, h, CorTag, 1.20, "arial", "left", "top", false, false, false, false, false) if voiceOn[player] == true then CorTag = tocolor(139, 0, 255) end if voiceOn[player]==false then Cortag = tocolor(255, 255, 255) end end end end else table.remove(g_StreamedInPlayers, k) end end end addEventHandler("onClientRender", getRootElement(), onClientRender)
  2. so, im making a /dv to destroy vehicles and the highlighted 'outputChatBox' isnt working. addCommandHandler("dv", function(playerSource,commandName,id) if isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(playerSource)), aclGetGroup ("Staff")) then --checks ACL local v1 = getElementData(playerSource, "onProt") if v1 == true then -- checks if the player is in the staff mode i created if(id) then local playerID = tonumber(id) if(playerID) then local targetPlayer, targetPlayerName = getPlayerID(playerID) if targetPlayer then local carro = isPedInVehicle(targetPlayer) if carro == true then -- whithout this, the vehicle gets destroyed and the next else message is sent local veh = getPedOccupiedVehicle(targetPlayer) if veh then -- if I get to here, the code destroy the vehicle but doesnt send the message destroyElement(veh) -- destroy the element outputChatBox('O veículo foi destruido!',playerSource) -- but doesnt send this end else outputChatBox("O jogador não está em um Veiculo", playerSource)-- 'next else message' end else outputChatBox('O jogador não existe!',playerSource) -- works fine end else end else local veh = getPedOccupiedVehicle(playerSource) if veh then destroyElement(veh)-- works fine outputChatBox('O veículo foi destruido!',playerSource)-- works fine else outputChatBox("Você não está em um Veiculo", playerSource)-- works fine end end else addBox(playerSource, "Você não está no /staff!", "info")-- works fine end end end ) I havent tested it with other players. This happens whenever I try /dv [my ID], while being in a vehicle Sorry about the title, its ''outputChatBox not working"
  3. The script should work like this: if the player enters a vehicle or just happens to be in (for vehicle spawns etc) - vehicle becomes indestructable when the player leaves the vehicle - vehicle becomes destructable. Can anyone help with that?
×
×
  • Create New...