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

Wysłany: 2020-06-22, 20:54


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

najwyrazniej nie ma elementdaty ten pojazd

 local f1 getElementData(vehicle"vehicle:wheel") or {false255255255}


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Matikmontana
Wysłany: 2020-06-22, 21:10


Matikmontana

Modern Stories






Wiek: 22
Na forum: 2473 dni
Posty: 423
Nick w MP: Mazeusz*

Piwa: 1015

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%
Okej, dzi?ki za to leci respekt. Ale jeszcze jest pewien problem teraz z wczytaniem xd Do funkcji od respienia doda?em
setElementData(veh,"vehicle:wheel"vehicle["wheel"])


i jest takie g?wno :evil:
https://imgur.com/a/6tAdsQ6

[ Dodano: 2020-06-22, 22:04 ]
setElementData(veh"vehicle:wheel"v[2], v[3], v[4])
zrobi?em tak ale jest b?ad https://imgur.com/a/TgtcLFT

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-06-22, 22:14


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Patrzysz jak si? zapisuje w bazie, jesli jako jeden string to robisz funkcj? tostring() na tym co jest w bazie.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-06-22, 22:29


Matikmontana

Modern Stories






Wiek: 22
Na forum: 2473 dni
Posty: 423
Nick w MP: Mazeusz*

Piwa: 1015

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%
chodzi o takie cos ?

setElementData(veh"vehicle:wheel"tostring(v[2], v[3], v[4]))


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-06-22, 22:40


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Nie, musiszz string z bazy danych (bo to caly string) rozdzieli? za pomoc? funkcji

Więcej informacji znajdziesz w Wikipedii MTA:

split


Split zwr?ci Ci tabel? i wtedy zapisujesz to jako tabel?, gdzie w 2, 3 i 4 miejscu jest kolor R, G i B.

Co? takiego:
local dane split(...)
setElementData(xy, {falsedane[1], dane[2], dane[3]})


Zamiast false, w swoim kodzie od kolor?w masz jakie? id - musisz sobie obczai? o co z tym chodzi.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-06-22, 22:55


Matikmontana

Modern Stories






Wiek: 22
Na forum: 2473 dni
Posty: 423
Nick w MP: Mazeusz*

Piwa: 1015

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%
To id zamiast false to chyba tu jest
function setWheelColor(vehidrgb)
  if(and and b)then
    setElementData(veh"vehicle:wheel", {idrgb});
  else
    local v vehs[veh];
    if(v)then
      engineRemoveShaderFromWorldTexture(v[2], v[3], veh);

      destroyElement(v[1]);
      destroyElement(v[2]);

      vehs[veh] = nil;
    end;

    setElementData(veh"vehicle:wheel"false);
  end;
end;


a co wpisa? w tym x,y. Bo Dane to b?da wheel
Kod:

setElementData(x, y, {false, dane[1], dane[2], dane[3]})


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-06-22, 23:49


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

x to element, y to klucz element daty wed?ug

Więcej informacji znajdziesz w Wikipedii MTA:

setElementData


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-06-22, 23:52


Matikmontana

Modern Stories






Wiek: 22
Na forum: 2473 dni
Posty: 423
Nick w MP: Mazeusz*

Piwa: 1015

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%
Dobra zrobi?em tak
function onRespawnVehicles(_,id,poss)
    -- Settings (QUERY)
    if id then
        result=exports["pystories-db"]:dbGet("SELECT * FROM pystories_vehicles WHERE parking=1 AND id=?"id)
        query=exports["pystories-db"]:dbSet("UPDATE pystories_vehicles SET parking=0 WHERE id=?"id)
    else
        result=exports["pystories-db"]:dbGet("SELECT * FROM pystories_vehicles WHERE parking=0")
    end

    -- Pairs
    for ile,vehicle in pairs(result) do
        vehicles=ile
    
        if id then pos={poss[1], poss[2], poss[3], poss[4], poss[5], poss[6]}
        else pos=split(vehicle["pos"], ","end

        local color=split(vehicle["color"], ",")
        local lights=split(vehicle["headlights"], ",")


        local veh=createVehicle(vehicle["model"], pos[1], pos[2], pos[3], pos[4], pos[5], pos[6])
        setVehicleColor(vehcolor[1], color[2], color[3], color[4],color[5], color[6], color[7], color[8],color[9], color[10], color[11], color[12])
        setVehicleHeadLightColor(vehlights[1], lights[2], lights[3])
        local wheel split(vehicle["wheel"], ",")
        setElementData(veh"vehicle:wheel", {falsewheel[1], wheel[2], wheel[3]})
        if vehicle["plateText"] ~= "" then
        setVehiclePlateText(vehvehicle["plateText"])
        else
         setVehiclePlateText(vehtostring("SA "..vehicle["id"]))
        end
        if vehicle["paintjob"] ~= 3 then
        setVehiclePaintjob(vehvehicle["paintjob"])
        end
        setElementHealth(vehvehicle["health"])
        setElementData(veh,"vehicle:spawn",true)
        setElementData(veh,"vehicle:id"vehicle["id"])
tylko ?e https://imgur.com/a/16kOwwP

[ Dodano: 2020-06-23, 00:34 ]
Linijka 105
vehs[v][3] = names[wheel[1]][1];


[ Dodano: 2020-06-24, 01:02 ]
"Wilq" napisał/a:

x to element, y to klucz element daty wed?ug

Więcej informacji znajdziesz w Wikipedii MTA:

setElementData


B??dzik jest wilq help

[ Dodano: 2020-06-24, 12:54 ]
Mo?na lock Wilq pom?g? awansik dla niego poprosz? :D

Postaw piwo autorowi tego posta
 

 
Tagi: nie :: mogę :: dodać :: żadnej :: elementdaty
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Nie mogę dodać żadnej Elementdaty 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