function main()
repeat
printStringNow('loading',500)
hnd = loadAudioStream(getWorkingDirectory()..'\\resource\\sound\\'..'1.wav')
wait(100)
if not hnd then
if not doesDirectoryExist(getWorkingDirectory()..'\\resource') or not doesDirectoryExist(getWorkingDirectory()..'\\resource\\sound\\') then
if createDirectory(getWorkingDirectory()..'\\resource\\sound\\') then
printStringNow('new folder created',500)
end
end
downloadUrlToFile('https://www.dropbox.com/s/y0lf1c465md9zwz/5.wav?dl=1',getWorkingDirectory()..'\\resource\\sound\\'..'1.wav')
while not doesFileExist(getWorkingDirectory()..'\\resource\\sound\\'..'1.wav') do wait(0);printStringNow('downloading',500) end
end
until hnd
while true do wait(0)
if isPlayerPlaying(PLAYER_HANDLE) then
ch = getAllChars()
for _, v in pairs(ch) do
if hasCharBeenDamagedByChar(v,PLAYER_PED) then
setAudioStreamState(hnd, 1)
clearCharLastDamageEntity(v)
end
end
end
end
end