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

Wysłany: 2020-07-23, 19:49


etrnl

CLASSIC RPG






Wiek: 26
Na forum: 2199 dni
Posty: 86
Nick w MP: anonymous

Piwa: 57

Respekt: 50

Ostrzeżeń: 40%
LUA MTA

Nie wiem czy ja nie wyspany, czy co ale wsz?dzie jest localPlayer, ca?y skrypt client-side a dxdraw ten od rozpocznij prace wy?wietla wszystkim o co kaman


cside
Kod:


--[[
Praca Magazyniera V.2
Autorem jest adaskOO(Roe)
Zakaz zmieniania autora!
JeĹĽeli postanowisz edytowa?‡ ten skrypt, dopisz siebie. Prosze doce?„ moj?… prace i nie usuwaj autora!
Udost?™pniono na gtao.pl 11.11.2018.
Client Side
--]]

--Tworzy markery
marker = createMarker(369.22336, -119.07957, 1001.49219-0.9, "cylinder", 2, 155, 155, 0, 210)
setElementInterior(marker, 5)
setElementDimension(marker, 0)
markerZABIERANIA = createMarker(376.76630, -120.82995, 1001.49951-1, "cylinder", 3, 0, 0, 0, 210)
setElementInterior(markerZABIERANIA, 5)
setElementDimension(markerZABIERANIA, 0)

setElementInterior(markery, 0)
setElementDimension(markery, 0)
local markery={
--[[ Przyk?‚ad: ||| {x, y, z , "cylinder", wielkosc, kolor RED, Kolor GREEN, Kolor BLUE, Przezroczysto?›?‡}, ||| --]]
{2102.00464, -1802.54797, 13.55469-0.9 , "cylinder", 1, 0, 255, 0, 130},
{2102.16699, -1811.50879, 13.55469-0.9 , "cylinder", 1, 0, 255, 0, 130},
}

--[----------------------------------------------------]--


--Pozycja Kursora(function https://wiki.multitheftauto.com/wiki/IsMouseInPosition)
function isMouseInPosition ( x, y, width, height )
if ( not isCursorShowing( ) ) then
return false
end
local sx, sy = guiGetScreenSize ( )
local cx, cy = getCursorPosition ( )
local cx, cy = ( cx * sx ), ( cy * sy )
if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then
return true
else
return false
end
end


-- DX
local screenW, screenH = guiGetScreenSize()
local w, h = (screenW/1280), (screenH/1024)
renderr = false
function dxDrawGUI()
-- Zmienny tekst
if getElementData(localPlayer, "praca:pizza") == true then
ZmianTekst = "Zako?„cz Prace"
else
ZmianTekst = "Rozpocznij Prace"
end
-- T?‚o
dxDrawRectangle(482*w, 412*h, 290*w, 192*h, tocolor(25, 24, 24, 214), false) -- okno
dxDrawRectangle(482*w, 412*h, 290*w, 5*h, tocolor(60, 60, 60, 255), false) -- pasior

-- pod?›wietlane przyciski
if not isMouseInPosition(492*w, 569*h, 169*w, 25*h) then
dxDrawRectangle(492*w, 569*h, 169*w, 25*h, tocolor(74, 74, 74, 255), false) -- Rozpocznij
else
dxDrawRectangle(492*w, 569*h, 169*w, 25*h, tocolor(31, 31, 31, 255), false) -- Rozpocznij
end
if not isMouseInPosition(669*w, 569*h, 93*w, 25*h) then
dxDrawRectangle(669*w, 569*h, 93*w, 25*h, tocolor(74, 74, 74, 255), false) -- zamknij
else
dxDrawRectangle(669*w, 569*h, 93*w, 25*h, tocolor(31, 31, 31, 255), false) -- zamknij
end

-- Reszta
dxDrawText(ZmianTekst, 492*w, 569*h, 661*w, 594*h, tocolor(255, 255, 255, 255), 1.00, "arial", "center", "center", false, false, false, false, false)
dxDrawText("Zamknij", 669*w, 569*h, 762*w, 594*h, tocolor(255, 255, 255, 255), 1.00, "arial", "center", "center", false, false, false, false, false)
dxDrawText("Znajdujesz si?™ w Pizza24,\n MoĹĽesz si?™ tutaj zatrudni?‡.\n Zarobki: 10-30PLN\n Kliknij H aby podnie?›?‡ PIZZE.", 481*w, 478*h, 772*w, 549*h, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false)
dxDrawText("Praca Dorywcza", 481*w, 431*h, 772*w, 496*h, tocolor(255, 255, 255, 255), 1.20, "default", "center", "center", false, false, false, false, false)
end


--Wy?›wietla dxDraw po wej?›ciu w marker
function wlaczDX()
if renderr == false then else return end
addEventHandler("onClientRender", root, dxDrawGUI)
showCursor(true)
renderr = true
end
addEventHandler("onClientMarkerHit", marker, wlaczDX)


-- Zamyka dx po kliknieciu
addEventHandler("onClientClick", getRootElement(), function()
if renderr == true then else return end
if isMouseInPosition(669*w, 569*h, 93*w, 25*h) then
removeEventHandler ("onClientRender", root, dxDrawGUI)
showCursor(false)
renderr = false
end
end
)


-- Tworzy przyciski
addEventHandler("onClientClick", getRootElement(), function()
if renderr == true then else return end
if isMouseInPosition(492*w, 569*h, 169*w, 25*h) then
if getElementData(localPlayer, "praca:pizza") == true then
--konczyprace
removeEventHandler ("onClientRender", root, dxDrawGUI)
renderr = false
showCursor(false)
setElementData(localPlayer, "praca:pizza", false)
outputChatBox("Pomy?›lnie ko?„czysz prace jako dostawca PIZZY.")
else
--RozpoczynaPrace
setElementData(localPlayer, "praca:pizza", true)
removeEventHandler ("onClientRender", root, dxDrawGUI)
renderr = false
showCursor(false)
outputChatBox("Zaczynasz prace jako dostawca PIZZY.")
end
end
end)

-- Daje paczke i losuje oraz
bindKey("h", "down", function()
if isElementWithinMarker(localPlayer, markerZABIERANIA)
then
if getElementData(localPlayer, "praca:pizza") == true then
if getElementData(localPlayer, "mampizze") == true then outputChatBox("Masz juĹĽ PIZZE!") return end
losuj = math.random ( 1, #markery )
local markerx = createMarker(markery[losuj][1],markery[losuj][2],markery[losuj][3], markery[losuj][4], markery[losuj][5], markery[losuj][6], markery[losuj][7], markery[losuj][8], markery[losuj][9])
blip = createBlipAttachedTo(markerx, 41)
setElementData(localPlayer, "mampizze", true)
box = createObject(2860, 0, 0, 0)
attachElements(box, localPlayer, 0, 0.78, 0.3)
toggleControl ("sprint", false)
toggleControl ("jump", false)
toggleControl ("fire", false)
setPedAnimation(localPlayer, "carry", "crry_prtial", 1, false, true)
addEventHandler("onClientMarkerHit", markerx, function(el, md)
if localPlayer == el and md then
setPedAnimation(localPlayer, "CARRY", "putdwn", -1, true, false, false)
setTimer(function()
setElementData(localPlayer, "wezpizze", false)
setElementData(localPlayer, "mampizze", false)
destroyElement(markerx)
destroyElement(blip)
destroyElement(box)
toggleControl ("sprint", true)
toggleControl ("jump", true)
toggleControl ("fire", true)
triggerServerEvent("hajs:pizza", localPlayer)
setPedAnimation(localPlayer)
end, 1000, 1)
end
end)
else
outputChatBox("Nie pracujesz jako dostawca PIZZY.")
end
end
end)



s-side
Kod:



--[[
Praca Magazyniera 2.0
Autorem jest adaskOO(Roe)
Zakaz zmieniania autora!
JeĹĽeli postanowisz edytowa?‡ ten skrypt, dopisz siebie. Prosze doce?„ moj?… prace i nie usuwaj autora!
Udost?™pniono na serwisie gtao.pl 11.11.2018.
Server Side
--]]
-- Hajsy za paczke
addEvent("hajs:pizza",true)
addEventHandler("hajs:pizza", root, function()
local piniadz = math.random(10, 30) -- losuje od 10 do 30 pln
outputChatBox("Otrzymujesz "..piniadz.." PLN za dostarczenie PIZZY.", source)
givePlayerMoney(source, piniadz)
end)


plox help place w piwerach

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-07-23, 19:53


MrVip615

witam






Wiek: 22
Na forum: 4307 dni
Posty: 167
Nick w MP: ramzes

Piwa: 207

Respekt: 85,3

--Wy?&#8250;wietla dxDraw po wej?&#8250;ciu w marker 
function wlaczDX() 
if renderr == false then else return end 
addEventHandler("onClientRender"rootdxDrawGUIshowCursor(truerenderr true 
end 
addEventHandler("onClientMarkerHit"markerwlaczDX


if renderr==false then else return end
popraw na
if renderr==false then return end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-07-23, 20:32


Qwertick

Coming soon...






Wiek: 23
Na forum: 3577 dni
Posty: 472
Nick w MP: Qwertick

Piwa: 2726

Respekt: 215,8
Respekt: 215,8Respekt: 215,8

function wlaczDX(elhit)
if el ~= localPlayer or not hit then return end 
if renderr == false then else return end 
addEventHandler("onClientRender"rootdxDrawGUIshowCursor(truerenderr true 
end 
addEventHandler("onClientMarkerHit"markerwlaczDX


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-07-23, 20:40


etrnl

CLASSIC RPG






Wiek: 26
Na forum: 2199 dni
Posty: 86
Nick w MP: anonymous

Piwa: 57

Respekt: 50

Ostrzeżeń: 40%
if renderr==false then return end

Powy?sze po wej?ciu w marker NIC si? nie poka?e

jak usun? return zostawi? else to dzia?a, ale pokazuje dalej wszystkim.

Nie mam poj?cia o co chodzi.

[ Dodano: 2020-07-23, 20:42 ]
"Qwertick" napisał/a:

function wlaczDX(elhit)
if el ~= localPlayer or not hit then return end 
if renderr == false then else return end 
addEventHandler("onClientRender"rootdxDrawGUIshowCursor(truerenderr true 
end 
addEventHandler("onClientMarkerHit"markerwlaczDX


Dzi?ki panowie, to dzia?a. po piweczku mi?ego wieczorku ;]

Postaw piwo autorowi tego posta
 

 
Tagi: lua :: mta :: localplayer :: clientside :: dxdraw :: wyświetla :: wszystkim
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » LUA MTA localPlayer clientside dxdraw wyświetla wszystkim 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