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

Wysłany: 2020-06-24, 12:51


Matikmontana

Modern Stories






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

Piwa: 1015

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%
Siemaneczko, problemik ze skrypcikiem a dok?adnie





addCommandHandler("opona", function(_rgb)
  local veh getPedOccupiedVehicle(localPlayer);
  if(not veh)then return end;
  
  local tune getVehicleUpgrades(veh);
  for i,v in pairs(tune) do
    if(names[v])then
      setWheelColor(vehvrgb);
    end;
  end;
end);

local vehs = {};

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;

addEventHandler("onClientRender"root, function()
  for i,v in pairs(getElementsByType("vehicle"true)) do
    local wheel getElementData(v"vehicle:wheel");
    if(not vehs[v] and wheel)then
      vehs[v] = {};

      vehs[v][1] = dxCreateRenderTarget(256256true);
      vehs[v][2] = dxCreateShader("s/shader.fx");
      vehs[v][3] = names[wheel[1]][1];

      dxSetRenderTarget(vehs[v][1], true);
        dxDrawRectangle(00256256tocolor(wheel[2], wheel[3], wheel[4]));
        dxDrawImage(00256256names[wheel[1]][2]);
      dxSetRenderTarget();
      dxSetShaderValue(vehs[v][2], "shader"vehs[v][1]);
  
      engineApplyShaderToWorldTexture(vehs[v][2], names[wheel[1]][1], v);
    end;
  end;
end);


Podpis


Modern Stories
Discord
https://discord.gg/MRJSYq8
Forum
https://msmta.pl
Panel Gracza
https://panel.msmta.pl
Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-06-24, 12:52


TheSebaPL

Mod-team






Wiek: 21
Na forum: 3098 dni
Posty: 964

Piwa: 3102

Respekt: 640,5
Respekt: 640,5Respekt: 640,5

Matikmontana, poka? jeszcze kt?ra to 105 linijka.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-06-24, 12:54


Matikmontana

Modern Stories






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

Piwa: 1015

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%
 vehs[v][3] = names[wheel[1]][1];
this

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-06-24, 13:45


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Najwyra?niej tabela 'names' nie zawiera element?w, kt?re s? pobierane z tabeli wheel.
Musisz doda? odpowiednie elementy, kt?re chcesz u?y? do tej tabeli 'names'.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-06-24, 17:31


Matikmontana

Modern Stories






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

Piwa: 1015

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%
Jaki? przyk?ad, albo co? bo nie wiem od czego zacz??

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-06-24, 19:04


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Po prostu nie masz tabeli 'names', musisz j? stworzy? - co w niej ma by? to musisz przeanalizowa? ten kod, gdzie te tabele wykorzystujesz.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-06-24, 19:12


Matikmontana

Modern Stories






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

Piwa: 1015

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%
Wy?ej pokazana jest cz??? skryptu. To reszta
local names = {
  [1078] = {"5zigen 3""i/twist.png"}, -- twisty
  [1074] = {"BSS_STYLE03""i/mega.png"}, -- megi
  [1073] = {"RACINGHART_STYLE02""i/shadow.png"}, -- shadowy
  [1080] = {"BSS_STYLE05""i/switch.png"}, -- switch
  [1096] = {"ROJA_STYLE03""i/ahab.png"}, -- ahaby
  [1097] = {"VOLK_STYLE01""i/virtuale.png"}, -- virutale
  [1077] = {"KONIG_STYLE03""i/classic.png"}, -- classici
  [1076] = {"OZ_STYLE02""i/wiresy.png"}, -- wiresy
  [1079] = {"BSS_STYLE04""i/cutter.png"}, -- cuttery
  [1081] = {"OZ_STYLE04""i/grove.png"}, -- grove
  [1083] = {"OZ_STYLE01""i/dollar.png"}, -- dolary
  [1075] = {"RACINGHART_STYLE01""i/rimki.png"}, -- rimki
  [1098] = {"KONIG_STYLE01""i/access.png"}, -- accessy
  [1084] = {"ADR_STYLE04""i/trance.png"}, -- trance
  [1082] = {"LOWENHART_STYLE03""i/import.png"}, -- importy
}


[ Dodano: 2020-06-24, 19:43 ]
Niby dobrze chyba

[ Dodano: 2020-06-24, 20:06 ]
Ale nadal jest b??d z linijka 105

[ Dodano: 2020-06-24, 23:19 ]
"Wilq" napisał/a:

Po prostu nie masz tabeli 'names', musisz j? stworzy? - co w niej ma by? to musisz przeanalizowa? ten kod, gdzie te tabele wykorzystujesz.


Wiesz co tu dalej. Bo nie ogarniam...

Postaw piwo autorowi tego posta
 

 
Tagi: attempt :: index :: field
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » attempt to index field Odpowiedz do tematu

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