Event musisz zmieni?, omy?kowo napisa?em z?y event.
Musisz sprawdza? czy pierwszy argument funkcji NaCelowniku (najpierw musisz go zdefiniowa?) to ten ped.
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", -1, false, false )
end
end
addEventHandler( "onClientPlayerTarget", root, NaCelowniku )
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.23, 5.43 )
function NaCelowniku(bot)
if getElementType(bot) == "ped" then
setPedAnimation ( bot, "ped", "handsup", -1, false, false )
end
end
addEventHandler( "onClientPlayerTarget", root, NaCelowniku )
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", -1, false, false )
end
end
addEventHandler( "onClientPlayerTarget", root, NaCelowniku )
Lepiej, ale wystarczy, ?e stoj? przed botem nie celuj?c zmienie bro? i funkcja si? wykona.
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(thePedToCheck) then
if getElementType(thePedToCheck) == "player" or getElementType(thePedToCheck) == "ped" then
if getPedTask(thePedToCheck, "secondary", 0) == "TASK_SIMPLE_USE_GUN" or isPedDoingGangDriveby(thePedToCheck) then
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(localPlayer) then
animacja = setPedAnimation ( bot, "ped", "handsup", -1, false, false )
end
end
end
addEventHandler( "onClientPlayerTarget", root, NaCelowniku )
function isPedAiming (thePedToCheck)
if isElement(thePedToCheck) then
if getElementType(thePedToCheck) == "player" or getElementType(thePedToCheck) == "ped" then
if getPedTask(thePedToCheck, "secondary", 0) == "TASK_SIMPLE_USE_GUN" or isPedDoingGangDriveby(thePedToCheck) then
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(localPlayer) then
animacja = setPedAnimation ( bot, "ped", "handsup", -1, false, false )
end
end
end
addEventHandler( "onClientPlayerTarget", root, NaCelowniku )
Dzi?kuj?, o to w?a?nie chodzi?o!
Wszystkim zaanga?owanym stawiam piwka
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