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

Wysłany: 2016-02-13, 02:35


Loop

Inspektor






Wiek: 27
Na forum: 4289 dni
Posty: 311
Nick w MP: Inspektor

Piwa: 201

Respekt: 130
Respekt: 130

A wiec witam. Mam problem z przyrownania jednej liczby do drugiej w sensie
Gdy np. 1zmienna = 1 a 2 zmiennna =3
if 1zmienna == 2zmienna then -- to mowe wejsc do pojazdu
Pozniej przedstawie wam kod

function wejdzEnter(plrseat)
  if seat == 0 then
  local level getElementData(plr"level") or " "
  local pojazd_owner getElementData(source"pojazd_owner") 
  local wlasciciel getElementData(plr"user:id") 

  if not wlasciciel == pojazd_owner or level == "RCON" or level == "Admin" then then 
        outputChatBox("Nie masz kluczyk?w do tego pojazdu."player255255255true)
        cancelEvent()
end
end
end


Nigdy z takim czyms sie nie spotkalem wiec prosze Was o pomoc

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-13, 03:08


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

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

Ostrzeżeń: 60%

function wejdzEnter(plrseat)
  if seat == 0 then
  local level getElementData(plr"level") or " "
  if level == "Admin" or level == "RCON" then return end

  local pojazd_owner getElementData(source"pojazd_owner") 
  local wlasciciel getElementData(plr"user:id") 
  if pojazd_owner == wlasciciel then return end
        outputChatBox("Nie masz kluczyk?w do tego pojazdu."player255255255true)
        cancelEvent()
end
end


Nie jestem tylko pewien czy b?dzie dzia?a?, bo bie wiem co przechowujesz pod pojazd_wlasciciel, cxy id, czy login czy co? innego...

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-13, 11:48


Loop

Inspektor






Wiek: 27
Na forum: 4289 dni
Posty: 311
Nick w MP: Inspektor

Piwa: 201

Respekt: 130
Respekt: 130

local pojazd_owne ID ktore pobiera sie z bazy danych


/edit
Dalej to samo

Ostatnio zmieniony przez Loop 2016-02-13, 11:53, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-13, 11:49


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

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

Ostrzeżeń: 60%
DestroY, je?eli id gracza to ten kod powinien ?mia?o lata?. Ewentualnie podaj db3, mo?e co? popapra?em.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-13, 11:58


Loop

Inspektor






Wiek: 27
Na forum: 4289 dni
Posty: 311
Nick w MP: Inspektor

Piwa: 201

Respekt: 130
Respekt: 130

Brak jakichkolwiek bled?w w db3

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-13, 12:17


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

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

Ostrzeżeń: 60%
Dobra, zr?b to inaczej i podaj te linijki co Ci wy?wietli, b?dzie pewno??, co pobiera i wtedy to si? zrobi.


function wejdzEnter(plrseat)
  if seat == 0 then
  local level getElementData(plr"level") or " "
 outputChatBox(level,plr)
  local pojazd_owner getElementData(source"pojazd_owner") 
  local wlasciciel getElementData(plr"user:id") 
 outputChatBox(pojazd_owner,plr)
 outputChatBox(wlascicielplr)
end
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-13, 12:28


Loop

Inspektor






Wiek: 27
Na forum: 4289 dni
Posty: 311
Nick w MP: Inspektor

Piwa: 201

Respekt: 130
Respekt: 130

1
1
Wiec wszystko powinno dzialac jak nalezy a w aucie nie swoim
1
14

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-13, 12:33


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

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

Ostrzeżeń: 60%
Okej, a jeszcze to z elementDat? level jak by? m?g? to podaj.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-13, 12:52


Loop

Inspektor






Wiek: 27
Na forum: 4289 dni
Posty: 311
Nick w MP: Inspektor

Piwa: 201

Respekt: 130
Respekt: 130

RCON

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-13, 12:59


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

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

Ostrzeżeń: 60%


function wejdzEnter(plrseatjacked)
  if seat ~= 0 then return end
  
  
  
  local level getElementData(plr"level") or " "
  
  if level == "Admin" or level == "RCON" then 
  outputChatBox("Wchodzisz do pojazdu jako administrator."plr255255255true)
  return end

  local pojazd_owner tonumber(getElementData(source"pojazd_owner"))
  local wlasciciel tonumber(getElementData(plr"user:id"))
  
  if pojazd_owner == wlasciciel then
  outputChatBox("Wchodzisz do pojazdu jako w?a?ciciel."plr255255255true)
  return end
  
  
  
  outputChatBox("Nie masz kluczyk?w do tego pojazdu."plr255255255true)
  cancelEvent()
end
addEventHandler("onVehicleEnter"rootwejdzEnter)


Powinno dzia?a?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-13, 18:21


Loop

Inspektor






Wiek: 27
Na forum: 4289 dni
Posty: 311
Nick w MP: Inspektor

Piwa: 201

Respekt: 130
Respekt: 130

Dzieki dziala :piwo: :piwo:

Postaw piwo autorowi tego posta
 

 
Tagi: mta :: chyba :: nie :: potrafi :: przyrownywac :: licz
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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