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

Wysłany: 2015-07-14, 21:15


Given







Wiek: 31
Na forum: 4158 dni
Posty: 31
Nick w MP: Given

Piwa: 1

Respekt: 50

Ostrzeżeń: 100%
Witam mam problem poniewasz u?ywam tego kodu:
clinent
Kod:


local cFunc = {}
local cSetting = {}

cSetting["shots"] = {}
cSetting["shot_calcs"] = {}
local last_shot = 1
-- FUNCTIONS --


cFunc["render_shots"] = function()
for index, tbl in pairs(cSetting["shots"]) do
dxDrawFuckedLine3D(tbl[1], tbl[2], tbl[3], tbl[4], tbl[5], tbl[6], tocolor(0, 255, 0))
end
end

cFunc["draw_shot"] = function(x1, y1, z1, x2, y2, z2)
table.insert(cSetting["shots"], last_shot, {x1, y1, z1, x2, y2, z2})
-- SHOT CALCULATING
local lastx, lasty, lastz = x1, y1, z1
local dis = getDistanceBetweenPoints3D(x1, y1, z1, x2, y2, z2)
cSetting["shot_calcs"][last_shot] = {}

for i = 1, dis, 0.5 do
-- cSetting["shot_calcs"][i] = nx, ny, nz
-- cSetting["shot_calcs"][last_shot][i] =
end
last_shot = last_shot+1
end

cFunc["shot_weapon"] = function(hitX, hitY, hitZ, x, y, z)
playSound3D("data/Fire.wav", x, y, z)
local s = playSound3D("data/Fire.wav", hitX, hitY, hitZ)
setSoundMaxDistance(s, 50)
for i = 1, 5, 1 do
fxAddPunchImpact(hitX, hitY, hitZ, 0, 0, 0)
fxAddSparks(hitX, hitY, hitZ, 0, 0, 0, 8, 1, 0, 0, 0, true, 3, 1)
end
cFunc["draw_shot"](x, y, z, hitX, hitY, hitZ)
fxAddPunchImpact(x, y, z, 0, 0, -3)
end

cFunc["wait_shot"] = function()
toggleControl("fire", false)
setTimer(function()
toggleControl("fire", true)
end, 350, 1)
end

cFunc["shot_check"] = function(wp, _, _, hitX, hitY, hitZ, element, startX, startY, startZ)
if(wp == 24) then
cFunc["shot_weapon"](hitX, hitY, hitZ, startX, startY, startZ)
if(source == localPlayer) then
cFunc["wait_shot"]()
end
end
end

dxDrawFuckedLine3D = function(x1, y1, z1, x2, y2, z2, color)
local dis = getDistanceBetweenPoints3D(x1, y1, z1, x2, y2, z2)
local lastx, lasty, lastz = x1, y1, z1
--for i = 1, dis, 3 do
-- dxDrawLine3D(x1, y1, z1, x2, y2, z2)
--end
end

cFunc["anim_check"] = function(_, wep, bodypart)
if(wep == 24) and (bodypart == 9) then
setPedAnimation(source, "ped", "KO_shot_face", 10000, false, true, false)
elseif(wep == 24) and (bodypart == 8) then
setPedAnimation(source, "CRACK", "crckdeth2", 10000, false, true, false)
elseif(wep == 24) and (bodypart == 7) then
setPedAnimation(source, "CRACK", "crckdeth2", 10000, false, true, false)
elseif(wep == 24) and (bodypart == 6) then
setPedAnimation(source, "CRACK", "crckdeth2", 10000, false, true, false)
elseif(wep == 24) and (bodypart == 5) then
setPedAnimation(source, "CRACK", "crckdeth2", 10000, false, true, false)
elseif(wep == 24) and (bodypart == 4) then
setPedAnimation(source, "CRACK", "crckdeth3", 10000, false, true, false)
elseif(wep == 24) and (bodypart == 3) then
setPedAnimation(source, "ped", "KO_shot_stom", 10000, false, true, false)
elseif(wep == 24) and (bodypart == 2) then
setPedAnimation(source, "CRACK", "crckdeth2", 10000, false, true, false)
elseif(wep == 24) and (bodypart == 1) then
setPedAnimation(source, "CRACK", "crckdeth2", 10000, false, true, false)

end
end

-- EVENT HANDLER --

addEventHandler("onClientPlayerWeaponFire", getRootElement(), cFunc["shot_check"])
addEventHandler("onClientRender", getRootElement(), cFunc["render_shots"])
addEventHandler("onClientPedDamage", getRootElement(),cFunc["anim_check"])
addEventHandler("onClientPlayerDamage", getRootElement(),cFunc["anim_check"])

i mam problem poniewasz niby jest anim jak kogos strzele ze le?y ale jak kto? naci?nie ENTER to moze sobie dalej biegac czy mo?na to jako? zatrzyma? ?
np
freeze 1 min ?
Bardzo prosze o pomoc je?eli kto? by umia? dorobi? do tego kodu te freeze na 1 min to bym by? bardzo wdzi?czny i dam :piwo:
lol

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-14, 21:46


jg2aviva1

Rusek :D






Wiek: 25
Na forum: 4134 dni
Posty: 445
Nick w MP: _Wolfenstei[N]^.^

Piwa: 1033

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%
M?g?by? zrobi? tak, ?e ta animacja si? uruchamia po tym, kiedy graczowi zostan? zadane obra?enia, bo wtedy wystarczy zrobi? taki kr?tki kod. Ale ma to te? swoje minusy, bo jak upadniesz z wysoko?ci to te? si? wtedy w??czy :x .

Taka moja uwaga :)

Podpis



GTAO Member: 2015-08-23, 14:26

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-14, 21:53


Maximerr

Programmer PHP, LUA






Wiek: 25
Na forum: 4427 dni
Posty: 548

Piwa: 1051

Respekt: 365,3
Respekt: 365,3Respekt: 365,3Respekt: 365,3Respekt: 365,3

Given, da si? tak.
-> Zamra?anie gracza.

Więcej informacji znajdziesz w Wikipedii MTA:

setElementFrozen


-> Ustawianie czasu do kiedy ma by? zamro?ony.

Więcej informacji znajdziesz w Wikipedii MTA:

setTimer


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-14, 21:56


Given







Wiek: 31
Na forum: 4158 dni
Posty: 31
Nick w MP: Given

Piwa: 1

Respekt: 50

Ostrzeżeń: 100%
Dobrze sprubuje to zrobi? i dam zna? czy sie uda?o

[ Dodano: 2015-07-14, 22:09 ]
Niestety nie dzia?a podmieni?em zamias amin dalem takie cos:
Kod:

cFunc["shot_check"] = function(wp, _, _, hitX, hitY, hitZ, element, startX, startY, startZ)
if(wp == 24) then
cFunc["shot_weapon"](hitX, hitY, hitZ, startX, startY, startZ)
if(source == localPlayer) then
cFunc["wait_shot"]()
end
end
end

dxDrawFuckedLine3D = function(x1, y1, z1, x2, y2, z2, color)
local dis = getDistanceBetweenPoints3D(x1, y1, z1, x2, y2, z2)
local lastx, lasty, lastz = x1, y1, z1
--for i = 1, dis, 3 do
-- dxDrawLine3D(x1, y1, z1, x2, y2, z2)
--end
end

function toggleFreezeStatus ( thePlayer )
if getPedOccupiedVehicle ( thePlayer ) then
local playerVehicle = getPlayerOccupiedVehicle ( thePlayer )
local currentFreezeStatus = isElementFrozen ( playerVehicle )
local newFreezeStatus = not currentFreezeStatus
setElementFrozen ( playerVehicle, newFreezeStatus )
setTimer ( Freeze, 60000, 0)
end
end

-- EVENT HANDLER --

addEventHandler("onClientPlayerWeaponFire", getRootElement(), cFunc["shot_check"])
addEventHandler("onClientRender", getRootElement(), cFunc["render_shots"])
addEventHandler("onClientPedDamage", getRootElement(),cFunc["anim_check"])
addEventHandler("onClientPlayerDamage", getRootElement(),cFunc["anim_check"])

Pewnie jak zawsze co? w tym jest z?ego kto? by mi w tym pom?g? ? bo naprawde potrzebne mi to jest :(

[ Dodano: 2015-07-15, 09:27 ]
A mo?e poprostu by kto? wiedzia? jak zablokowa? enter ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-18, 19:53


_Haze

Peace Yo!






Wiek: 24
Na forum: 4184 dni
Posty: 1648
Nick w MP: Haze

Piwa: 2628

Respekt: 1020
Respekt: 1020

jak chcesz zablokowa? enter to daj unbinda

Postaw piwo autorowi tego posta
 

 
Tagi: anim
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » anim 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