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

Wysłany: 2016-01-09, 17:04


Toffiaaak.







Wiek: 23
Na forum: 4551 dni
Posty: 128
Nick w MP: Toffy.

Piwa: 1836

Respekt: 242
Respekt: 242Respekt: 242

Witam ponownie, spotykam sie zn?w z kolejnym b??dem u?ywaj?c funkcji isElementWithinMarker.
C-SIDE

Marker = createMarker( 1871.1986083984, -1857.5452880859, 13.663543701172-0.9, 'cylinder', 2.0, 255, 0, 0, 150 )-- marker
function changeCarLightsColor( thePlayer )
outputChatBox ( "Aby zamontowa? swiat?a musisz u?y? jednej z poni?szych komend." )
outputChatBox ( "/swiatlared - Czerwone ?wiat?a", source )
outputChatBox ( "/swiatlaorange - Pomaranczowe ?wiat?a", source )
outputChatBox ( "/swiatlablue - Niebieskie ?wiat?a", source )
outputChatBox ( "/swiatlagreen - Zielone ?wiat?a", source )
end
addCommandHandler ("swiatla", changeCarLightsColor )


addEventHandler("onClientMarkerHit", Marker, function(el, md)
    if not md or getElementType(el) ~= "player" then return end
    if el ~= localPlayer then return end
    outputChatBox ("Wpisz /swiatla aby ujrze? informacje, oraz cennik nt. monta?u ?wiate?", 250, 250, 250, true )
end)

function red( thePlayer )
if isElementWithinMarker(thePlayer, Marker) then
    triggerServerEvent ("red", localPlayer, localPlayer)
end
end
addCommandHandler ("swiatlared", red)

function orange( thePlayer )
if isElementWithinMarker(thePlayer, Marker) then
    triggerServerEvent ("orange", localPlayer, localPlayer)
end
end
addCommandHandler ("swiatlaorange", orange)

function blue( thePlayer )
if isElementWithinMarker(thePlayer, Marker) then
    triggerServerEvent ("blue", localPlayer, localPlayer)
end
end
addCommandHandler ("swiatlablue", blue)

function green( thePlayer )
if isElementWithinMarker(thePlayer, Marker) then
    triggerServerEvent ("green", localPlayer, localPlayer)
end
end
addCommandHandler ("swiatlagreen", green)

S-SIDE

addEvent("red", true) 
addEventHandler("red", getRootElement(), function(plr)
local theVehicle = getPedOccupiedVehicle(plr)
setVehicleHeadLightColor ( theVehicle, 255, 0, 0) 
end)

addEvent("orange", true) 
addEventHandler("orange", getRootElement(), function(plr)
local theVehicle = getPedOccupiedVehicle(plr)
setVehicleHeadLightColor ( theVehicle, 255, 165, 0) 
end)

addEvent("blue", true) 
addEventHandler("blue", getRootElement(), function(plr)
local theVehicle = getPedOccupiedVehicle(plr)
setVehicleHeadLightColor ( theVehicle, 0, 0, 255) 
end)

addEvent("green", true) 
addEventHandler("green", getRootElement(), function(plr)
local theVehicle = getPedOccupiedVehicle(plr)
setVehicleHeadLightColor ( theVehicle, 0, 255, 0) 
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-09, 17:24


luki123luki123

Place Game






Wiek: 28
Na forum: 5416 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

silipek1, a s? jakie? b??dy w debugscript 3 ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-09, 17:29


Toffiaaak.







Wiek: 23
Na forum: 4551 dni
Posty: 128
Nick w MP: Toffy.

Piwa: 1836

Respekt: 242
Respekt: 242Respekt: 242

Bad argument - got boolean, co? takiego.

Podpis

Osiągnięcia:
- wygrana w konkursie LUA (kat. średnia) - 05.02.18
- 150 reputacji - 06.02.18
- 100 postów - 06.02.18

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-09, 17:38


luki123luki123

Place Game






Wiek: 28
Na forum: 5416 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

silipek1, zr?b najlepiej ss'a to b?dziemy wiedzie? wiecej.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-09, 17:52


Toffiaaak.







Wiek: 23
Na forum: 4551 dni
Posty: 128
Nick w MP: Toffy.

Piwa: 1836

Respekt: 242
Respekt: 242Respekt: 242

Zadnych ssow nie bede robic, ale przepisze ca?y b??d.
Kod:

Bad argument @ 'isElementWithinMarker' [Expected element at argument 1, got string 'swiatlared']


Ostatnio zmieniony przez Toffiaaak. 2016-01-09, 18:04, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-09, 18:03


luki123luki123

Place Game






Wiek: 28
Na forum: 5416 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

silipek1, powiem tak ty si? nie zbierz za skrypty jak ty nie wiersz ?e s? 2 strony.
Poprawny kod:

Serwer:
Marker = createMarker( 1871.1986083984, -1857.5452880859, 13.663543701172-0.9, 'cylinder', 2.0, 255, 0, 0, 150 )-- marker
local Player = getPlayer()

function changeCarLightsColor()
outputChatBox ( "Aby zamontowa? swiat?a musisz u?y? jednej z poni?szych komend." )
outputChatBox ( "/swiatlared - Czerwone ?wiat?a" )
outputChatBox ( "/swiatlaorange - Pomaranczowe ?wiat?a" )
outputChatBox ( "/swiatlablue - Niebieskie ?wiat?a" )
outputChatBox ( "/swiatlagreen - Zielone ?wiat?a" )
end
addCommandHandler ("swiatla", changeCarLightsColor )


addEventHandler("onClientMarkerHit", Marker, function(el, md)
    if not md or getElementType(el) ~= "player" then return end
    if el ~= Player then return end
    outputChatBox ("Wpisz /swiatla aby ujrze? informacje, oraz cennik nt. monta?u ?wiate?", 250, 250, 250, true )
end)

function red()
if isElementWithinMarker(Player, Marker) then
    triggerServerEvent ("red", Player, Player)
end
end
addCommandHandler ("swiatlared", red)

function orange()
if isElementWithinMarker(Player, Marker) then
    triggerServerEvent ("orange", Player, Player)
end
end
addCommandHandler ("swiatlaorange", orange)

function blue()
if isElementWithinMarker(Player, Marker) then
    triggerServerEvent ("blue", Player, Player)
end
end
addCommandHandler ("swiatlablue", blue)

function green()
if isElementWithinMarker(Player, Marker) then
    triggerServerEvent ("green", Player, Player)
end
end
addCommandHandler ("swiatlagreen", green)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-09, 18:08


Toffiaaak.







Wiek: 23
Na forum: 4551 dni
Posty: 128
Nick w MP: Toffy.

Piwa: 1836

Respekt: 242
Respekt: 242Respekt: 242

local Player = getPlayer()

Jak wspomnia?em wy?ej, nic nie potrafisz.

Podpis

Osiągnięcia:
- wygrana w konkursie LUA (kat. średnia) - 05.02.18
- 150 reputacji - 06.02.18
- 100 postów - 06.02.18

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-09, 18:34


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4291 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4661

Respekt: 1436,8
Respekt: 1436,8

Panowie spokojnie.
local Player = getLocalPlayer()
Je?eli wog?le oto chodzi. Tyle, ?e to po stronie clienta ju?.

Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-10, 00:47


#404







Wiek: 27
Na forum: 4913 dni
Posty: 1438

Piwa: 2512

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

Ostrzeżeń: 60%
Co wy tu? Eee?


function green(  )
if isElementWithinMarker(localPlayer, Marker) then
    triggerServerEvent ("green", localPlayer, localPlayer)
end
end
addCommandHandler ("swiatlagreen", green)


I najlepiej nie rusza? juz tego jego triggera bo zbowu b?dzie nast?pny temat.

Postaw piwo autorowi tego posta
 

 
Tagi: iselementwithinmarker
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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