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

Wysłany: 2016-01-08, 23:56


Toffiaaak.







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

Piwa: 1836

Respekt: 242
Respekt: 242Respekt: 242

Witam ponownie, tym razem postanowi?em sobie system do zmiany ?wiatelek napisa?, na te chwile jest na komendy poniewa? nie problem to przenie?? do jakiego? gui.
Server:

addEvent("red", true) 
addEventHandler("red", getRootElement(), function() 
setVehicleHeadLightColor ( theVehicle, 255, 0, 0) 
end)

Client:

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 ( "/swiatlablack - Czarne ?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 )
    triggerServerEvent ("red", thePlayer)
end
addCommandHandler ("swiatlared", red)

Problem w tym ?e wywala mi w w debugu b??d ze stringiem "swiatlared", licz? na pomoc.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-09, 01:28


Emm

***** ***






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

Piwa: 6171

Respekt: 1580
Respekt: 1580Respekt: 1580


   Administrator: Admin ma zawsze rację | REGULAMIN FORUM | REKLAMA/VIP | .

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


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-09, 11:31


Toffiaaak.







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

Piwa: 1836

Respekt: 242
Respekt: 242Respekt: 242

Teraz wywala bad argument z tym:

triggerServerEvent ("red", thePlayer)


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, 11:52


DamianGames







Wiek: 23
Na forum: 4087 dni
Posty: 75

Piwa: 524

Respekt: 31,5

Ostrzeżeń: 60%

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 ( "/swiatlablack - Czarne ?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)
addCommandHandler ("swiatlared", red)


S-Side nie potrzebny usu? go.


Więcej informacji znajdziesz w Wikipedii MTA:

setVehicleHeadLightColor


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-09, 13:36


Toffiaaak.







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

Piwa: 1836

Respekt: 242
Respekt: 242Respekt: 242

No dobra, mam takie co? i nawet je?li jestem w pojezdzie to pisze mi ze nie jestem + wyskakuje b??d z ustawianiem ?wiate? (setVehicleHeadLightColor)

function red( thePlayer )
local theVehicle = getPedOccupiedVehicle ( thePlayer )
if ( not theVehicle ) then
    return outputChatBox( "Nie jeste? w poje?dzie!", source )
end
end    
setVehicleHeadLightColor ( theVehicle, 255, 0, 0 )
addCommandHandler ("swiatlared", red)


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, 13:37


Artysta

Lua, Lua, Czekolada






Wiek: 28
Na forum: 4607 dni
Posty: 240
Nick w MP: Artysta/Koojot

Piwa: 1427

Respekt: 205,8
Respekt: 205,8Respekt: 205,8

"DamianGames" napisał/a:


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 ( "/swiatlablack - Czarne ?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)
addCommandHandler ("swiatlared", red)


S-Side nie potrzebny usu? go.


Więcej informacji znajdziesz w Wikipedii MTA:

setVehicleHeadLightColor


S-side jest potrzebny, inaczej tylko TYYYYYY b?dziesz widzie? zmienione ?wiat?a.

Podpis
Something is coming..
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-09, 13:40


Toffiaaak.







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

Piwa: 1836

Respekt: 242
Respekt: 242Respekt: 242

No dobra, S-side:
addEvent("red", true) 
addEventHandler("red", getRootElement(), function(plr)
local theVehicle = getPedOccupiedVehicle(plr)
setVehicleHeadLightColor ( theVehicle, 255, 0, 0) 
end)

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 ( "/swiatlablack - Czarne ?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 )
    triggerServerEvent ("red", thePlayer)
end
addCommandHandler ("swiatlared", red)


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, 14:50


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4979 dni
Posty: 915

Piwa: 2697

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




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 ( "/swiatlablack - Czarne ?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 )
    triggerServerEvent ("red", localPlayer, localPlayer)
end
addCommandHandler ("swiatlared", red)



Podmie? c-side na to

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-01-09, 16:34


Toffiaaak.







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

Piwa: 1836

Respekt: 242
Respekt: 242Respekt: 242

"Jurandovsky" napisał/a:




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 ( "/swiatlablack - Czarne ?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 )
    triggerServerEvent ("red", localPlayer, localPlayer)
end
addCommandHandler ("swiatlared", red)



Podmie? c-side na to

Dzieki, do zamkniecia.

Postaw piwo autorowi tego posta
 

 
Tagi: zmiana :: światełek :: pojezdzie.
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