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

Wysłany: 2015-09-29, 09:48


kamilryb1

LUA






Wiek: 21
Na forum: 4267 dni
Posty: 146

Piwa: 319

Respekt: 7,3

Ostrzeżeń: 40%
czy ktos mi przerobi ten skrypt???:

Urz?d Wykonany Przez Emceg 


wejscie createMarker (1480.96,-1771.64,18.80+1"arrow"1.52552550wyjscie createMarker (390.46,173.79,1008.38+1"arrow"1.52552550setElementDimension(wyjscie3setElementInterior(wyjscie3addEventHandler("onMarkerHit"wejscie, function(elmd) 
if isPedInVehicle(elthen return end 
outputChatBox"* Witamy w urz?dzie *"elsetElementDimension(el3setElementInterior(el3setElementPosition(el387.56,173.75,1008.38endaddEventHandler("onMarkerHit"wyjscie, function(elmd) 
if isPedInVehicle(elthen return end 
outputChatBox("* Zapraszamy ponownie *"elsetElementDimension(el0setElementInterior(el0setElementPosition(el1481.27,-1770.29,18.80endcreateBlip 1481.27,-1770.29,18.8025 Meta: 

<meta> 
<info author="Emceg" /> 
<script src="Urzad.lua" type="server" /> 
</meta>



Prosz?, Bym Chcia? ?eby?cie mi przerobili ?eby by? w sf i w lv te?

Daje :piwo: :piwo: :piwo: :piwo: :piwo: :piwo: :piwo: :piwo: :piwo: :piwo: :piwo: :piwo: :piwo: :piwo: :piwo: :piwo: :piwo:

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-29, 14:21


Fanciak

BOT






Wiek: 25
Na forum: 4447 dni
Posty: 728
Nick w MP: Fanciak

Piwa: 1572

Respekt: 500
Respekt: 500

A moze powiesz gdzie w LV i w SF? :v

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-29, 14:46


demoniskoxd







Wiek: 30
Na forum: 3990 dni
Posty: 79
Nick w MP: Francesco

Piwa: 1

Respekt: 50

Mam co? takiego :


local praca createMarker(-1816.6103515625,617.31195068359,34.171875"cylinder"2.025500local miejscaelektryk = { 
{-2018.0826416016,748.35705566406,45.4453125}, 
{-2018.5324707031,766.58911132813,45.4453125}, 
{-2018.5130615234,784.80914306641,45.4453125}, 
{-2018.4396972656,832.04339599609,45.4453125}, 
{-2018.3865966797,849.06689453125,45.448417663574}, 
{-2018.3662109375,865.58197021484,45.4453125}, 
{-2015.7274169922,897.49176025391,45.4453125}, 
{-2034.2690429688,902.72711181641,50.48860168457}, 
{-2059.2690429688,890.35034179688,61.849712371826}, 
{-2075.3674316406,899.80426025391,64.1328125}, 
{-2084.8430175781,899.37591552734,64.1328125}, 
{-2099.5378417969,898.44952392578,76.7109375}, 
{-2130.73046875,894.78686523438,80}, 
{-2067.0522460938,756.93688964844,71.890625}, 
{-2048.3344726563,757.94323730469,64.15625}, 
{-2047.7634277344,784.90966796875,64.15625}, 
{-2067.6958007813,784.83923339844,71.890625}, 
} 

addEventHandler("onClientMarkerHit"praca, function(elmd) 
if not md or getElementType(el) ~= "player" then return end 
if el ~= localPlayer then return end 
outputChatBox("* Zarobki pracy: 4 Z? Za 1 Pizze."outputChatBox("* Aby rozpocz?? prac? wci?nij 'E'"endbindKey("e""down", function() 
if not isElementWithinMarker(localPlayerpracathen return end 
if not getElementData(localPlayer"gracz_praca"then 
local losuj math.random(2#miejscaelektryk) 
setElementData(localPlayer"gracz_praca"trueoutputChatBox("* Wywo? Pizzy W Odznaczony Cel."local cel createMarker(miejscaelektryk[losuj][1], miejscaelektryk[losuj][2], miejscaelektryk[losuj][3]-1.0"cylinder"4.025500local blip createBlipAttachedTo(cel41addEventHandler("onClientMarkerHit"cel, function(elmd) 
if not md or getElementType(el) ~= "player" then return end 
if el ~= localPlayer then return end 

if getPedOccupiedVehicle(elthen 
outputChatBox("* Wyjd? z pojazdu aby Da? Pizze") 
return 
end 

destroyElement(celdestroyElement(blipsetElementFrozen(eltrueoutputChatBox("* Pukasz Do Drzwi i dajesz Pizze Poczekaj (5 sekund)"setTimer(function() 
setElementFrozen(elfalseoutputChatBox("* Odda?e? pizze dla klienta!"setElementData(el"gracz_praca"falsetriggerServerEvent("givePlayerMoney"el,0end50001end) 
else 
outputChatBox("* Posiadasz aktywn? prac?."end 
end)





lecz nie daje kasy przerobi kto? tak aby dawa? kase ? ;x


Na przysz?o?? u?ywaj znacznik?w Lua, post jest znacznie bardziej czytelny//DestroY

Ostatnio zmieniony przez #404 2015-09-29, 14:48, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-29, 14:54


Fanciak

BOT






Wiek: 25
Na forum: 4447 dni
Posty: 728
Nick w MP: Fanciak

Piwa: 1572

Respekt: 500
Respekt: 500

demoniskoxd, dodaj to po stronie servera:


addEvent("givePlayerMoney"true)
addEventHandler("givePlayerMoney"root, function(money)
    if not tonumber(moneythen return end

    givePlayerMoney(sourcemoney)
    

end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-29, 15:03


demoniskoxd







Wiek: 30
Na forum: 3990 dni
Posty: 79
Nick w MP: Francesco

Piwa: 1

Respekt: 50

Nie bardzo rozumiem w sumie nowy jestem jak mzoesz powiesz gdzie to wklei? ? mam co? takiego


Kod:

local praca = createMarker(-1816.6103515625,617.31195068359,34.171875, "cylinder", 2.0, 255, 0, 0)

local miejscaelektryk = {
{-2018.0826416016,748.35705566406,45.4453125},
{-2018.5324707031,766.58911132813,45.4453125},
{-2018.5130615234,784.80914306641,45.4453125},
{-2018.4396972656,832.04339599609,45.4453125},
{-2018.3865966797,849.06689453125,45.448417663574},
{-2018.3662109375,865.58197021484,45.4453125},
{-2015.7274169922,897.49176025391,45.4453125},
{-2034.2690429688,902.72711181641,50.48860168457},
{-2059.2690429688,890.35034179688,61.849712371826},
{-2075.3674316406,899.80426025391,64.1328125},
{-2084.8430175781,899.37591552734,64.1328125},
{-2099.5378417969,898.44952392578,76.7109375},
{-2130.73046875,894.78686523438,80},
{-2067.0522460938,756.93688964844,71.890625},
{-2048.3344726563,757.94323730469,64.15625},
{-2047.7634277344,784.90966796875,64.15625},
{-2067.6958007813,784.83923339844,71.890625},
}

addEventHandler("onClientMarkerHit", praca, function(el, md)
if not md or getElementType(el) ~= "player" then return end
if el ~= localPlayer then return end
outputChatBox("* Zarobki pracy: 4 Z? Za 1 Pizze.")
outputChatBox("* Aby rozpocz?? prac? wci?nij 'E'")
end)

bindKey("e", "down", function()
if not isElementWithinMarker(localPlayer, praca) then return end
if not getElementData(localPlayer, "gracz_praca") then
local losuj = math.random(2, #miejscaelektryk)
setElementData(localPlayer, "gracz_praca", true)
outputChatBox("* Wywo? Pizzy W Odznaczony Cel.")

local cel = createMarker(miejscaelektryk[losuj][1], miejscaelektryk[losuj][2], miejscaelektryk[losuj][3]-1.0, "cylinder", 4.0, 255, 0, 0)
local blip = createBlipAttachedTo(cel, 41)

addEventHandler("onClientMarkerHit", cel, function(el, md)
if not md or getElementType(el) ~= "player" then return end
if el ~= localPlayer then return end

if getPedOccupiedVehicle(el) then
outputChatBox("* Wyjd? z pojazdu aby Da? Pizze")
return
end

destroyElement(cel)
destroyElement(blip)
setElementFrozen(el, true)
outputChatBox("* Pukasz Do Drzwi i dajesz Pizze Poczekaj (5 sekund)")
setTimer(function()
setElementFrozen(el, false)
outputChatBox("* Odda?e? pizze dla klienta!")
setElementData(el, "gracz_praca", false)
triggerServerEvent("givePlayerMoney", el, 4 ,0)
end, 5000, 1)
end)
else
outputChatBox("* Posiadasz aktywn? prac?.")
end
end)



jak i rowniez
local pojazdyPubliczne = {
{448, -1826.04,616.63,34.77,359.5,360.0,178.8},
{448, -1824.03,616.61,34.77,359.5,360.0,181.0},
{448, -1821.95,616.57,34.77,359.5,360.0,183.5},
{448, -1820.39,616.57,34.77,359.5,0.0,182.8},
{448, -1818.68,616.57,34.77,359.5,0.0,179.4},
{448, -1814.07,616.55,34.77,359.5,0.0,179.6},
{448, -1812.28,616.49,34.77,359.5,360.0,178.0},
{448, -1810.76,616.49,34.77,359.5,360.0,183.7},
}

for i,v in ipairs(pojazdyPubliczne) do
local pojazd = createVehicle(v[1], v[2], v[3], v[4], v[5], v[6], v[7])
setElementData(pojazd, "pojazd_opis", "Praca Dorywcza\nDostawca Pizzy")
setElementFrozen(pojazd, true)
setElementData(pojazd, "pojazd_paliwo", 100)
setVehicleEngineState ( pojazd, false )
end

addEventHandler("onVehicleEnter", resourceRoot, function(plr, seat)
if seat == 0 then
setElementFrozen(source, false)
setElementData(source, "pojazd_opis", "Dostawca Pizzy")
end
end)

function respawnVehicles()
for i,v in ipairs(getElementsByType("vehicle", resourceRoot)) do
if not getVehicleOccupant(v) then
respawnVehicle(v)
setElementFrozen(v, true)
setElementData(v, "pojazd_opis", "Praca Dorywcza\nDostawca Pizzy")
setElementData(v, "pojazd_paliwo", 100)
setVehicleEngineState ( v, false )
end
end
end
setTimer(respawnVehicles, 70000, 0)


[ Dodano: 2015-09-30, 13:32 ]
Kod:


bike={}



local bikes={
--x,y,z,rotx,roty,rotz
{-1915.86, 889.98, 35.41,0,0,9},
{-1914.28, 889.67, 35.29,0,0,9},
{ -1913.19,889.25,35.22,0,0,9},
{-1917.31,889.73,35.34,0,0,0}
}


addEventHandler("onResourceStart",resourceRoot,function()
for count,v in ipairs(bikes)do
id=count
bike[id]=createVehicle(481,v[1],v[2],v[3],v[4],v[5],v[6])
setElementData(bike[id],"WypozyczalniaOpis","Wypozyczalnia rowerow\nRower ID : "..id)
end
end)

timer={}


addEventHandler("onPlayerVehicleExit",root,function(veh,seat)
if seat==0 then
timer[veh]={}
for i=1,#bikes do
if veh==bike[i] then
outputChatBox("*Wyszedles(as) z roweru nalezacego do wypozyczalni. Masz 15 sekund zeby na niego wrocic inaczej zostanie zrespiony na miejsce zaparkowania ;) ",source,255,255,255)
timer[veh][1],timer[veh][2]=setTimer(respawnVehicle,15000,1,veh)
end
end
end
end)


addEventHandler("onPlayerVehicleEnter",root,function(veh,seat)
if seat==0 then
for i=1,#bikes do
if veh==bike[i] then
for k=1,2 do
if timer[veh] then
if isTimer(timer[veh][k]) then
killTimer(timer[veh][k])
end
end
end
end
end
end
end)







Chodzi mi o to by pojazd by? zamro?ony ;< Pomo?ecie ? ;D

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-30, 17:24












POST ZOSTAŁ UKRYTY Z POWODU ZŁAMANIA REG. LUB OCZEKUJE NA AKCEPTACJĘ


 

 
Wysłany: 2015-10-02, 18:31


Umkio







Wiek: 28
Na forum: 3901 dni
Posty: 4
Nick w MP: NoPe



Respekt: 50

Ostrzeżeń: 100%
Witam Mam Problem z Pewnym Panelem logowania gdy? Po za logowaniu nie znika taki pasek. Ju? Podaje kod:

Kod:

function hideLoginWindow()
removeEventHandler ("onClientRender", getRootElement(), login)
guiSetVisible (loguj, false)
guiSetVisible (rejestruj,false)
guiSetVisible (login, false)
guiSetVisible (haslo, false)
showCursor (false)
end
addEvent("hideLoginWindow", true)
addEventHandler("hideLoginWindow", getResourceRootElement(getThisResource()), hideLoginWindow)


Za pomoc dam :piwo: ;)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-10-02, 22:22


Hades.

Łiiiiiiiiii






Wiek: 22
Na forum: 4700 dni
Posty: 372
Nick w MP: Hades

Piwa: 3214

Respekt: 337,8
Respekt: 337,8Respekt: 337,8Respekt: 337,8

Je?li mo?na to ss tego paska oraz kody gui ca?ego tego panelu.

[ Dodano: 2015-10-02, 22:38 ]
demoniskoxd,

To:
addEvent("givePlayerMoney"true)
addEventHandler("givePlayerMoney"root, function(money)
    if not tonumber(moneythen return end

    givePlayerMoney(sourcemoney)
    

end)


Wklejasz do pliku lua po stronie servera czyli s-side ( server ) .
Je?li nie rozumiesz to ju? ci t?umacze, ot?? masz 2 pliki pracy s-side i c-side.
Otwierasz ten s-side czyli cz??ciej si? nazywa server.lua otwierasz i tam wklejasz to co da?em wy?ej.

A co do zamra?ania to u?yj funkcji:

setElementFrozen(biketrue)



Pomog?em? daj :piwo:

;)

[ Dodano: 2015-10-02, 22:48 ]
kamilryb1, Urz?d nie jest wykonany przez Emceg, zosta? on przerobiony przezemnie a to dow?d:

outputChatBox"* Witamy w urz?dzie *"el)
outputChatBox"* Zapraszamy ponownie *"el)


oraz w mecie da?em tak samo tylko info o autorze a zosta? tylko podrobiony ...

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-10-03, 01:22


demoniskoxd







Wiek: 30
Na forum: 3990 dni
Posty: 79
Nick w MP: Francesco

Piwa: 1

Respekt: 50

Damian2511,
Dzi?kuj? za pomoc ;) Ty i Fanciak, macie po browarku :D

[ Dodano: 2015-10-03, 01:30 ]
Damian2511,
Mam pytanie co do tego setelement frozen
gdzie to mam wklei? do servera czy co clienta i pod czym dok?adnie jakby? m?g? mi?dzy czym a czym bo ja si? ju? g?ubie w tym....

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-10-03, 08:07


Fanciak

BOT






Wiek: 25
Na forum: 4447 dni
Posty: 728
Nick w MP: Fanciak

Piwa: 1572

Respekt: 500
Respekt: 500

demoniskoxd, setElementFrozen uzywasz po kazdej stronie. Pokaz swoj obecny kod, w ktorym ma byc zamrazanie.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-10-03, 13:30


demoniskoxd







Wiek: 30
Na forum: 3990 dni
Posty: 79
Nick w MP: Francesco

Piwa: 1

Respekt: 50

Fanciak,
Jest co? takiego
Kod:

mojeW,mojeH = 640, 480
sW,sH = guiGetScreenSize()
width, height = (sW/mojeW), (sH/mojeH)

addEventHandler("onClientRender",root,function()
local x, y, z = getCameraMatrix( )
local dimension = getElementDimension( localPlayer )
for key, vehicle in ipairs ( getElementsByType( "vehicle" ) ) do
if getElementDimension( vehicle ) == dimension then
local px, py, pz = getElementPosition( vehicle )
local distance = getDistanceBetweenPoints3D( px, py, pz, x, y, z )
if distance <= 20 then
local text = getElementData( vehicle, "WypozyczalniaOpis" )
if text and ( distance < 2 or isLineOfSightClear( x, y, z, px, py, pz + 1.1, true, false, false, true, false, true, true ) ) then
local sx, sy = getScreenFromWorldPosition( px, py, pz+0.2 )
if sx and sy then
local w = dxGetTextWidth( tostring( text ) )
local h = ( text and 2 or 1 ) * dxGetFontHeight( )
local sin=math.sin(getTickCount()/400)*70
local cos=math.sin(getTickCount()/400)*0.1
dxDrawText( tostring( text ), sx+3, sy+30+3, sx, sy, tocolor( 0, 0, 0, 70+sin ), (1.3*width/2.5)+cos, "default", "center", "center" )
dxDrawText( tostring( text ), sx, sy+30, sx, sy, tocolor( 255, 255, 255, 70+sin ), (1.3*width/2.5)+cos, "default", "center", "center",_,_,_,true )
end
end
end
end
end
end)




i strona serwera
Kod:

bike={}



local bikes={
--x,y,z,rotx,roty,rotz
{-1915.86, 889.98, 35.41,0,0,9},
{-1914.28, 889.67, 35.29,0,0,9},
{ -1913.19,889.25,35.22,0,0,9},
{-1917.31,889.73,35.34,0,0,0}
}
setElementFrozen(bike, true)
addEventHandler("onResourceStart",resourceRoot,function()
for count,v in ipairs(bikes)do
id=count
bike[id]=createVehicle(481,v[1],v[2],v[3],v[4],v[5],v[6])
setElementData(bike[id],"WypozyczalniaOpis","Rower Publiczny\nRower ID : "..id)

end
end)

timer={}


addEventHandler("onPlayerVehicleExit",root,function(veh,seat)
if seat==0 then
timer[veh]={}
for i=1,#bikes do
if veh==bike[i] then
outputChatBox("*Wyszedles(as) z roweru nalezacego do wypozyczalni. Masz 15 sekund zeby na niego wrocic inaczej zostanie zrespiony na miejsce zaparkowania ;) ",source,255,255,255)
timer[veh][1],timer[veh][2]=setTimer(respawnVehicle,15000,1,veh)

end
end
end
end)


addEventHandler("onPlayerVehicleEnter",root,function(veh,seat)
if seat==0 then
for i=1,#bikes do
if veh==bike[i] then
for k=1,2 do
if timer[veh] then
if isTimer(timer[veh][k]) then
killTimer(timer[veh][k])
end
end
end
end
end
end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-10-03, 15:02


Hades.

Łiiiiiiiiii






Wiek: 22
Na forum: 4700 dni
Posty: 372
Nick w MP: Hades

Piwa: 3214

Respekt: 337,8
Respekt: 337,8Respekt: 337,8Respekt: 337,8

demoniskoxd, Dobrze masz powinno ?miga?.

Podpis
Skrypty/Grafiki na zamówienie!
Kontakt: Discord R35#5507

Discord związany z pomocą: https://discord.gg/ttkQTsc
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-10-03, 21:16


demoniskoxd







Wiek: 30
Na forum: 3990 dni
Posty: 79
Nick w MP: Francesco

Piwa: 1

Respekt: 50

Damian2511,
W?a?nie pojazdy si? nie chc? zamrozi? .... ;c

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-10-04, 11:00


Fanciak

BOT






Wiek: 25
Na forum: 4447 dni
Posty: 728
Nick w MP: Fanciak

Piwa: 1572

Respekt: 500
Respekt: 500

demoniskoxd, strona serwera:



bike={} 



local bikes={ 
--x,y,z,rotx,roty,rotz 
{-1915.86889.9835.41,0,0,9}, 
{-1914.28889.6735.29,0,0,9}, 
{ -1913.19,889.25,35.22,0,0,9}, 
{-1917.31,889.73,35.34,0,0,0} 
} 
addEventHandler("onResourceStart",resourceRoot,function() 
for count,v in ipairs(bikes)do 
id=count 
bike[id]=createVehicle(481,v[1],v[2],v[3],v[4],v[5],v[6]) 
setElementData(bike[id],"WypozyczalniaOpis","Rower Publiczny\nRower ID : "..idsetElementFrozen(bike[id], trueend 
endtimer={} 


addEventHandler("onPlayerVehicleExit",root,function(veh,seat) 
if seat==0 then 
timer[veh]={} 
for i=1,#bikes do 
if veh==bike[ithen 
outputChatBox("*Wyszedles(as) z roweru nalezacego do wypozyczalni. Masz 15 sekund zeby na niego wrocic inaczej zostanie zrespiony na miejsce zaparkowania ;) ",source,255,255,255timer[veh][1],timer[veh][2]=setTimer(respawnVehicle,15000,1,vehend 
end 
end 
endaddEventHandler("onPlayerVehicleEnter",root,function(veh,seat) 
if seat==0 then 
for i=1,#bikes do 
if veh==bike[ithen 
for k=1,do 
if timer[vehthen 
if isTimer(timer[veh][k]) then 
killTimer(timer[veh][k]) 
end 
end 
end 
end 
end 
end 
end)



Powinno smigac.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-10-04, 13:44


demoniskoxd







Wiek: 30
Na forum: 3990 dni
Posty: 79
Nick w MP: Francesco

Piwa: 1

Respekt: 50

Fanciak,


Wyskakuje mi co? takiego :

[2015-10-04 13:43] SCRIPT ERROR: wyporzyczalnia/server.lua:29: '<name>' expected near '1'
[2015-10-04 13:43] ERROR: Loading script failed: wyporzyczalnia/server.lua:29: '<name>' expected near '1'

Postaw piwo autorowi tego posta
 

 
Tagi: prośby :: przerobienie :: skryptu
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Zasoby do MTA » PROŚBY O PRZEROBIENIE SKRYPTU Odpowiedz do tematu

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