Wysłany: 2016-02-04, 21:14
PremierQ
Wiek: 31 Na forum: 3882 dni Posty: 29
Nick w MP: PremierQ
Piwa : 4
Wysłany: 2016-02-04, 21:28
#404
Wiek: 26 Na forum: 4772 dni Posty: 1438
Piwa : 2512
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.
Wysłany: 2016-02-04, 21:42
PremierQ
Wiek: 31 Na forum: 3882 dni Posty: 29
Nick w MP: PremierQ
Piwa : 4
DestroY Problem w tym, ?e je?li faktycznie tak zrobimy to jak ustawi? by poza tym safezonem nie mo?na by?o si? napiernicza?
Wysłany: 2016-02-04, 22:03
Prezes.
Wiek: 27 Na forum: 4371 dni Posty: 75
Nick w MP: Prezes.
Piwa : 17
addEventHandler ( "onColShapeHit" , getRootElement (),
function( hitElement , matchingDimension )
if ( getElementType ( hitElement ) == "player" ) and ( getElementID ( source ) == "greenzoneColshape" ) then
outputChatBox ( "You entered the greenzone" , hitElement , 255 , 0 , 0 , false )
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 ( hitElement , 0 , 0 , 0 )
setElementPosition ( hitElement , 2018.33 , 1534.77 , 12.37 )
setVehicleRotation ( hitElement , 0 , 0 , 270 )
if ( getVehicleOccupant ( hitElement , 0 )) then
outputChatBox ( "You can't enter the moneyzone with your car!" , getVehicleOccupant ( hitElement , 0 ), 255 , 0 , 0 , false )
end
end
end )
addEventHandler ( "onColShapeLeave" , getRootElement (),
function( leaveElement , matchingDimension )
if ( getElementType ( leaveElement ) == "player" ) and ( getElementID ( source ) == "greenzoneColshape" ) then
outputChatBox ( "You left the greenzone" , leaveElement , 255 , 0 , 0 , false )
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 )
Wysłany: 2016-02-05, 00:04
PremierQ
Wiek: 31 Na forum: 3882 dni Posty: 29
Nick w MP: PremierQ
Piwa : 4
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?.
Wysłany: 2016-02-05, 07:21
#404
Wiek: 26 Na forum: 4772 dni Posty: 1438
Piwa : 2512
PremierQ , dodaj event z funkcjami odpowiadaj?cymi zdarzeniu wyjscia z cuboida
Wysłany: 2016-02-05, 08:03
Emm
***** ***
Wiek: 32 Na forum: 3881 dni Posty: 3191
Nick w MP: Emm
Piwa : 6162
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
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
[you]
! 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 .
Wysłany: 2016-02-05, 11:39
PremierQ
Wiek: 31 Na forum: 3882 dni Posty: 29
Nick w MP: PremierQ
Piwa : 4
Niestety to nic nie zmieni?o, po wej?ciu na serwer nadal mog? strzela?. Czekam na dalsz? pomoc
Wysłany: 2016-02-05, 11:42
#404
Wiek: 26 Na forum: 4772 dni Posty: 1438
Piwa : 2512
PremierQ , bo ten event nic nie zwraca, usun plr i przy togglecontrol daj source, a nie plr.
Wysłany: 2016-02-05, 12:06
PremierQ
Wiek: 31 Na forum: 3882 dni Posty: 29
Nick w MP: PremierQ
Piwa : 4
Nadal nie dzia?a, nic si? nie zmieni?o
addEventHandler ( "onResourceStart" , getRootElement (),
function()
setTimer ( moneyZoneTimerFunction , 2500 , 0 )
local allGreenzones = getElementsByType ( "radararea" )
for i , v in ipairs ( allGreenzones ) do
local r , g , b , a = getRadarAreaColor ( v )
if ( r == 0 ) and ( g == 255 ) and ( b == 0 ) and ( a == 127 ) then
local x , y = getElementPosition ( v )
local sx , sy = getRadarAreaSize ( v )
local col = createColCuboid ( x , y , - 50 , sx , sy , 7500 )
setElementID ( col , "greenzoneColshape" )
end
end
end )
addEventHandler ( "onColShapeHit" , getRootElement (),
function( hitElement , matchingDimension )
if ( getElementType ( hitElement ) == "player" ) and ( getElementID ( source ) == "greenzoneColshape" ) then
outputChatBox ( "You entered the greenzone" , hitElement , 255 , 0 , 0 , false )
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 ( hitElement , 0 , 0 , 0 )
setElementPosition ( hitElement , 2018.33 , 1534.77 , 12.37 )
setVehicleRotation ( hitElement , 0 , 0 , 270 )
if ( getVehicleOccupant ( hitElement , 0 )) then
outputChatBox ( "You can't enter the moneyzone with your car!" , getVehicleOccupant ( hitElement , 0 ), 255 , 0 , 0 , false )
end
end
end )
addEventHandler ( "onColShapeLeave" , getRootElement (),
function( leaveElement , matchingDimension )
if ( getElementType ( leaveElement ) == "player" ) and ( getElementID ( source ) == "greenzoneColshape" ) then
outputChatBox ( "You left the greenzone" , leaveElement , 255 , 0 , 0 , false )
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.12 , 1519.14 , - 100 , 17.43 , 54.24 , 117 )
-- stop moneyzone col
function moneyZoneTimerFunction ()
local allPlayersInCol = getElementsWithinColShape ( moneyZoneCol , "player" )
for i , v in ipairs ( allPlayersInCol ) do
givePlayerMoney ( v , 5 )
end
end
-- marker bij hospital
createMarker ( 1607.36 , 1814.24 , - 10 , "cylinder" , 24 , 0 , 255 , 0 , 190 , getRootElement ())
function dmoff ( source )
toogleControl ( source , "fire" , false )
addEventHandler ( 'onPlayerJoin' , dmoff )
Wysłany: 2016-02-05, 18:18
BlackTen
LUA Dev.
Wiek: 28 Na forum: 4330 dni Posty: 698
Piwa : 2080
zamien na
Wysłany: 2016-02-05, 18:51
Jurandovsky
Kurdebele
Wiek: 17 Na forum: 4839 dni Posty: 915
Piwa : 2697
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
Wysłany: 2016-02-06, 14:55
PremierQ
Wiek: 31 Na forum: 3882 dni Posty: 29
Nick w MP: PremierQ
Piwa : 4
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
Tagi: safezone
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: