Jump to content

CowBoy69

Members
  • Content Count

    4
  • Joined

  • Last visited

Community Reputation

1 Neutral

About CowBoy69

  • Rank
    Vic

Details

  • Interests
    Lua, MTA
  1. WOW, AMAZING! It works! Thank you so much! No words By the way, first the server script issued a warning. But, then, one of my friends showed me a mistake, and everything works! Here's how it should look right: function say1Command ( playerSource, commandName ) triggerClientEvent (root, "onSay1", playerSource) end addCommandHandler ( "say1", say1Command ) [The topic is closed, thank you very much]
  2. Everything works, thanks a lot. But I, the idiot, forgot to say more: it is necessary that this sound is heard by the nearest player near the one who reproduced the sound. I tried to do the following: Created a script say1_s.lua (server): function say1Command ( playerSource, commandName ) triggerClientEvent ( "onSay1", root) end addCommandHandler ( "say1", say1Command ) and created a script say1_c.lua (client): local sound function onSay1() if isElement(sound) then stopSound (sound) end local x, y, z = getElementPosition(localPlayer) sound = playSou
  3. If I'm not mistaken, then, like, I should have done this: function say1(source,x,y,z) if (source and x and y and z) then local x,y,z = getElementPosition(source) if (x and y and z) then sound = playSound3D('say1.mp3',x,y,z) attachElements (sound,source) setSoundMaxDistance(sound,25) end end end addCommandHandler('say1',say1,source,x,y,z) But, anyway, the sound does not play. Can you show how to define variables x, y, z?
  4. The essence of the script: The player enters the /say1 command and the sound is played inside the player. But when I enter this command, the sound does not play. There are no warnings and errors in the log. What could be the problem? Script: function say1(source) if (source) and x and y and z then local x,y,z = getElementPosition(source) if x and y and z then sound = playSound3D('say1.mp3',x,y,z) attachElements (sound,source) setSoundMaxDistance(sound,25) end end end addCommandHandler('say1',say1) meta.xml: <meta> <scrip
×
×
  • Create New...