Jump to content

fairyoggy

Members
  • Posts

    269
  • Joined

  • Last visited

Everything posted by fairyoggy

  1. OK, everything is great Another caveat, how to deal with this? For example, you are 14 meters from the player, he pressed a button - you see his inscription - everything is fine If he presses the button, and at that time you will have another 5 meters from him, that is, there will already be 19 meters You will have an inscription (this is on the condition that he has the button still clamped), can it be done so when the player has the button clamped and you go beyond 15 meters the inscription disappears?
  2. The main thing that you could help, thanks! Another question, need to make this inscription appear within 15 meters. I mean, now any player will click on the microphone button and it will display what he says BUT i need so that it is displayed within 15 meters of the player. For example, on the server 3 people. 2 players are together and the third is in a different place. If a third player will talk, the first and second should not see the inscription because they are far from the player. and the first and second players will see each other's inscriptions. I hope I correctly explained what I need. Can you help me with this?
  3. Yes, but as far as I understand, this is not properly done.
  4. dxDrawText ("Talk:".. getPlayerName (["..v[1] .."]" .."["..v[2] .."]",x*(27/sx),i*30+y*(341/sy),x*(294/sx),i*30+y*(376/sy), tocolor ( 255 , 255 , 255 , 255 ), 1,00 , "default-bold" , "esquerda" , "top" , falso , falso , falso , falso , falso ) What do you have with a line?!
  5. Your code is no different from the previous one. In addition to errors
  6. It works like I wanted, BUT if 1 player presses the microphone 2 times, or will press and press several times, there will be such a problem and if you let go of the microphone button, the upper inscription will remain, and the lower one will disappear How to fix it? For one player, the inscription must be one
  7. Made a label appear with a player's nickname who say in voice chat. But if you use such code. it will be bad when they talk a lot of players. How can I make sure that when several people speak at the same time they create several lines with their names? vv = guiCreateLabel(17,170,170,30,"",false) guiSetVisible(vv,false) addEventHandler ( "onClientPlayerVoiceStart", root, function() local name = getPlayerName(getLocalPlayer()) local p_id = getElementData ( source, "ID" ) voicePlayers[source] = true guiSetText(vv,"Talk: "..name.." ["..p_id.."]") guiSetFont(vv,myfont) guiSetVisible(vv,true) end ) addEventHandler ( "onClientPlayerVoiceStop", root, function() voicePlayers[source] = nil guiSetVisible(vv,false) end ) In the screenshot, I marked the numbers. This, for example, if 4 players are talking at the same time
  8. but how to do if a player changes his nickname; he is again assigned a nickname "Alex_Hunter" ? I mean, if a player changes to some other nickname, he will again give the name Alex_Hunter
  9. fairyoggy

    ChangeNick

    How to forcibly change the nickname of the player? For example, a player logged on to the server and the nickname is changed to "Alex_Hunter"
  10. @HassoN ye it's work Thank you! @HassoN what's about this green target ? I mean when the right mouse button selects the player a green mark appears. Can this be removed?
  11. @HassoN I see no change I mean, the nickname of the player who type command does not disappear.
  12. @HassoN nickname player(who type this command) is not hiding but now he sees the nicknames of other players (before they disappeared)
  13. --server iv = 0 function toggleInvis( source ) if iv == 0 then iv = 1 setElementAlpha(source, 0) triggerClientEvent(source, "invis", source) else iv = 0 setElementAlpha(source, 255) triggerClientEvent(source, "invisoff", source) end end addCommandHandler ( "invisible", toggleInvis ) --client local visiblename = true local drawDistance = 15 g_StreamedInPlayers = {} 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, 8) local dist = getDistanceBetweenPoints3D(cx, cy, cz, vx, vy, vz) if dist < drawDistance and isLineOfSightClear(cx, cy, cz, vx, vy, vz, true, false, false) then local x, y = getScreenFromWorldPosition(vx, vy, vz + 0.3) if x and y then local name = getPlayerName(player) local id = getElementData ( player, "ID", s_id ) local w = dxGetTextWidth(name, 1, "default-bold") local h = dxGetFontHeight(1, "default-bold") local fname = getElementData(player,"fname") local sname = getElementData(player,"sname") local hp = getElementData(player,"lastDamage") if visiblename == false then return end if visiblename == true then dxDrawText("#FFFFFF"..fname.." "..sname.."#1E90FF ["..id.."]", x - 2 - w / 4, y - 0 - h - 12, w, h, tocolor(255, 0, 0), 1, "default-bold","left","top",false,false,false,true) end local health = getElementHealth(player) local armour = getPedArmor(player) if health > 0 then local rate = 500 / getPedStat(player, 24) drawHPBar(x, y - 6, health * rate, dist) if armour > 0 then drawArmourBar(x, y - 12, armour, dist) end end end end end else table.remove(g_StreamedInPlayers, k) end end end addEventHandler("onClientRender", root, onClientRender) function invis() visiblename = false end addEvent( "invis", true ) addEventHandler( "invis", localPlayer, invis ) function invisoff() visiblename = true end addEvent( "invisoff", true ) addEventHandler( "invisoff", localPlayer, invis ) function onClientElementStreamIn() if getElementType(source) == "player" and source ~= getLocalPlayer() then setPlayerNametagShowing(source, false) table.insert(g_StreamedInPlayers, source) end end addEventHandler("onClientElementStreamIn", root, onClientElementStreamIn) function onClientResourceStart(startedResource) visibleTick = getTickCount() counter = 0 normalhealthbar = false local players = getElementsByType("player") for k, v in pairs(players) do if isElementStreamedIn(v) and v ~= getLocalPlayer() then setPlayerNametagShowing(v, false) table.insert(g_StreamedInPlayers, v) end end end addEventHandler("onClientResourceStart", resourceRoot, onClientResourceStart) I'm trying to make a command for invisible. For example, a player enters a command and becomes invisible. - Done need to hide the nickname only this player(who type this command). but I can only hide the nicknames of all players Can you help me for fix it? I am the player who entered this command.I do not see the nicknames of players but they see
  14. --client addEventHandler("onClientResourceStart", getResourceRootElement(), function() for i,v in pairs (getElementsByType("player")) do setPedVoice(v, "PED_TYPE_DISABLED", "nil") end end ) function refresz() for i,v in pairs (getElementsByType("player")) do setPedVoice(v, "PED_TYPE_DISABLED", "nil") end end addEvent( "refresz", true ) addEventHandler( "refresz", v, refresz ) --server local root = getRootElement() addEventHandler("onPlayerWasted", root, function () for i,v in pairs (getElementsByType("player")) do triggerClientEvent(v, "refresz", v) end end ) addEventHandler("onPlayerLogin", getRootElement(), function (_,account) for i,v in pairs (getElementsByType("player")) do triggerClientEvent(v, "refresz", v) end end ) Voices should not be but other players hear the local player(the one who keeps the server) How to make so that voices do not exist for all players? What needs to be changed in this code?
  15. And at the level of the code can not change any binds? The same, for example, moving forward "W"
  16. so ... code level can not change the bind for voice chat?
  17. Is the person from the top wrong or misunderstood?
  18. Могу ли я на уровне кода изменить бинд? Т.е есть бинд на войс чат, который настраивается в самих настройках МТА, на кнопку Z. Могу ли я на уровне кода изменить этот бинд, например, на кнопку X. Что то типо поставить на событие, когда игрок залогинился и ему поменялась кнопка?
  19. I just have to write it in meta.xml(voice script ) ?? <settings>set("keyBind", "X")</settings> and a button instead "Z" will become "X" or I again misunderstood?
  20. Can you tell me more about it? I do not understand how it can be used in my situation .
  21. fairyoggy

    voice bind

    How to change the button(voice)? By standard it's "Z" button. How to change this at the code level, and not in the settings of mta ? For example, when a player connect to the server and it automatically changes the button to the selected one(in code)
  22. @Investor How to change a voice to a specific skin? function voice1(player) local model = getElementModel(player) if model == 99 then setPedVoice(player, "PED_TYPE_GANG", "VOICE_GNG_MACCER") return end so right?
  23. fairyoggy

    Ped voice

    Can I change or delete voice for ped? Each skin has its own voice or group skins have one voice. I dont know about it. I mean when you hit a player or pushed ped. He starts talking. There is a possibility?
×
×
  • Create New...