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
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.
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.85, 12.39, 8.98, 8.57, 6.57 )
function wejdzStrefa(hitPlayer,thePlayer)
exports["lss-gui"]:eq_getItemByID(113, 30, 110, hitPlayer) -- pierwszy jest ak-47, drugi glock, trzeci 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", hitPlayer, 0, 255, 0)
else
outputChatBox("Nie posiadasz odpowiedniej broni, aby tu strzela?", hitPlayer, 0, 255, 0)
toggleControl (hitPlayer, "fire", false )
toggleControl (hitPlayer, "aim_weapon", false)
toggleControl (hitPlayer, "next_weapon", false)
toggleControl (hitPlayer, "previous_weapon", false)
end
addEventHandler( "onColShapeHit", strefa, wejdzStrefa )
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", hitPlayer, 255, 0, 0)
end
addEventHandler( "onColShapeLeave", strefa, strefaWyjdz )
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!", source, 255, 0, 0)
end
addEventHandler("onPlayerJoin", getRootElement(), blokadaBroni)
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
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