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

Wysłany: 2018-03-06, 21:43


Yami

Mapper / Uczeń LUA






Wiek: 25
Na forum: 3059 dni
Posty: 379

Piwa: 97

Respekt: 235
Respekt: 235Respekt: 235

mia?bym do ciebie pro?b? Ciastuu?, zobaczy?by? u siebie jako? na serwerze czy to dzia?a czy cos?
Bo nie wiem w czym ja pope?niam b??d

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-07, 11:20


Ciastuuś

Truck soon...






Wiek: 26
Na forum: 3071 dni
Posty: 799
Nick w MP: Ciastuuś

Piwa: 4297

Respekt: 640
Respekt: 640Respekt: 640

Trzymaj, ( Tutaj jest wyznaczona strefa https://i.imgur.com/UogkGXE.jpg )

Skrypt polega na tym, ?e wchodz?c w stref? bez wyznaczonej broni nie mo?emy nic robi?. A, gdy wejdziemy z odpowiedni? broni? w r?ce to mo?emy strzela?. W strefie w kt?rej strzelamy nie mo?emy zmienia? broni z powodu tego, ?e b?dzie mo?na u?y? innej, kt?ra jest niedozwolona, a na to nie mam pomys?u. Ale, po za stref? strzelania mo?na zmienia? bro? przy czym jest to bezproblemowe. Wszystko jest sprawdzanie i kod w stu procentach dzia?a. ?adnych b??d?w. A, chcia?bym doda?, ?e po wej?ciu na serwer nie mo?emy strzela? i celowa? tak jak po wyj?ciu z strefy. Wszystko mo?esz zmieni? oczywi?cie

strefa createColCuboid 1787.30, -1916.8512.398.988.576.57 ) 

function wejdzStrefa(hitPlayer,thePlayer)
  local bronID getPedWeapon(hitPlayer)
   if bronID == 30 or bronID == 22 or bronID == 24 then
    toggleControl (hitPlayer"fire"true ) 
    toggleControl (hitPlayer"aim_weapon"true)
    toggleControl (hitPlayer"next_weapon"false)
    toggleControl (hitPlayer"previous_weapon"false)
    outputChatBox("Mo?esz tylko u?ywa? w tej strefie: AK-47, Glock, Deagle"hitPlayer02550)
  else
    outputChatBox("Nie posiadasz odpowiedniej broni, aby tu strzela?"hitPlayer02550)
     toggleControl (hitPlayer"fire"false ) 
     toggleControl (hitPlayer"aim_weapon"false)
     toggleControl (hitPlayer"next_weapon"false)
     toggleControl (hitPlayer"previous_weapon"false)
   end
end  
addEventHandler"onColShapeHit"strefawejdzStrefa ) 

function strefaWyjdz(hitPlayer,thePlayer) 
 toggleControl (hitPlayer"fire"false) 
 toggleControl (hitPlayer"aim_weapon"false)
 toggleControl (hitPlayer"next_weapon"true)
 toggleControl (hitPlayer"previous_weapon"true)
 outputChatBox("Opu?ci?e? stref? w kt?rej nie mo?na u?ywa? broni"hitPlayer25500end 
addEventHandler"onColShapeLeave"strefastrefaWyjdz ) 

function blokadaBroni()
 toggleControl (source"fire"false) 
 toggleControl (source"aim_weapon"false)
 toggleControl (source"next_weapon"true)
 toggleControl (source"previous_weapon"true)
 outputChatBox("Na serwerze mo?na u?ywa? broni w wskazanej strefie!"source25500end
addEventHandler("onPlayerJoin"getRootElement(), blokadaBroni)


Podpis
Truck soon...
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-07, 13:45


Yami

Mapper / Uczeń LUA






Wiek: 25
Na forum: 3059 dni
Posty: 379

Piwa: 97

Respekt: 235
Respekt: 235Respekt: 235

A da rade tak ?e na GM XyzzyRP zrobi??
Bo tam masz inne ID przedmiot?w, i ?eby tak ?e tylko w cuboidzie wyci?ga? dany przedmiot, ja pr?bowa?em przerobi? ale mi si? nie uda?o.

Ja zrobi?em tak ale nie dzia?a:

strefa createColCuboid 1787.30, -1916.8512.398.988.576.57 ) 

function wejdzStrefa(hitPlayer,thePlayer)
  local item.wepid getPedWeapon(hitPlayer)
    exports["lss-core"]:   if item.wepid == 113 elseif item.wepid == 112 elseif item.wepid == 110 then
    toggleControl (hitPlayer"fire"true ) 
    toggleControl (hitPlayer"aim_weapon"true)
    toggleControl (hitPlayer"next_weapon"false)
    toggleControl (hitPlayer"previous_weapon"false)
    outputChatBox("Mo?esz tylko u?ywa? w tej strefie: AK-47, Glock, Deagle"hitPlayer02550)
  else
    outputChatBox("Nie posiadasz odpowiedniej broni, aby tu strzela?"hitPlayer02550)
     toggleControl (hitPlayer"fire"false ) 
     toggleControl (hitPlayer"aim_weapon"false)
     toggleControl (hitPlayer"next_weapon"false)
     toggleControl (hitPlayer"previous_weapon"false)
   end
end  
addEventHandler"onColShapeHit"strefawejdzStrefa ) 

function strefaWyjdz(hitPlayer,thePlayer) 
 toggleControl (hitPlayer"fire"false) 
 toggleControl (hitPlayer"aim_weapon"false)
 toggleControl (hitPlayer"next_weapon"true)
 toggleControl (hitPlayer"previous_weapon"true)
 outputChatBox("Opu?ci?e? stref? w kt?rej nie mo?na u?ywa? broni"hitPlayer25500end 
addEventHandler"onColShapeLeave"strefastrefaWyjdz ) 

function blokadaBroni()
 toggleControl (source"fire"false) 
 toggleControl (source"aim_weapon"false)
 toggleControl (source"next_weapon"true)
 toggleControl (source"previous_weapon"true)
 outputChatBox("Na serwerze mo?na u?ywa? broni w wskazanej strefie!"source25500end
addEventHandler("onPlayerJoin"getRootElement(), blokadaBroni)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-07, 14:24


Ciastuuś

Truck soon...






Wiek: 26
Na forum: 3071 dni
Posty: 799
Nick w MP: Ciastuuś

Piwa: 4297

Respekt: 640
Respekt: 640Respekt: 640

Niestety nie posiadam jakiejkolwiek wiedzy o XyzzyRP, ale z tego co doczyta?em z kodu odpowiada za sprawdzanie

exports["lss-gui"]:eq_getItemByID(ID_PRZEDMIOTU)


A, wi?c co dalej doczyta?em liczby wstawia si? po przecinku, a wi?c...

exports["lss-gui"]:eq_getItemByID(11330110) -- pierwszy jest ak-47drugi glocktrzeci deagle


Wi?c o ile si? nie myl?, powinno wygl?da? to tak...

strefa createColCuboid 1787.30, -1916.8512.398.988.576.57 ) 

function wejdzStrefa(hitPlayer,thePlayer)
   exports["lss-gui"]:eq_getItemByID(11330110hitPlayer) -- pierwszy jest ak-47drugi glocktrzeci deagle
    toggleControl (hitPlayer"fire"true ) 
    toggleControl (hitPlayer"aim_weapon"true)
    toggleControl (hitPlayer"next_weapon"false)
    toggleControl (hitPlayer"previous_weapon"false)
    outputChatBox("Mo?esz tylko u?ywa? w tej strefie: AK-47, Glock, Deagle"hitPlayer02550)
  else
    outputChatBox("Nie posiadasz odpowiedniej broni, aby tu strzela?"hitPlayer02550)
     toggleControl (hitPlayer"fire"false ) 
     toggleControl (hitPlayer"aim_weapon"false)
     toggleControl (hitPlayer"next_weapon"false)
     toggleControl (hitPlayer"previous_weapon"false)
   end
end  
addEventHandler"onColShapeHit"strefawejdzStrefa ) 

function strefaWyjdz(hitPlayer,thePlayer) 
 toggleControl (hitPlayer"fire"false) 
 toggleControl (hitPlayer"aim_weapon"false)
 toggleControl (hitPlayer"next_weapon"true)
 toggleControl (hitPlayer"previous_weapon"true)
 outputChatBox("Opu?ci?e? stref? w kt?rej nie mo?na u?ywa? broni"hitPlayer25500end 
addEventHandler"onColShapeLeave"strefastrefaWyjdz ) 

function blokadaBroni()
 toggleControl (source"fire"false) 
 toggleControl (source"aim_weapon"false)
 toggleControl (source"next_weapon"true)
 toggleControl (source"previous_weapon"true)
 outputChatBox("Na serwerze mo?na u?ywa? broni w wskazanej strefie!"source25500end
addEventHandler("onPlayerJoin"getRootElement(), blokadaBroni)


Podpis
Truck soon...
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-07, 16:16


Yami

Mapper / Uczeń LUA






Wiek: 25
Na forum: 3059 dni
Posty: 379

Piwa: 97

Respekt: 235
Respekt: 235Respekt: 235

Niestety to te? nie dzia?a
DB3:
ERROR: Loading script failed: bron/server.lua:10: 'end' expected (to close 'function' at line 3) near 'else'

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-07, 16:23


Ciastuuś

Truck soon...






Wiek: 26
Na forum: 3071 dni
Posty: 799
Nick w MP: Ciastuuś

Piwa: 4297

Respekt: 640
Respekt: 640Respekt: 640

"ReMiK1337" napisał/a:

Niestety to te? nie dzia?a
DB3:
ERROR: Loading script failed: bron/server.lua:10: 'end' expected (to close 'function' at line 3) near 'else'


Naucz si? rozwi?zywa? takie problemy Sam... Nie mam jak tego sprawdzi? ze wzgl?du na to, ?e posiadam na Swoim serwerze XyzzyRP. Musisz usun?? jednego end'a

strefa createColCuboid 1787.30, -1916.8512.398.988.576.57 ) 

function wejdzStrefa(hitPlayer,thePlayer)
   exports["lss-gui"]:eq_getItemByID(11330110hitPlayer) -- pierwszy jest ak-47drugi glocktrzeci deagle
    toggleControl (hitPlayer"fire"true ) 
    toggleControl (hitPlayer"aim_weapon"true)
    toggleControl (hitPlayer"next_weapon"false)
    toggleControl (hitPlayer"previous_weapon"false)
    outputChatBox("Mo?esz tylko u?ywa? w tej strefie: AK-47, Glock, Deagle"hitPlayer02550)
  else
    outputChatBox("Nie posiadasz odpowiedniej broni, aby tu strzela?"hitPlayer02550)
     toggleControl (hitPlayer"fire"false ) 
     toggleControl (hitPlayer"aim_weapon"false)
     toggleControl (hitPlayer"next_weapon"false)
     toggleControl (hitPlayer"previous_weapon"false)
end  
addEventHandler"onColShapeHit"strefawejdzStrefa ) 

function strefaWyjdz(hitPlayer,thePlayer) 
 toggleControl (hitPlayer"fire"false) 
 toggleControl (hitPlayer"aim_weapon"false)
 toggleControl (hitPlayer"next_weapon"true)
 toggleControl (hitPlayer"previous_weapon"true)
 outputChatBox("Opu?ci?e? stref? w kt?rej nie mo?na u?ywa? broni"hitPlayer25500end 
addEventHandler"onColShapeLeave"strefastrefaWyjdz ) 

function blokadaBroni()
 toggleControl (source"fire"false) 
 toggleControl (source"aim_weapon"false)
 toggleControl (source"next_weapon"true)
 toggleControl (source"previous_weapon"true)
 outputChatBox("Na serwerze mo?na u?ywa? broni w wskazanej strefie!"source25500end
addEventHandler("onPlayerJoin"getRootElement(), blokadaBroni)


Podpis
Truck soon...
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-07, 17:00


Yami

Mapper / Uczeń LUA






Wiek: 25
Na forum: 3059 dni
Posty: 379

Piwa: 97

Respekt: 235
Respekt: 235Respekt: 235

Niestety wci?? ten sam b??d

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-07, 17:12


Ciastuuś

Truck soon...






Wiek: 26
Na forum: 3071 dni
Posty: 799
Nick w MP: Ciastuuś

Piwa: 4297

Respekt: 640
Respekt: 640Respekt: 640

"ReMiK1337" napisał/a:

Niestety wci?? ten sam b??d


Musisz Sam popr?bowa?. Mi nie zadzia?a kod ze wzgl?du na brak posiadania funkcji exportu. Rozumiem, ?e mamy pomaga?, ale nie w napisaniu ca?ego kodu. Powodzenia :)

Podpis
Truck soon...
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-07, 17:42


Yami

Mapper / Uczeń LUA






Wiek: 25
Na forum: 3059 dni
Posty: 379

Piwa: 97

Respekt: 235
Respekt: 235Respekt: 235

A no spoko
Popr?buje sam
I tak mi bardzo pomog?e?
Dzi?kuje

Postaw piwo autorowi tego posta
 

 
Tagi: cuboid
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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