Wysłany: 2021-02-20, 00:17
Fl!k
Wiek: 26 Na forum: 3592 dni Posty: 162
Piwa : 18
Witam posiadam skrypt na headshot (dzwiek) jest on jednak podpisany pod zombie a chcialbym aby bylo to na graczy
plik lua:
local sounds = { "sounds/headshot1.mp3" , "sounds/headshot2.mp3" , "sounds/headshot3.mp3" ,}
headshot = true
function Sound ( killer , _ , bodypart )
if not headshot then
headshot = nil
else
if bodypart == 9 and getElementData ( source , "zombie" ) and localPlayer == killer then -- aca comprueba que la muerte sea por headshot , que el ped sea un zombies y que el que mato al ped sea el jugador local
sound = sounds [ math . random ( 1 , #sounds)] -- aca se escoje el sonido al azar de todas las opciones del inicio
soundvolume = playSound ( sound ) setSoundVolume ( soundvolume , 0.5 )
end
end
end
addEventHandler ( "onClientPedWasted" , root , Sound )
function ActivarDesactivar ()
if not headshot then
headshot = true
outputChatBox ( "Sonidos del Headshot activados." , 0 , 255 , 0 )
else
headshot = nil
outputChatBox ( "Sonidos del Headshot desactivados." , 255 , 0 , 0 )
end
end
addCommandHandler ( "headshot" , ActivarDesactivar )
-- Hacer una funcion con un if de / headshot | para desactivarlo y activarlo
Wysłany: 2021-02-20, 09:15
MrVip615
witam
Wiek: 22 Na forum: 4307 dni Posty: 167
Nick w MP: ramzes
Piwa : 207
Podejrzewam, ze wystarczy usunac w instrukcji warunkowej getElementData ( source , "zombie" )
Wysłany: 2021-02-21, 19:40
Fl!k
Wiek: 26 Na forum: 3592 dni Posty: 162
Piwa : 18
Niestety nic nie podzia?a?o
Wysłany: 2021-02-21, 23:53
PatryKK.
Emeryt LUA
Wiek: 26 Na forum: 3061 dni Posty: 1060
Nick w MP: PatryKK.
Piwa : 2322
zmien eldate na taka, ktora okresla gracza
Tagi: headshot
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: