Witam bawi? si? z hudem i natkn??em si? na pewien problem chcia?bym zrobi? aby po otrzymaniu kasy kasa automatycznie nie pokazywa?o ile kto? ma tylko przy np dostaniu 50k liczby si? zmieniaj? a? do otrzymaniu tych np 50k. Dla testu chcia?em zobaczy? czy kod sirphantasm zadzia?a lecz b??du brak a animacji nie ma kod z kt?rego bra?em https://github.com/sirphantasm/DXHud/blob/main/DXHud/main.lua
[lua]
function test()
if getElementData(localPlayer, "show:hud") == true then
dolar = getElementData(localPlayer, "p:dolar")
cent = getElementData(localPlayer, "p:cent") or 0
kasa=getPlayerMoney(localPlayer)
money2 = getElementData(localPlayer, "p:cent") or 0
if kasa ~= getPlayerMoney(localPlayer) then
local checkMoney = kasa - getPlayerMoney(localPlayer)
if checkMoney == math.abs(checkMoney) then
if tonumber(kasa-getPlayerMoney(localPlayer))>1000000 then
kasa = kasa - 100000
elseif tonumber(kasa-getPlayerMoney(localPlayer))>100000 then
kasa = kasa - 10000
elseif tonumber(kasa-getPlayerMoney(localPlayer))>10000 then
kasa = kasa - 1000
elseif tonumber(kasa-getPlayerMoney(localPlayer))>1000 then
kasa=kasa-100
elseif tonumber(kasa-getPlayerMoney(localPlayer))>100 then
kasa=kasa-10
else
kasa=kasa-1
end
else
if tonumber(getPlayerMoney(localPlayer)-kasa)>1000000 then
kasa = kasa + 100000
elseif tonumber(getPlayerMoney(localPlayer)-kasa)>...
Witam chcialem zrobic animowane ogloszenia zeby sie wysuwaly i wsuwaly lecz jestem zielony w temacie animacji w mta
[lua]
local start = getTickCount()
function isEventHandlerAdded( sEventName, pElementAttachedTo, func )
if
type( sEventName ) == 'string' and
isElement( pElementAttachedTo ) and
type( func ) == 'function'
then
local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo )
if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then
for i, v in ipairs( aAttachedFunctions ) do
if v == func then
return true
end
end
end
end
return false
end
foNte = dxCreateFont(":im_dx/f/Roboto-Bold.ttf",9) or "default-bold"
l={}
function hud()
x,y = guiGetScreenSize()
screenW,screenH = guiGetScreenSize()
for k,v in ipairs ( getElementsByType ( "object" ) ) do
if getElementData ( v, "ogloszenie" ) then
local tekst = getElementData ( v, "tekstogloszenia" )
local width = dxGetTextWidth(tekst,1,"default-bold")
local now = getTickCount()
local endTime = start + 2000
local elapsedTime = now - start
local duration = endTime - start
local progress = elapsedTime / duration
if progress and progress > 4 then
if not s then
s = getTickCount()
end
return end
dxDrawImage(screenW * 0.0005, screenH * 0.5213, screenW * 0.1323, screenH * 0.0546, ":pystories-admin/ogloszenie.png&qu...
Siemka jak w temacie, da sie jakos zmienic animacje wsiadania? np zeby do cometa nie wskakiwac juz tylko normalnie otwierac drzwi po czym wsiasc i zamknac
Witam,
Przychodz? z zapytaniem jak wykona? animacje po najechaniu kursorem, da si? przerobi? zwyk?y cursorPosition na taki z tickiem? Bo jak dodaje to nic nie wykrywa mi ticka. Prosz? o pomoc.
Siemka, mam pytanie co zrobi? i w kt?rej linijce, aby obrazek nie wychyla? si? z lewej strony ekranu tylko z g?ry ekranu wielkie dzi?ki za pomoc!
[lua]function gui()
for i,v in ipairs(tabela) do
local nczas = getTickCount()
if nczas > v.tick+v.czas then
local sczas = v.tick+v.czas
local progress = (sczas - nczas) / 15000
v.alpha = interpolateBetween(v.alpha, 0, 0, 0, 0, 0, progress, "InOutQuad")
v.alpha3 = interpolateBetween(v.alpha3, 0, 0, 0, 0, 0, progress, "InOutQuad")
end
if v.alpha < 1 then
table.remove(tabela, 1)
if #tabela < 1 then
removeEventHandler("onClientRender", root, gui)
gui_showed = false
end
end
local nn = interpolateBetween(screenW, 0, 0, 0, 0, 0, (getTickCount()-v.tick)/800, "OutBack")
local dodatekY = (scale_y(64))*(i-1)
local dodatekY2 = (scale_y(128))*(i-1)
Witam . Mam pewien problem . Nie wiem w jaki spos?b u?y? funkcji interpolateBetween ?eby grafika powoli znika?a z ekranu . Mo?e kto? jako? pom?c ? Za pomoc
Witam, chcia?bym aby editbox exportowany z innego skryptu wysuwa? mi si? spoza ekranu lecz interpolateBetween mi na to nie pozwala. Kto? zna jaki? spos?b jak mo?na to zrobi? bez eventu onClientRender?
Witam, przychodz? z pytaniem odno?nie system?w dgs. Tzn. czy jest mo?liwo?? zrobi? animacj? takiemu editboxowi poprzez interpolateBetween? Dla przyk?adu, robi? tak lecz nie dzia?a, editbox nawet sie nie pokazuje:
Witajcie mog? by mnie kto? naprowadzi? na trop heh .. chce zrobic tak ?e po wejsciu na nasz serwer pokazywa?o jakies miejsce i pokazywa? sie ma?y opis co sie tu znajduje gdyby ktos da? gotowy kod lub fragmenty bym by? wdzieczny / Z G?RY DZIEKUJE
Witam mam tutaj taki kod ale co? nie dzia?a prosi?bym o pomoc.
Kod:
addEventHandler("onClientMarkerHit", getRootElement(),
function(plr)
if source == rozpocznij then else return end if getElementType(plr) == "player" then else return end if isElementWithinMarker(plr, rozpocznij) then else return end
pojazd = getPedOccupiedVehicle(plr)
if pojazd then return end
local now = getTickCount() local endTime = start + 10000
local elapsedTime = now - start
local duration = endTime - start
local progress = elapsedTime / duration
a1 = interpolateBetween(0, 0, 0, 255, 0, 0, progress, "Linear") guiSetAlpha(window1, a1)
Witam . Mam kolejne pytanie odno?nie animacji dxRentagle , jak j? zrobi? , np. zeby dxRentagle 'przylatywa?' od prawej strony do wybranej pozycji ?
Za pomoc z g?ry dzi?kuj? .
Witam przerabiam sobie prace magazyniera. I jak oddaje skrzynke chce by by?a animacja kucania. Znalaz?em j? oraz wpisa?em w kod, lecz w grze ona nie dzia?a animacja si? nie uruchamia. Pr?bowa?em wszystkiego co umiem prosz? o pomoc.
destroyElement(blip) setPedAnimation ( localPlayer, "CAMERA", "camcrch_idleloop",true ) setElementFrozen(el, true)
if getElementData(localPlayer,"player:premium") then
destroyElement(skrzynia) destroyElement(cel) setElementFrozen(el, false) setPedAnimation(localPlayer, true) setElementData(el, "gracz_praca", false) triggerServerEvent("givePlayerMoney", el, hajsik) outputChatBox("Za od?o?enie skrzynki otrzymujesz: "..hajsik.." PLN!")
function ped () npc = createPed(26,-2435.60352,-1943.37537,303.47186) setPedAnimation( "BEACH", "bather" ) setPedRotation(npc,85 ) end
addEventHandler ("onResourceStart", getResourceRootElement(), ped)
Witam zrobi?em o taki kod wszystko jest okey ale animacja nie dzia?a i wyskakuje b??d "setPedAnimation" prosz? o pomoc stawiam http://imgur.com/a/pd3R9
Witam!
Stworzy?em tabel? z pedami i wszystko jest ok, dzia?a rotacja itp, tylko jest jeden wielki problem - nie dzia?a animacja tzn. nic postawiony ped nie robi (chodzi mi o animacj?) tylko stoi w miejscu.
Ju? mia?em taki problem ale kolega mi napisa? aby u?y? setTimera, ale ja chc? ?eby nie obci??a? serwera, bo bym ustawi? ?eby od?wie?a? animacje co kilka sec, ale jest to z drugiej strony nie korzystne dla graczy bo powoduje to lagi.
local pedy = {
--{ID, x, y, z, rotZ, DIM, INT},
{280, -1995.64490, 207.63896, 27.68750, 0, 0, 0, "test"}
}
addEventHandler("onResourceStart", resourceRoot, function ()
for k,v in ipairs (pedy) do text = createElement ("text3") setElementData (text, "name3", v[8]) setElementDimension (text, v[6]) setElementInterior (text, v[7]) setElementPosition (text, v[2], v[3], v[4]+1.3)
Mam tutaj taki kod: [lua]addCommandHandler("polozr1",function(plr,cmd)
local veh = getPedOccupiedVehicle(plr)
if veh then return end
local torba = torby[plr]
exports["LR-notyfikacje"]:addNotification(plr,"* K?adziesz/Podnosisz torb? R-1.")
setPedAnimation(plr, "ped", "WOMAN_walknorm")
if exports["bone_attach"]:isElementAttachedToBone(torba) then
exports["bone_attach"]:detachElementFromBone(torba)
setElementCollisionsEnabled (torba, false)
local x,y,z = getElementPosition(plr)
setElementPosition(torba,x,y,z-0.82)
local rz = getElementRotation(torba)
setElementRotation(torba,0,0,rz)
else
local x,y,z = getElementPosition(plr)
local x2,y2,z2 = getElementPosition(torba)
local distance = getDistanceBetweenPoints3D(x,y,z,x2,y2,z2)
if distance > 5 then outputChatBox("** Za daleki dystans nie siegniesz po torbe",plr,255,0,0) return end
exports["bone_attach"]:attachElementToBone(torba,plr,12,0,-0.09,0.3,0,180,0)
end
end)[/lua]
nadaj? graczowi dan? animacj? a jak j? ustawi? aby po czasie si? zastopowa?a?
[ Dodano : 2017-04-05, 22:27 ]
Uda?o mi si? takie co? stworzy?: [lua]setPedAnimation(plr, "BOMBER", "BOM_Plant")
setTimer (setPedAnimation, 1000, 1, false )[/lua] tylko przy setTimer (wiem ?e setPedAnimation tam nie mo?e by?) nie wiem co wstawi? aby stopowa?o animacj?...
Witam nie wiem jak napisa? wsp?ln? animacj? (pocalunek)...
Polega?a by ona na takich samych zasadach jak na pylu..
-2 osoby musz? wpisa? t? kom?d?
-Na czacie nam co? wyskakuje (tekst jaki chce wpisa?)
Witam mam pytanko czy kto? zna nazw? animacji poca?unku ze strony partera nie partnerki bo wiem ?e s? 2 animacj?... kr?cej i ja?niej w GTA SA jest animacja poca?unku... Dziewczyna ca?uj? (to wiem jak si? nazywa) a CJ robi jaki? gest w tym momencie <--O t? adnimacj? mi chodzi je?eli kto? zna to prosz? o odpowiedz z g?ry stawiam browarka