Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2021-02-20, 00:17


Fl!k







Wiek: 26
Na forum: 3733 dni
Posty: 162

Piwa: 18

Respekt: 50

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


Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-02-20, 09:15


MrVip615

witam






Wiek: 22
Na forum: 4448 dni
Posty: 167
Nick w MP: ramzes

Piwa: 207

Respekt: 85,3

Podejrzewam, ze wystarczy usunac w instrukcji warunkowej
getElementData(source, "zombie")


Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-02-21, 19:40


Fl!k







Wiek: 26
Na forum: 3733 dni
Posty: 162

Piwa: 18

Respekt: 50

Niestety nic nie podzia?a?o

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-02-21, 23:53


PatryKK.

Emeryt LUA






Wiek: 27
Na forum: 3202 dni
Posty: 1059
Nick w MP: PatryKK.

Piwa: 2331

Respekt: 331,5
Respekt: 331,5Respekt: 331,5Respekt: 331,5

zmien eldate na taka, ktora okresla gracza

Postaw piwo autorowi tego posta
 

 
Tagi: headshot
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Odpowiedz do tematu

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku