Wysłany: 2012-11-04, 18:31
ExtremeW
Wiek: 31 Na forum: 4978 dni Posty: 2
Nick w MP: Bolokolobolo
Cze??! Jestem zielony w lua wi?c nie krzyczcie, prosz?
Mam tu skrypt na BW. Ale za choler? nie wiem jak go wgra?
Kod: function dli(x,a,b,c)
if (x==1) then return a end
if (x%10>1) and (x%10<5) and (not ((x%100>=10) and (x%100<=21))) then return b end
return c
end
function bwUpdate()
local toBwEnd = (getElementData(getLocalPlayer(), "bwEndTime")-getTickCount())
local x, y, z = getElementPosition ( getLocalPlayer () )
-- setCameraMatrix ( x + 10, y + 10, z + 15, x, y, z )
setCameraMatrix(x-(10 * math.sin(toBwEnd/40000)),y+(10 * math.cos(toBwEnd/40000)),z+15,x,y,z)
if(toBwEnd <= 1) then
outputChatBox("Koniec BW.")
triggerEvent("onBwFinish", getRootElement())
removeEventHandler("onClientRender", getRootElement(), bwUpdate)
return
end
local timeInt = math.floor(toBwEnd/1000)
local timeStr = (timeInt >= 60 and dli(timeInt/60+1, "minuta", "minuty", "minut") or dli(timeInt, "sekunda", "sekund", "sekund"))
local text = "Do ko?ca BW pozosta?o " .. tostring(math.floor((timeInt >= 60 and timeInt/60+1 or timeInt))) .. " " .. timeStr
local fX = (sx/2)-(dxGetTextWidth(text, 2)/2)
local fY = (sx/2)-200
dxDrawText(text, fX + 1, fY, fX + 1, fY, tocolor(0, 0, 0, 255), 2)
dxDrawText(text, fX - 1, fY, fX - 1, fY, tocolor(0, 0, 0, 255), 2)
dxDrawText(text, fX, fY + 1, fX, fY + 1, tocolor(0, 0, 0, 255), 2)
dxDrawText(text, fX, fY - 1, fX, fY - 1, tocolor(0, 0, 0, 255), 2)
dxDrawText(text, fX, fY, fX, fY, tocolor(255, 255, 255, 255), 2)
end
addEventHandler("onClientPlayerWasted", getRootElement(),
function(killer, weapon, bodypart)
if(source == getLocalPlayer()) then
local abs=getElementData(source,"abseiling")
if abs and abs~="" then
return
end
local bwSeconds = 10
if bodypart == 9 then -- g?owa
bwSeconds = (10 * 60)
elseif bodypart == 9 then -- ty?ek
bwSeconds = (2 * 60)
elseif tonumber(bodypart) and (tonumber(bodypart) >= 5 and tonumber(bodypart) <= 8) then -- ko?czyny
bwSeconds = (5 * 60)
elseif bodypart == 3 then -- klatka piersiowa
bwSeconds = (5 * 60)
else
bwSeconds = (5 * 60)
end
setElementData(getLocalPlayer(), "bwEndTime", getTickCount()+(bwSeconds * 1000))
triggerEvent("onGUIOptionChange", getRootElement(), "grayscale", true)
addEventHandler("onClientRender", getRootElement(), bwUpdate)
fadeCamera ( false, 1.0, 0, 0, 0 )
setTimer ( fadeCamera, 2000, 1, true, 0.5 )
death.heartBeat = playSound("audio/heartbeat.mp3", true)
end
end
)
addEvent("onBwFinish", true)
addEventHandler("onBwFinish", getRootElement(),
function()
setCameraTarget(getLocalPlayer())
destroyElement(death.heartBeat)
triggerServerEvent("onPlayerFinshBW", getLocalPlayer())
triggerEvent("onGUIOptionChange", getRootElement(), "grayscale", false)
removeEventHandler("onClientRender", getRootElement(), bwUpdate)
end
)
addEventHandler ( "onClientPlayerDamage", getRootElement(),
function()
if(source == getLocalPlayer()) then
fadeCamera ( false, 1.0, 255, 0, 0 )
setTimer ( fadeCamera, 500, 1, true, 0.5 )
end
end
)
Ostatnio zmieniony przez ExtremeW 2012-11-04, 18:41, w całości zmieniany 1 raz
Wysłany: 2012-11-04, 18:41
Piorun
Wiek: 32 Na forum: 6712 dni Posty: 1837
Nick w MP: Piorun
Piwa : 516
po 1 - u?yj [.lua] albo [.code]. Po drugie - poczytaj troch? poradnik?w na forum i mo?e to Ci? o?wieci.
Wysłany: 2012-11-04, 18:42
ExtremeW
Wiek: 31 Na forum: 4978 dni Posty: 2
Nick w MP: Bolokolobolo
Dobra poprawi?em, co? jest tutaj ?le? Meta.xml nie potrafi? stworzy? za bardzo do tego...
Ale musz? si? uczy? na b??dach.. Chc? postawi? serwer RP...
Wysłany: 2012-11-04, 18:51
Daniex0r
Project-Roleplay
Wiek: 31 Na forum: 5202 dni Posty: 13
Nick w MP: Daniel_Wane
Piwa : 27
Co? si? na tym RP znam ,pisz do mnie najlepiej na GG ,tam dasz dok?adnie skrypt i rozwi??emy tw?j problem tam ,jak i zar?wno na forum ,gdy? mo?e to pom?c wielu ludziom
Nr s?ynnego komunikatorka cut
[ Komentarz dodany przez: Piorun : 2012-11-04, 19:05 ]
Ale staramy si? jednak pomaga? tylko na forum .
Ostatnio zmieniony przez Piorun 2012-11-04, 19:05, w całości zmieniany 1 raz
Wysłany: 2012-11-04, 19:06
Piorun
Wiek: 32 Na forum: 6712 dni Posty: 1837
Nick w MP: Piorun
Piwa : 516
ExtremeW ,
Cytat: [...] poczytaj troch? poradnik?w na forum i mo?e to Ci? o?wieci.
Wysłany: 2012-11-04, 19:06
Daniex0r
Project-Roleplay
Wiek: 31 Na forum: 5202 dni Posty: 13
Nick w MP: Daniel_Wane
Piwa : 27
Piorun ,mo?esz zamkn?? rozwi?za?em go?ciu ma tylko Client Side ,z innego serwera bez server side nie ruszy
Podpis
"Nie zamierzam dyskutować z D ebilami" - Brzydki Burak
Tagi: system :: (jak :: quotzainstalowaćquot :: swój :: serwer)?
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: