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

Wysłany: 2020-04-24, 03:31


Irvs







Wiek: 30
Na forum: 2680 dni
Posty: 48

Piwa: 3

Respekt: 50

Cze??, jaki event u?y? by aktywowa? si? gdy wyceluj? do PEDa z broni?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-04-24, 08:22


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8


Więcej informacji znajdziesz w Wikipedii MTA:

onClientTarget


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Irvs
Wysłany: 2020-04-24, 14:44


Irvs







Wiek: 30
Na forum: 2680 dni
Posty: 48

Piwa: 3

Respekt: 50

"Wilq" napisał/a:


Więcej informacji znajdziesz w Wikipedii MTA:

onClientTarget


To nie to.


ped createPed 85, -11.32, -360.235.43 )
function NaCelowniku()
    setPedAnimation ped"ped""handsup", -1falsefalse )
end
addEventHandler"onClientTarget"pedNaCelowniku )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-04-24, 15:07


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8


Więcej informacji znajdziesz w Wikipedii MTA:

onClientPlayerTarget


drugi argument addEventHandler daj root, dopiero 1 argument funkcji to ped nacelowany.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-04-24, 15:16


Irvs







Wiek: 30
Na forum: 2680 dni
Posty: 48

Piwa: 3

Respekt: 50

Nadal nic si? nie zmieni?o.

ped createPed 85, -11.32, -360.235.43 )
function NaCelowniku()
    setPedAnimation ped"ped""handsup", -1falsefalse )
end
addEventHandler"onClientTarget"rootNaCelowniku )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-04-24, 15:37


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Event musisz zmieni?, omy?kowo napisa?em z?y event.
Musisz sprawdza? czy pierwszy argument funkcji NaCelowniku (najpierw musisz go zdefiniowa?) to ten ped.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-04-24, 16:54


Irvs







Wiek: 30
Na forum: 2680 dni
Posty: 48

Piwa: 3

Respekt: 50

"Wilq" napisał/a:

Event musisz zmieni?, omy?kowo napisa?em z?y event.
Musisz sprawdza? czy pierwszy argument funkcji NaCelowniku (najpierw musisz go zdefiniowa?) to ten ped.


U?y?em onClientPlayerTarget
Bot zwraca warto?? logiczn?, podnosi r?ce, lecz nie tylko gdy w niego celuj?.


bot createPed 85, -11.32, -360.235.43 )
function NaCelowniku(bot)
if getElementType(bot) == "ped" then
    setPedAnimation bot"ped""handsup", -1falsefalse )
    end
end
addEventHandler"onClientPlayerTarget"rootNaCelowniku )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-04-24, 19:40


kamison

Przyszły programista .lua






Wiek: 25
Na forum: 3302 dni
Posty: 391
Nick w MP: kamison

Piwa: 594

Respekt: 205,3
Respekt: 205,3Respekt: 205,3

"Irvs" napisał/a:

"Wilq" napisał/a:

Event musisz zmieni?, omy?kowo napisa?em z?y event.
Musisz sprawdza? czy pierwszy argument funkcji NaCelowniku (najpierw musisz go zdefiniowa?) to ten ped.


U?y?em onClientPlayerTarget
Bot zwraca warto?? logiczn?, podnosi r?ce, lecz nie tylko gdy w niego celuj?.


bot createPed 85, -11.32, -360.235.43 )
function NaCelowniku(bot)
if getElementType(bot) == "ped" then
    setPedAnimation bot"ped""handsup", -1falsefalse )
    end
end
addEventHandler"onClientPlayerTarget"rootNaCelowniku )


Pa mo?e to zatrybi

bot createPed 85, -304.6318359375,1323.9111328125,54.308280944824 )
function NaCelowniku(target)
    if target == localPlayer then return end
    if target == bot and not animacja then
        animacja setPedAnimation bot"ped""handsup", -1falsefalse )
    end
end
addEventHandler"onClientPlayerTarget"rootNaCelowniku )


Podpis
Coś tam kiedyś robiłem.

DC: kamison_.
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Irvs
Wysłany: 2020-04-24, 20:22


Irvs







Wiek: 30
Na forum: 2680 dni
Posty: 48

Piwa: 3

Respekt: 50

"kamison" napisał/a:

"Irvs" napisał/a:

"Wilq" napisał/a:

Event musisz zmieni?, omy?kowo napisa?em z?y event.
Musisz sprawdza? czy pierwszy argument funkcji NaCelowniku (najpierw musisz go zdefiniowa?) to ten ped.


U?y?em onClientPlayerTarget
Bot zwraca warto?? logiczn?, podnosi r?ce, lecz nie tylko gdy w niego celuj?.


bot createPed 85, -11.32, -360.235.43 )
function NaCelowniku(bot)
if getElementType(bot) == "ped" then
    setPedAnimation bot"ped""handsup", -1falsefalse )
    end
end
addEventHandler"onClientPlayerTarget"rootNaCelowniku )


Pa mo?e to zatrybi

bot createPed 85, -304.6318359375,1323.9111328125,54.308280944824 )
function NaCelowniku(target)
    if target == localPlayer then return end
    if target == bot and not animacja then
        animacja setPedAnimation bot"ped""handsup", -1falsefalse )
    end
end
addEventHandler"onClientPlayerTarget"rootNaCelowniku )


Lepiej, ale wystarczy, ?e stoj? przed botem nie celuj?c zmienie bro? i funkcja si? wykona.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-04-24, 20:47


NotPaladyn







Wiek: 23
Na forum: 2790 dni
Posty: 866
Nick w MP: NotPaladyn

Piwa: 3135

Respekt: 690
Respekt: 690Respekt: 690


   Vice Admin: Jeśli potrzebujesz pomocy w sprawach organizacyjnych lub technicznych - skontaktuj się ze mną.
Wystarczy doda? "isPedAiming", trzymaj kod:


function isPedAiming (thePedToCheck)
    if isElement(thePedToCheckthen
        if getElementType(thePedToCheck) == "player" or getElementType(thePedToCheck) == "ped" then
            if getPedTask(thePedToCheck"secondary"0) == "TASK_SIMPLE_USE_GUN" or isPedDoingGangDriveby(thePedToCheckthen
                return true
            end
        end
    end
    return false
end

bot createPed 85, -304.6318359375,1323.9111328125,54.308280944824 )
function NaCelowniku(target)
    if target == localPlayer then return end
    if target == bot and not animacja then
    if isPedAiming(localPlayerthen
        animacja setPedAnimation bot"ped""handsup", -1falsefalse )
    end
    end
end
addEventHandler"onClientPlayerTarget"rootNaCelowniku )


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Irvs
Wysłany: 2020-04-24, 22:20


Irvs







Wiek: 30
Na forum: 2680 dni
Posty: 48

Piwa: 3

Respekt: 50

"NotPaladyn" napisał/a:

Wystarczy doda? "isPedAiming", trzymaj kod:


function isPedAiming (thePedToCheck)
    if isElement(thePedToCheckthen
        if getElementType(thePedToCheck) == "player" or getElementType(thePedToCheck) == "ped" then
            if getPedTask(thePedToCheck"secondary"0) == "TASK_SIMPLE_USE_GUN" or isPedDoingGangDriveby(thePedToCheckthen
                return true
            end
        end
    end
    return false
end

bot createPed 85, -304.6318359375,1323.9111328125,54.308280944824 )
function NaCelowniku(target)
    if target == localPlayer then return end
    if target == bot and not animacja then
    if isPedAiming(localPlayerthen
        animacja setPedAnimation bot"ped""handsup", -1falsefalse )
    end
    end
end
addEventHandler"onClientPlayerTarget"rootNaCelowniku )


Dzi?kuj?, o to w?a?nie chodzi?o!
Wszystkim zaanga?owanym stawiam piwka :)

Postaw piwo autorowi tego posta
 

 
Tagi: event :: dla :: peda
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Event dla Peda Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

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