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

Wysłany: 2015-06-20, 15:45


Dixers

No-Life






Wiek: 26
Na forum: 4313 dni
Posty: 549
Nick w MP: Dixers

Piwa: 412

Respekt: 56,8

Siema. Mam kod Maxi'ego i problem polega w tym, ?e jak TYLKO zmieniam id pojazdu w tym przypadku z 596 na 418 pojawia si? b??d i db, kt?ry m?wi:
ERROR:aplety_c.lua:18:attempt to perform arithmetic on local 'z' (a nil value)

Chodzi o t? linijk?:

local marker createMarker xyz-1"cylinder"325500170 )


Ca?y kod (c-side):


okno guiCreateWindow(419223525275"Interakcja Pojazdu Specjalnego"false)
guiWindowSetSizable(oknofalse)
zamknij guiCreateButton(29020321652"Zamknij"falseokno)
grid guiCreateGridList(1429262226falseokno)
guiGridListAddColumn(grid "Interakcja"0.9)
opis guiCreateLabel(29031216113"Interakcje Pojazdu Specjalnego"falseokno)
guiLabelSetHorizontalAlign(opis"center"false)
guiLabelSetVerticalAlign(opis"center")
guiSetVisible oknofalse )

player getLocalPlayer()

function klikam()
local auto getPedOccupiedVehicle localPlayer )
if isPedInVehicle player ) and getElementModel auto ) == 418 then
if not getElementData auto"int:specjalna" then
local x,y,getVehicleComponentPosition auto"boot_dummy""world" )
local marker createMarker xyz-1"cylinder"325500170 )
setElementFrozen autotrue )
outputChatBox "W??czy?e? interakcje pojazdu specjalnego.")
setElementData auto"int:specjalna"true )
setElementData marker"marker:specjalny"getPlayerName localPlayer ) )
setElementData localPlayer"player:specjalny"true)
setVehicleDoorState auto1)
else
setElementFrozen autofalse)
for _,v in ipairs getElementsByType "marker" ) ) do
if getElementData v"marker:specjalny") == getPlayerName localPlayer then
destroyElement )
end
end
setElementData auto"int:specjalna"false )
setElementData localPlayer"player:specjalny"false )
outputChatBox "Wy??czy?e? interakcje pojazdu specjalnego.")
setVehicleDoorState auto1)
end
end
end
addCommandHandler "lspd"klikam)

function MarkerHit element )
if element ~= getLocalPlayer() then return end
if getElementData localPlayer"player:specjalny"then
if not isPedInVehicle localPlayer then
local row guiGridListAddRow (grid)
local row1 guiGridListAddRow (grid)
local row2 guiGridListAddRow (grid)
local row3 guiGridListAddRow (grid)
guiGridListSetItemText(gridrow1"Linia ga?nicza"falsefalse)
guiGridListSetItemText(gridrow11"Pi?a motorowa"falsefalse)
guiGridListSetItemText(gridrow31"AODO"falsefalse)
guiSetVisible oknotrue )
showCursor true )
end
end
end
addEventHandler "onClientMarkerHit"getRootElement(), MarkerHit )

function close()
guiSetVisible oknofalse )
showCursor false )
guiGridListClear grid )
end
addEventHandler "onClientGUIClick"zamknijclosefalse )

function p1()
local wyb guiGridListGetItemText(gridguiGridListGetSelectedItem (grid), 1)
if wyb == "Linia ga?nicza" then
triggerServerEvent ("interakcjaEMKA"getRootElement(), player )
end
end
addEventHandler "onClientGUIClick"gridp1false )

function p2()
local wyb guiGridListGetItemText(gridguiGridListGetSelectedItem (grid), 1)
if wyb == "Pi?a motorowa" then
triggerServerEvent ("interakcjaDeagle"getRootElement(), player )
end
end
addEventHandler "onClientGUIClick"gridp2false )

function p4()
local wyb guiGridListGetItemText(gridguiGridListGetSelectedItem (grid), 1)
if wyb == "AODO" then
triggerServerEvent ("interakcjaArmor"getRootElement(), player )
end
end
addEventHandler "onClientGUIClick"gridp4false )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-20, 16:23


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4838 dni
Posty: 915

Piwa: 2697

Respekt: 955,3
Respekt: 955,3Respekt: 955,3

A usun z-1 i zostaw samo z daj znac jaki wynik

Podpis
Jedyny kontakt ze mną to PW forum

Kod:


local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-20, 17:00


Dixers

No-Life






Wiek: 26
Na forum: 4313 dni
Posty: 549
Nick w MP: Dixers

Piwa: 412

Respekt: 56,8

Usuwa?em, dalej jest problem. Ju? nie ERROR, ale WARRING i marker si? w og?le i tak nie pojawia. A nawet jakby si? pojawia?, to na ?rodku pojazdu, zamiast przy baga?niku.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-20, 17:44


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4838 dni
Posty: 915

Piwa: 2697

Respekt: 955,3
Respekt: 955,3Respekt: 955,3

Bo z to jest wysoko??.
Spr?buj zrobi? to tak :


local x,y,getVehicleComponentPosition auto"boot_dummy""world" )
local marker createMarker xy-2z"cylinder"325500170 )


Podpis
Jedyny kontakt ze mną to PW forum

Kod:


local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-20, 17:45


Dixers

No-Life






Wiek: 26
Na forum: 4313 dni
Posty: 549
Nick w MP: Dixers

Piwa: 412

Respekt: 56,8

Iksdekowski, g?upi nie jestem. Pr?bowa?em. A co to za r??nica, ?e to wysoko??. Mo?e ja chc?, aby by?o wy?ej. Robi?c tak jak pokazujesz wyskakuje db ten pierwszy tyle ?e zamiast 'z' jest napisane 'y'.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-20, 17:54


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4838 dni
Posty: 915

Piwa: 2697

Respekt: 955,3
Respekt: 955,3Respekt: 955,3

Probowales to zrobic z innym pojazdem? np. Premier? Sprobuj z premierem

Podpis
Jedyny kontakt ze mną to PW forum

Kod:


local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-20, 17:59


Dixers

No-Life






Wiek: 26
Na forum: 4313 dni
Posty: 549
Nick w MP: Dixers

Piwa: 412

Respekt: 56,8

W premierze dzia?a. S?dzisz, ?e problem le?y w tym w jakim poje?dzie ma si? pojawia??

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-20, 18:01


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4838 dni
Posty: 915

Piwa: 2697

Respekt: 955,3
Respekt: 955,3Respekt: 955,3

Tak, moonbeam mo?e nie mie? baga?nika.

Podpis
Jedyny kontakt ze mną to PW forum

Kod:


local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-20, 18:05


Dixers

No-Life






Wiek: 26
Na forum: 4313 dni
Posty: 549
Nick w MP: Dixers

Piwa: 412

Respekt: 56,8

A znaczy na moonbeamie dzia?a. A rozumiem. Czyli to wyszukuje baga?nik. Taka troch? lipa. Nie spojrza?em. Dzi?ki za pomoc. Stawiam :piwo: i R*

Postaw piwo autorowi tego posta
 

 
Tagi: markery :: przy :: aucie
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