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

Wysłany: 2016-02-04, 21:14


PremierQ







Wiek: 31
Na forum: 3881 dni
Posty: 29
Nick w MP: PremierQ

Piwa: 4

Respekt: 50

Chcia?bym zrobi? by tylko w jednym miejscu na mapie mo?na by?o si? strzela? i etc.
W jaki spos?b m?g?bym to zrobi?? Starali?my si? skonfigurowa? ten plugin ale nie uda?o nam si? doj?? do tego.

Je?li linki s? zabronione prosz? usun?? link, a z edytuj? ten post.

https://community.multitheftauto.com/index.php?p=resources&s=details&id=9680

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-04, 21:28


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

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

Ostrzeżeń: 60%
PremierQ, po prostu przemie? to, je?eli wchodzi do strefy - odblokuj strzelanie i usun godmoda, jezeli wychodzi wy??cz strzelanie i nadaj godmoda. Jednym s?owem pozamieniaj to, tak aby by?o na odwr?t.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-04, 21:42


PremierQ







Wiek: 31
Na forum: 3881 dni
Posty: 29
Nick w MP: PremierQ

Piwa: 4

Respekt: 50

DestroY Problem w tym, ?e je?li faktycznie tak zrobimy to jak ustawi? by poza tym safezonem nie mo?na by?o si? napiernicza? :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-04, 22:03


Prezes.







Wiek: 27
Na forum: 4370 dni
Posty: 75
Nick w MP: Prezes.

Piwa: 17

Respekt: 60

addEventHandler ("onColShapeHit"getRootElement(),
function(hitElementmatchingDimension)
  if (getElementType (hitElement) == "player") and (getElementID (source) == "greenzoneColshape"then
    outputChatBox ("You entered the greenzone"hitElement25500false)
    toggleControl (hitElement"fire"true)
    toggleControl (hitElement"next_weapon"true)
    toggleControl (hitElement"previous_weapon"true)
    toggleControl (hitElement"sprint"true)
    toggleControl (hitElement"aim_weapon"true)
    toggleControl (hitElement"vehicle_fire"true)
    showPlayerHudComponent (hitElement"ammo"true)
    showPlayerHudComponent (hitElement"weapon"true)
    triggerClientEvent (hitElement"disableGodMode"hitElement)
  end
  if (source == moneyZoneCol) and (getElementType (hitElement) == "vehicle"then
    setElementVelocity (hitElement000)
    setElementPosition (hitElement2018.331534.7712.37)
    setVehicleRotation (hitElement0,0,270)
    if (getVehicleOccupant (hitElement0)) then
      outputChatBox ("You can't enter the moneyzone with your car!"getVehicleOccupant (hitElement0), 25500false)
    end
  end
end)

addEventHandler ("onColShapeLeave"getRootElement(),
function(leaveElementmatchingDimension)
  if (getElementType (leaveElement) == "player") and (getElementID (source) == "greenzoneColshape"then
    outputChatBox ("You left the greenzone"leaveElement25500false)
    toggleControl (leaveElement"fire"false)
    toggleControl (leaveElement"next_weapon"false)
    toggleControl (leaveElement"previous_weapon"false)
    toggleControl (leaveElement"sprint"false)
    toggleControl (leaveElement"aim_weapon"false)
    toggleControl (leaveElement"vehicle_fire"false)
    showPlayerHudComponent (leaveElement"ammo"true)
    showPlayerHudComponent (leaveElement"weapon"true)
    triggerClientEvent (leaveElement"enableGodMode"leaveElement)
  end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-05, 00:04


PremierQ







Wiek: 31
Na forum: 3881 dni
Posty: 29
Nick w MP: PremierQ

Piwa: 4

Respekt: 50

Wi?c sytuacja wygl?da nast?puj?co. Wchodzimy na serwer i nadal mo?emy si? strzela?. Dopiero po wej?ciu i wyj?ciu z MyZone nie mo?emy strzela?. "function(leaveElement, matchingDimension)" Jak zmieni? to by od razu po wej?ciu na serwer nie mo?na by?o si? strzela?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-05, 07:21


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

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

Ostrzeżeń: 60%
PremierQ, dodaj event z funkcjami odpowiadaj?cymi zdarzeniu wyjscia z cuboida


Więcej informacji znajdziesz w Wikipedii MTA:

onPlayerJoin


Postaw piwo autorowi tego posta
 

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


Emm

***** ***






Wiek: 32
Na forum: 3880 dni
Posty: 3191
Nick w MP: Emm

Piwa: 6162

Respekt: 1580
Respekt: 1580Respekt: 1580


   Administrator: Admin ma zawsze rację | REGULAMIN FORUM | REKLAMA/VIP | .
Masz tutaj kod, po wej?ciu na serwer od razu nie b?dziesz m?g? strzela?
function dmoff(plr)
toogleControl(plr"fire"false)
addEventHandler('onPlayerJoin'dmoff)


Dodaj go do swojego kodu i powinno Ci wy??cza? dm od wej?cia na serwa :D

Podpis

Użytkownik: 20.10.2015r
GTAO Member: 06.03.2016r
Support-Team: 20.01.2016r
Moderator: 30.03.2016r
Mod-Team: 08.10.2016r
Vice Admin: 04.05.2018r
Administrator: 03.05.2022r


! Koniecznie zapoznaj się z regulaminem forum.
Pamiętaj, aby zawsze go przestrzegać, nie mniej ważne są również regulaminy działów, w których się wypowiadasz!
Zamiast zakładać temat po kilka razy, bo jest usuwany przez Administrację, przejrzyj regulamin i napisz poprawnie temat!
Sprawy z administracją możesz załatwiać anonimowo w tym dziale.
Najważniejsze informacje od Administracji możesz przeczytać tutaj oraz tutaj.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-05, 11:39


PremierQ







Wiek: 31
Na forum: 3881 dni
Posty: 29
Nick w MP: PremierQ

Piwa: 4

Respekt: 50

Niestety to nic nie zmieni?o, po wej?ciu na serwer nadal mog? strzela?. Czekam na dalsz? pomoc

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-05, 11:42


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

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

Ostrzeżeń: 60%
PremierQ, bo ten event nic nie zwraca, usun plr i przy togglecontrol daj source, a nie plr.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-05, 12:06


PremierQ







Wiek: 31
Na forum: 3881 dni
Posty: 29
Nick w MP: PremierQ

Piwa: 4

Respekt: 50

Nadal nie dzia?a, nic si? nie zmieni?o


addEventHandler ("onResourceStart"getRootElement(), 
function()
  setTimer (moneyZoneTimerFunction25000)
  local allGreenzones getElementsByType ("radararea")
  for i,v in ipairs (allGreenzones) do
    local r,g,b,getRadarAreaColor (v)
    if (== 0) and (== 255) and (== 0) and (== 127then
      local x,getElementPosition (v)
      local sx,sy getRadarAreaSize (v)
      local col createColCuboid (x,y, -50sx,sy7500)
      setElementID (col"greenzoneColshape")
    end
  end
end)

addEventHandler ("onColShapeHit"getRootElement(),
function(hitElementmatchingDimension)
  if (getElementType (hitElement) == "player") and (getElementID (source) == "greenzoneColshape"then
    outputChatBox ("You entered the greenzone"hitElement25500false)
    toggleControl (hitElement"fire"true)
    toggleControl (hitElement"next_weapon"true)
    toggleControl (hitElement"previous_weapon"true)
    toggleControl (hitElement"sprint"true)
    toggleControl (hitElement"aim_weapon"true)
    toggleControl (hitElement"vehicle_fire"true)
    showPlayerHudComponent (hitElement"ammo"true)
    showPlayerHudComponent (hitElement"weapon"true)
    triggerClientEvent (hitElement"disableGodMode"hitElement)
  end
  if (source == moneyZoneCol) and (getElementType (hitElement) == "vehicle"then
    setElementVelocity (hitElement000)
    setElementPosition (hitElement2018.331534.7712.37)
    setVehicleRotation (hitElement0,0,270)
    if (getVehicleOccupant (hitElement0)) then
      outputChatBox ("You can't enter the moneyzone with your car!"getVehicleOccupant (hitElement0), 25500false)
    end
  end
end)

addEventHandler ("onColShapeLeave"getRootElement(),
function(leaveElementmatchingDimension)
  if (getElementType (leaveElement) == "player") and (getElementID (source) == "greenzoneColshape"then
    outputChatBox ("You left the greenzone"leaveElement25500false)
    toggleControl (leaveElement"fire"false)
    toggleControl (leaveElement"next_weapon"false)
    toggleControl (leaveElement"previous_weapon"false)
    toggleControl (leaveElement"sprint"false)
    toggleControl (leaveElement"aim_weapon"false)
    toggleControl (leaveElement"vehicle_fire"false)
    showPlayerHudComponent (leaveElement"ammo"true)
    showPlayerHudComponent (leaveElement"weapon"true)
    triggerClientEvent (leaveElement"enableGodMode"leaveElement)
  end
end)


--money zone col
moneyZoneCol createColCuboid (1993.121519.14, -10017.4354.24117)
--stop moneyzone col

function moneyZoneTimerFunction ()
  local allPlayersInCol getElementsWithinColShape (moneyZoneCol"player")
  for i,v in ipairs (allPlayersInCol) do
    givePlayerMoney (v5)
  end
end

-- marker bij hospital
createMarker (1607.361814.24, -10"cylinder"2402550190getRootElement())

function dmoff(source)
toogleControl(source"fire"false)
addEventHandler('onPlayerJoin'dmoff)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-05, 18:18


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4330 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

 function dmoff (source)


zamien na
 function dmoff () 


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-05, 18:51


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4838 dni
Posty: 915

Piwa: 2697

Respekt: 955,3
Respekt: 955,3Respekt: 955,3

podmien te dmoff na to :
brakuje Ci jednego enda


function dmoff()
toogleControl(source"fire"false)
end
addEventHandler('onPlayerJoin'dmoff)


Podpis
Jedyny kontakt ze mną to PW forum

Kod:


local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-06, 14:55


PremierQ







Wiek: 31
Na forum: 3881 dni
Posty: 29
Nick w MP: PremierQ

Piwa: 4

Respekt: 50

function dmoff()
toogleControl(source"fire"false)
addEventHandler('onPlayerJoin'dmoff)

Ani to
function dmoff()
toogleControl(source"fire"false)
end
addEventHandler('onPlayerJoin'dmoff)


Nie dzia?a. Wchodz? na serwer i nadal mog? strzela? :)

[ Dodano: 2016-02-07, 18:54 ]
A mo?na powi?kszy? safezone na ca?? map? opr?cz jednego miejsca ? Np ca?e lv

Postaw piwo autorowi tego posta
 

 
Tagi: safezone
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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