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: 4410 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"trueaddEventHandler("red"getRootElement(), function() 
setVehicleHeadLightColor theVehicle25500end)

Client:

Marker createMarker1871.1986083984, -1857.545288085913.663543701172-0.9'cylinder'2.025500150 )-- marker
function changeCarLightsColorthePlayer )
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(elmd)
    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?"250250250true )
end)


function redthePlayer )
    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: 3880 dni
Posty: 3191
Nick w MP: Emm

Piwa: 6162

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: 4410 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: 3946 dni
Posty: 75

Piwa: 521

Respekt: 31,5

Ostrzeżeń: 60%

C-SIDE


Marker createMarker1871.1986083984, -1857.545288085913.663543701172-0.9'cylinder'2.025500150 )-- marker
function changeCarLightsColorthePlayer )
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(elmd)
    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?"250250250true )
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: 4410 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 redthePlayer )
local theVehicle getPedOccupiedVehicle thePlayer )
if ( not theVehicle then
    return outputChatBox"Nie jeste? w poje?dzie!"source )
end
end    
setVehicleHeadLightColor theVehicle2550)
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: 4466 dni
Posty: 240
Nick w MP: Artysta/Koojot

Piwa: 1427

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

"DamianGames" napisał/a:


C-SIDE


Marker createMarker1871.1986083984, -1857.545288085913.663543701172-0.9'cylinder'2.025500150 )-- marker
function changeCarLightsColorthePlayer )
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(elmd)
    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?"250250250true )
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: 4410 dni
Posty: 128
Nick w MP: Toffy.

Piwa: 1836

Respekt: 242
Respekt: 242Respekt: 242

No dobra, S-side:
addEvent("red"trueaddEventHandler("red"getRootElement(), function(plr)
local theVehicle getPedOccupiedVehicle(plr)
setVehicleHeadLightColor theVehicle25500end)

C-side

Marker createMarker1871.1986083984, -1857.545288085913.663543701172-0.9'cylinder'2.025500150 )-- marker
function changeCarLightsColorthePlayer )
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(elmd)
    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?"250250250true )
end)

function redthePlayer )
    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: 4838 dni
Posty: 915

Piwa: 2697

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




Marker createMarker1871.1986083984, -1857.545288085913.663543701172-0.9'cylinder'2.025500150 )-- marker
function changeCarLightsColorthePlayer )
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(elmd)
    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?"250250250true )
end)

function redthePlayer )
    triggerServerEvent ("red"localPlayerlocalPlayer)
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: 4410 dni
Posty: 128
Nick w MP: Toffy.

Piwa: 1836

Respekt: 242
Respekt: 242Respekt: 242

"Jurandovsky" napisał/a:




Marker createMarker1871.1986083984, -1857.545288085913.663543701172-0.9'cylinder'2.025500150 )-- marker
function changeCarLightsColorthePlayer )
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(elmd)
    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?"250250250true )
end)

function redthePlayer )
    triggerServerEvent ("red"localPlayerlocalPlayer)
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 » Zmiana światełek w pojezdzie. 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