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

Wysłany: 2014-05-25, 14:20


maxerxxl







Wiek: 30
Na forum: 5067 dni
Posty: 285
Nick w MP: MaXI

Piwa: 38

Respekt: 45,3

Ostrzeżeń: 100%
Witam, mam pewien problem ot?? zrobi?em system prywatnych pojazd?w, dorobi?em jeszcze ?eby tylko blokowa?o te pojazdy kt?re s? dodane w xml a te kt?re przez mape to nie, no okej, ale kod szfankuje.

Kod:

addEventHandler ( "onVehicleStartEnter", root, function(player,seat,jacked)
if getElementData (source, "zezwolenie" ) then
if seat==0 then
local playeraccount = getPlayerAccount ( player )
auto = getPedOccupiedVehicle ( player )
owner1 = getElementData ( auto, "owner" )
konto = getPlayerAccount ( player )
if not getAccountData(playeraccount, "prawojazdy") then
outputChatBox ("* Nie posiadasz prawa jazdy lub zosta?o ono cofni?te!", player, 255, 0, 0, true)
cancelEvent () return end
--if getAccountData ( konto, "mandaty" ) ~= "2" then
--outputChatBox ("* Posiadasz 3 mandaty lub wi?cej, op?a? je w urz?dzie miasta!",player)
--cancelEvent () return end
end
if getPlayerName(player) ~= owner1 then
outputChatBox ("* Nie masz kluczy do tego pojazdu!",player)
cancelEvent () return end
end
end)


jak ten kod if getElementData (source, "zezwolenie" ) then dam pod seat to blokuje ka?dego pojazdu na mapie, ale ju? gracz Na G nie mo?e wej?? i w tym problem, jak dam przed seat to Gracz na G mo?e wej?? ale ju? blokuje wszystkie pojazdy.

M?g?by kto? mi poprawi? ten kod?
z g?ry dzi?kuje.!

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-05-25, 14:22


MeeShuffle

Programista/Grafik






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

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

Zamie? seat z getElementData
Po co ci 2x getPlayerAccount ?

Podpis

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

 
Wysłany: 2014-05-25, 14:27


maxerxxl







Wiek: 30
Na forum: 5067 dni
Posty: 285
Nick w MP: MaXI

Piwa: 38

Respekt: 45,3

Ostrzeżeń: 100%
Pisa?em przecie? ?e jak zmieni? kolejno?? to znowu b?dzie to samo ale Gracz na G mo?e wej?? ale ju? blokuje wszystkie pojazdy. ..

Postaw piwo autorowi tego posta
 

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


MeeShuffle

Programista/Grafik






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

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

Jak blokuje wszystkie pojazdy ? Ci??ko t?umaczysz

Podpis

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

 
Wysłany: 2014-05-25, 14:37


maxerxxl







Wiek: 30
Na forum: 5067 dni
Posty: 285
Nick w MP: MaXI

Piwa: 38

Respekt: 45,3

Ostrzeżeń: 100%
blokuje wszystkie pojazdy = pojazdy kt?re zosta?y zrespawnowane przez panel admina, lub przez map? dodane.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-05-25, 14:38


MeeShuffle

Programista/Grafik






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

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

W jaki spos?b blokuje no kurde..

Podpis

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

 
Wysłany: 2014-05-25, 14:50


maxerxxl







Wiek: 30
Na forum: 5067 dni
Posty: 285
Nick w MP: MaXI

Piwa: 38

Respekt: 45,3

Ostrzeżeń: 100%
?e nie mog? wej?? do pojazdu bo nie mam kluczy.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-05-25, 15:10


MeeShuffle

Programista/Grafik






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

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

pomi?dzy cancelEvent() a if getPlayerName(player) ~= owner1 then

usu? end i daj go na ko?cu

Podpis

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

 
Wysłany: 2014-05-25, 15:44


maxerxxl







Wiek: 30
Na forum: 5067 dni
Posty: 285
Nick w MP: MaXI

Piwa: 38

Respekt: 45,3

Ostrzeżeń: 100%
nie rozumiem twojej wypowiedzi, doda?by? mi do tego kodu?
z g?ry dzi?kuje
Kod:

addEventHandler ( "onVehicleStartEnter", root, function(player,seat,jacked)
if getElementData (source, "zezwolenie" ) then
if seat==0 then
local playeraccount = getPlayerAccount ( player )
auto = getPedOccupiedVehicle ( player )
owner1 = getElementData ( auto, "owner" )
konto = getPlayerAccount ( player )
if not getAccountData(playeraccount, "prawojazdy") then
outputChatBox ("* Nie posiadasz prawa jazdy lub zosta?o ono cofni?te!", player, 255, 0, 0, true)
cancelEvent () return end
--if getAccountData ( konto, "mandaty" ) ~= "2" then
--outputChatBox ("* Posiadasz 3 mandaty lub wi?cej, op?a? je w urz?dzie miasta!",player)
--cancelEvent () return end
end
if getPlayerName(player) ~= owner1 then
outputChatBox ("* Nie masz kluczy do tego pojazdu!",player)
cancelEvent () return end
end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-05-25, 15:45


MeeShuffle

Programista/Grafik






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

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

addEventHandler ( "onVehicleStartEnter", root, function(player,seat,jacked)
if getElementData (source, "zezwolenie" ) then
if seat==0 then
local playeraccount = getPlayerAccount ( player )
auto = getPedOccupiedVehicle ( player )
owner1 = getElementData ( auto, "owner" )
konto = getPlayerAccount ( player )
if not getAccountData(playeraccount, "prawojazdy") then
outputChatBox ("* Nie posiadasz prawa jazdy lub zosta?o ono cofni?te!", player, 255, 0, 0, true)
cancelEvent () return end
--if getAccountData ( konto, "mandaty" ) ~= "2" then
--outputChatBox ("* Posiadasz 3 mandaty lub wi?cej, op?a? je w urz?dzie miasta!",player)
--cancelEvent () return end
if getPlayerName(player) ~= owner1 then
outputChatBox ("* Nie masz kluczy do tego pojazdu!",player)
cancelEvent () return end
end
end
end)

Podpis

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

 
Tagi: prywatne :: pojazdy
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Prywatne pojazdy 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