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

Wysłany: 2014-05-30, 23:17


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

Witam ot??, napisa?em sobie prosty skrypt. Ale nie wiem w czym tkwi problem, po wpisaniu /zaparkuj siedz?c w aucie nic nie dzia?a... A po dodaniu jeszcze jednej linijki z b??dem naprzyk?ad: Nie masz tyle pieni?dzy. To wszystko ok. Mo?e mi kto? wyt?umaczy?? Aha, i chcia?bym aby po wybuchu pojazdu, respi? si? w miejscu w kt?rym w?a?ciciel wpisa? /zaparkuj... Za pomoc :piwo: + Respekt
Tutaj kod:
Kod:

function playerCarPark ( source, cmd)
if(isPedInVehicle(source)) then
local playercar = getPedOccupiedVehicle ( source )
if(getElementData ( playercar, "owner" ) == getPlayerName ( source )) then
local x, y, z = getElementPosition ( source )
local xa,ya,a = getElementRotation ( playercar )
setElementData (playercar,"xpos",x)
setElementData (playercar,"ypos",y)
setElementData (playercar,"zpos",z)
setElementData (playercar,"angle",a)
outputChatBox ("[AUTA]Zaparkowa?e? auto pomy?lnie.",source, 243,149,72 )
saveCars()
else
outputChatBox ("[AUTA]To nie jest twoje auto.",source, 255,255,127 )
end
end

addCommandHandler ("zaparkuj",playerCarPark)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-05-30, 23:21


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4394 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

Kod wzi?ty z mojego starego serwera :

/zaparkuj :

function pozycja player )
local co1 getPedOccupiedVehicle player )
if getElementData(co1"private"truethen
local accName getAccountName getPlayerAccount player ) ) 
if getElementData(co1"owner" ) == getPlayerName(player) or isObjectInACLGroup ("user."..accNameaclGetGroup "Admin" ) ) then
local auto getPedOccupiedVehicle player )
if auto then
local xa,ya,za getElementPosition auto )
local owner getElementData co1"owner" )
local xr,yr,zr getElementRotation auto )
setElementData auto"r1"tonumber(xr) )
setElementData auto"r2"tonumber(yr) )
setElementData auto"r3"tonumber(zr) )
setElementData auto"zapisany"true )
setElementData auto"x"tonumber(xa) )
setElementData auto"y"tonumber(ya) )
setElementData auto"z"tonumber(za) )
outputChatBox "Pojazd i miejsce pojazdu zapisane ! Po respawnie pojazd znajdzie si? w tym miejscu."player255255255 )
else
outputChatBox "Wejd? do pojazdu !"player255255255 )
end
else
outputChatBox "*Ten pojazd nale?y do "..owner.." !"player255255255 )
end
end
end
addCommandHandler "zaparkuj"pozycja )



Co do wybuchu przer?b Sobie ten kod :

function respawn1 playercmdid2 )
local accName getAccountName getPlayerAccount player ) )
if isObjectInACLGroup ("user."..accNameaclGetGroup "Admin" ) ) or isObjectInACLGroup ("user."..accNameaclGetGroup "SSupport" ) ) then 
local pl getElementsByType "vehicle" )
for k,v in ipairs pl ) do
local id getElementData v"liczba" )
if tonumber(id) == tonumber id2 then
local x getElementData v"x" )
local y getElementData v"y" )
local z getElementData v"z" )
local r1 getElementData v"r1" )
local r2 getElementData v"r2" )
local r3 getElementData v"r3" )
setElementPosition vxy)
setElementRotation vr1r2r3 )
local nazwa getVehicleName )
outputChatBox "*Pojazd "..nazwa.." [ "..id2.." ] zosta? zrespawnowany w miejscu zaparkowania"player255255255 ) 
return
end
end
end
end
addCommandHandler "respawn"respawn1 )


Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-05-30, 23:30


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

PanMaszyna Nie dzia?a ;/

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-05-30, 23:36


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4394 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

Co Ci nie dzia?a ?

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-05-30, 23:46


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

PanMaszyna, Og?lnie, tworz? nowy skrypt, wklejam to, wk?adam do mety i nic po wpisaniu komendy.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-05-30, 23:51


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4394 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

Wi?c zrobi?e? co? ?le, b?d? nie odpali?e? skryptu.

Wklejasz ten kod do mety ? O.o

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-05-30, 23:58


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

PanMaszyna, No co? ty?! :D Chodzi mi, ?e wklejam <script src=" itd..

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-05-31, 00:14


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4394 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

Jako server ?

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-05-31, 00:20


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

Jako client.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-05-31, 00:29


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4394 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

Jako server daj..

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-05-31, 00:38


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

PanMaszyna Nic, i tak nie idzie. A wiesz jak zrobi? aby ka?dy m?g? wpisa? /zaparkuj, nawet nie owner?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-05-31, 00:40


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4394 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

Usuwasz warunek :

if getElementData(co1"owner" ) == getPlayerName(player) or isObjectInACLGroup ("user."..accNameaclGetGroup "Admin" ) ) then


Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-05-31, 01:12


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

PanMaszyna, Wszystko niby jest, ale respawn nadal nie dzia?a.
Kod podany przez ciebie, z usuni?t? linijk? co kaza?e?, nie dzia?a.
Kod:

function pozycja ( player )
local co1 = getPedOccupiedVehicle ( player )
if getElementData(co1, "private", true) then
local accName = getAccountName ( getPlayerAccount ( player ) )
local auto = getPedOccupiedVehicle ( player )
if auto then
local xa,ya,za = getElementPosition ( auto )
local owner = getElementData ( co1, "owner" )
local xr,yr,zr = getElementRotation ( auto )
setElementData ( auto, "r1", tonumber(xr) )
setElementData ( auto, "r2", tonumber(yr) )
setElementData ( auto, "r3", tonumber(zr) )
setElementData ( auto, "zapisany", true )
setElementData ( auto, "x", tonumber(xa) )
setElementData ( auto, "y", tonumber(ya) )
setElementData ( auto, "z", tonumber(za) )
outputChatBox ( "[AUTO]Parkowanie auta, zako?czone sukcesem.", player, 255, 255, 255 )
else
outputChatBox ( "[AUTO]Nie jeste? w pojezdzie.", player, 255, 255, 255 )
end
else
outputChatBox ( "[AUTA]Ten pojazd nale?y do "..owner..".", player, 255, 255, 255 )
end
end
end
addCommandHandler ( "zaparkuj", pozycja )


Ostatnio zmieniony przez Maximerr 2014-05-31, 01:15, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-05-31, 01:15


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4394 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

Bo on dzia?a na zasadzie /respawn <id>

Napisa?em, ?e jest ?ci?gni?ty z mojego serwera i musisz go lekko zmodyfikowa?.

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-05-31, 08:39


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

PanMaszyna, Ja tu teraz pisze o /zaparkuj, usuni?ta linijka co kaza?e?, i nie dzia?a teraz kompletnie nic.

Postaw piwo autorowi tego posta
 

 
Tagi: system :: parkowania :: pojazdów
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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