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

Wysłany: 2015-12-05, 22:17


serek123

Lua, MySql, Sql






Wiek: 27
Na forum: 4334 dni
Posty: 217
Nick w MP: Serek.

Piwa: 374

Respekt: 70

Witam robie prace i chcem aby wszystkie zawarte cele z tej pracy (markery) by?y w ni? wpisane i lecia?y po kolei od 1 do 10 kawa?ek kodu

client


local tablica = {
{},
{},
{},
{},
{},
{},
{},
{},
{},
{}
}

function start()
local x,y,tablica
local marker createMarker(x,y,z"checkpoint"325500)
end
addEvent("start"true)
addEventHandler("start"getRootElement(), start)


serwer


function zacznij ()
local pojazd createVehicle(461, -2045.52,-96.34,35.16)
warpPedIntoVehicle(sourcepojazd)
outputChatBox("Rozpocze?e? prac?")
triggerClientEvent("start"rootlocalPlayer)
end
addCommandHandler("rozpocznijprace"zacznij)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-12-05, 22:43


_Haze

Peace Yo!






Wiek: 24
Na forum: 4184 dni
Posty: 1648
Nick w MP: Haze

Piwa: 2628

Respekt: 1020
Respekt: 1020

Zobacz m?j poradnik na tema t tablic

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-12-05, 23:13


serek123

Lua, MySql, Sql






Wiek: 27
Na forum: 4334 dni
Posty: 217
Nick w MP: Serek.

Piwa: 374

Respekt: 70

Widzia?em za wiele mi nie pom?g?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-12-06, 10:45


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
O ile si? nie myl? takie co? powinno dzia?a?:


local tablica = {
{},
{},
{},
{},
{},
{},
{},
{},
{},
{}
}

function WMarker(hemd)
if not md then return edn
if he ~= localPlayer then return end
if not getElementData(source"Egzamin"then return end
destroyElement(source)
postep postep 1
local x,y,tablica[postep1][1], tablica[postep][2], tablica[postep][3]
local marker createMarker(x,y,z"checkpoint"325500)
end)

function start()
local x,y,tablica[1][1], tablica[1][2], tablica[1][3]
local marker createMarker(x,y,z"checkpoint"325500)
setElementData(marker"Egzamin"true)
postep 1
addEventHandler("onMarkerHit"resourceRootWMarker)
end
addEvent("start"true)
addEventHandler("start"getRootElement(), start)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-12-06, 12:32


serek123

Lua, MySql, Sql






Wiek: 27
Na forum: 4334 dni
Posty: 217
Nick w MP: Serek.

Piwa: 374

Respekt: 70

Niestety nie dzia?a

[ Dodano: 2015-12-06, 12:34 ]
Znaczy marker po wej?ciu nie znika

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-12-06, 12:42


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%


local tablica = {
{},
{},
{},
{},
{},
{},
{},
{},
{},
{}
}

function WMarker(hemd)
if not md then return edn
if he ~= localPlayer then return end
if not getElementData(source"Egzamin"then return end
destroyElement(source)
postep postep 1
local x,y,tablica[postep1][1], tablica[postep][2], tablica[postep][3]
local marker createMarker(x,y,z"checkpoint"325500)
end)

function start()
local x,y,tablica[1][1], tablica[1][2], tablica[1][3]
local marker createMarker(x,y,z"checkpoint"325500)
setElementData(marker"Egzamin"true)
postep 1
addEventHandler("onClientMarkerHit"resourceRootWMarker)
end
addEvent("start"true)
addEventHandler("start"getRootElement(), start)


wybacz, pomyli?em eventy ze stronami xD

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-12-06, 12:51


serek123

Lua, MySql, Sql






Wiek: 27
Na forum: 4334 dni
Posty: 217
Nick w MP: Serek.

Piwa: 374

Respekt: 70

Dobra pierwszy marker znika ale nast?pny ju? nie

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-12-06, 12:55


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
serek123, kolejne moje niedopatrzenie.


function WMarker(hemd)
if not md then return edn
if he ~= localPlayer then return end
if not getElementData(source"Egzamin"then return end



destroyElement(source)
postep postep 1
local x,y,tablica[postep1][1], tablica[postep][2], tablica[postep][3]
local marker createMarker(x,y,z"checkpoint"325500)
setElementData(marker"Egzamin"true)

end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-12-06, 13:02


serek123

Lua, MySql, Sql






Wiek: 27
Na forum: 4334 dni
Posty: 217
Nick w MP: Serek.

Piwa: 374

Respekt: 70

Nie znika nadal to samo

[ Dodano: 2015-12-06, 13:21 ]
Dobra wszystko lata narazie nie zamykaj jak sko?cz? t? prace to napisze Ci o zamkni?ciu lub nowym problemie i leci piwko

[ Dodano: 2015-12-06, 14:05 ]

[ Dodano: 2015-12-06, 14:06 ]
Dorobi?em takie co? z pomoc? kolegi ale nie dzia?a chodzi o to ?e jak wjedzie w ostatni marker to ma znika? pojazd


function start(plr)
local x,y,tablica[1][1], tablica[1][2], tablica[1][3]
local marker createMarker(x,y,z"checkpoint"325500)
setElementData(marker"Egzamin"true)
postep 1
addEventHandler("onClientMarkerHit"rootWMarker)
if isPedInVehicle(plrthen
auto getPedOccupiedVehicle(plr)
end
if postep == #tabela then
else
destroyElement(auto)
end
end
addEvent("start"true)
addEventHandler("start"getRootElement(), start)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-12-06, 14:20


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%


function start(plr)
local x,y,tablica[1][1], tablica[1][2], tablica[1][3]
local marker createMarker(x,y,z"checkpoint"325500)
setElementData(marker"Egzamin"true)
postep 1
addEventHandler("onClientMarkerHit"rootWMarker)
if isPedInVehicle(plrthen
auto getPedOccupiedVehicle(localPlayer)
end
if postep == #tabela then
if not auto then return end
destroyElement(auto)
end
end
addEvent("start"true)
addEventHandler("start"getRootElement(), start)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-12-06, 14:40


serek123

Lua, MySql, Sql






Wiek: 27
Na forum: 4334 dni
Posty: 217
Nick w MP: Serek.

Piwa: 374

Respekt: 70

Nie dzia?a db3

1.Bad argument 'isPedInVehicle' [Expected ped at argument 1got nil]--po resecie skryptu
2.attemp to get lenght of global 'tabela' (a nil value)--po resecie skryptu Nie dzia?a nawet jak zmienie z localnej na globaln?
3.attempt to index field '?' (a nil value)--Wyskakuje jak wjade w ostatni marker


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-12-06, 16:09


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
Boshe, nie patrz? na ca?y kod, ale to chyba jest na tyle proste, ?e mo?na samemu poprawi?...

Powiedz mi sk?d tam wytrzasn??e? plr?



function start(plr)
local x,y,tablica[1][1], tablica[1][2], tablica[1][3]
local marker createMarker(x,y,z"checkpoint"325500)
setElementData(marker"Egzamin"true)
postep 1
addEventHandler("onClientMarkerHit"rootWMarker)
if isPedInVehicle(localPlayerthen
auto getPedOccupiedVehicle(localPlayer)
end
if postep == #tablica then
if not auto then return end
destroyElement(auto)
end
end
addEvent("start"true)
addEventHandler("start"getRootElement(), start)



2 Sprawa... Nie masz przecie? zmiennej tabela tylko tablica...

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-12-06, 16:15


serek123

Lua, MySql, Sql






Wiek: 27
Na forum: 4334 dni
Posty: 217
Nick w MP: Serek.

Piwa: 374

Respekt: 70

attemp to get lenght of global 'tabela' (a nil value)
attempt to index field '?' (a nil value)
db 3 wywala i nie niszczy pojazdu

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-12-06, 16:19


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
Dobra, wr??my do ostatniego dobrego rozwi?zania, zanim tam co? ten znajomy namodzi?...

Zr?b to tak i powinno dzia?a?:



local tablica = {
{},
{},
{},
{},
{},
{},
{},
{},
{},
{}
}


function WMarker(hemd)
if not md then return edn
if he ~= localPlayer then return end
if not getElementData(source"Egzamin"then return end

if not getPedOccupiedVehicle(localPlayerthen return end

if postep == #tablica then
destroyElement(getPedOccupiedVehicle(localPlayer))
return end

destroyElement(source)
postep postep 1
local x,y,tablica[postep1][1], tablica[postep][2], tablica[postep][3]
local marker createMarker(x,y,z"checkpoint"325500)
setElementData(marker"Egzamin"true)
end)

function start()
local x,y,tablica[1][1], tablica[1][2], tablica[1][3]
local marker createMarker(x,y,z"checkpoint"325500)
setElementData(marker"Egzamin"true)
postep 1
addEventHandler("onClientMarkerHit"resourceRootWMarker)
end
addEvent("start"true)
addEventHandler("start"getRootElement(), start)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-12-06, 16:24


serek123

Lua, MySql, Sql






Wiek: 27
Na forum: 4334 dni
Posty: 217
Nick w MP: Serek.

Piwa: 374

Respekt: 70

Po wje?dzie w ostatni marker pojazd ani on nie znika

Postaw piwo autorowi tego posta
 

 
Tagi: tablice
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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