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: 3592 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 == 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(soundsetSoundVolume(soundvolume,0.5)
        end
    end    
end
addEventHandler("onClientPedWasted",rootSound)

function ActivarDesactivar()
    if not headshot then
        headshot true
        outputChatBox("Sonidos del Headshot activados."02550)
        else
        headshot nil
        outputChatBox("Sonidos del Headshot desactivados."25500)
    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: 4307 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: 3592 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: 26
Na forum: 3061 dni
Posty: 1060
Nick w MP: PatryKK.

Piwa: 2322

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