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

Wysłany: 2018-05-17, 17:33


Rainbow_Flow

Programista






Wiek: 26
Na forum: 3653 dni
Posty: 15
Nick w MP: raRe`



Respekt: 50

WARNING: fl-sygnaly\c_flash.lua:25: Bad argument @ 'getElementModel' [Expected element at argument 1, got nil]


takie co? mam

a tu jest c.lua : co jest ?le?

sirenek = false

addEvent("toggleSiren", true)
addEventHandler("toggleSiren", root, function()
if isElement(siren) then return end
if getPedOccupiedVehicle(localPlayer) then
local vehicle = getPedOccupiedVehicle(localPlayer)
local x,y,z = getElementPosition(vehicle)
siren = playSound3D("/sounds/siren.wav", x,y,z, true)
setSoundVolume(siren, 1)
attachElements(siren, vehicle, 0, 0, 0)
end
end)

function bind ()
if sirenek == false then
sirenek = true
local vehicle = getPedOccupiedVehicle(localPlayer)
local vehicleid = getElementModel(veh)
triggerServerEvent("siren", localPlayer, vehicle, vehicleid)
elseif sirenek == true then
sirenek = false
destroyElement(siren)
end
end
bindKey("j", "down", bind)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-17, 17:55


Nexisten

Moderator






Wiek: 22
Na forum: 4107 dni
Posty: 551
Nick w MP: Nexisten

Piwa: 1479

Respekt: 287,3
Respekt: 287,3Respekt: 287,3Respekt: 287,3


sirenek false 

addEvent("toggleSiren"trueaddEventHandler("toggleSiren"root, function() 
if isElement(sirenthen return end 
if getPedOccupiedVehicle(localPlayerthen 
local vehicle getPedOccupiedVehicle(localPlayerlocal x,y,getElementPosition(vehiclesiren playSound3D("/sounds/siren.wav"x,y,ztruesetSoundVolume(siren1attachElements(sirenvehicle000end 
end) 

function bind () 
if sirenek == false then 
sirenek true 
local vehicle getPedOccupiedVehicle(localPlayerlocal vehicleid getElementModel(vehicletriggerServerEvent("siren"localPlayervehiclevehicleid) 
elseif sirenek == true then 
sirenek false 
destroyElement(sirenend 
end 
bindKey("j""down"bind)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-17, 18:01


Rainbow_Flow

Programista






Wiek: 26
Na forum: 3653 dni
Posty: 15
Nick w MP: raRe`



Respekt: 50

dalej nie dzia?a

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-17, 18:04


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Spr?buj:
function bind () 
if sirenek == false then 
sirenek true 
local vehicle getPedOccupiedVehicle(localPlayer) 
if not vehicle then
    return
end
local vehicleid getElementModel(vehicletriggerServerEvent("siren"localPlayervehiclevehicleid) 
elseif sirenek == true then 
sirenek false 
destroyElement(sirenend 
end 
bindKey("j""down"bind)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-17, 18:07


Rainbow_Flow

Programista






Wiek: 26
Na forum: 3653 dni
Posty: 15
Nick w MP: raRe`



Respekt: 50

nie wiem co jest nie dzia?a dalej.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-17, 18:08


Nexisten

Moderator






Wiek: 22
Na forum: 4107 dni
Posty: 551
Nick w MP: Nexisten

Piwa: 1479

Respekt: 287,3
Respekt: 287,3Respekt: 287,3Respekt: 287,3

Poka? nowe DB3, b??d z getElementModel musia? znikn?? na 100%

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-17, 18:09


Rainbow_Flow

Programista






Wiek: 26
Na forum: 3653 dni
Posty: 15
Nick w MP: raRe`



Respekt: 50

b??du niema ale koguta i ?wiate? te? niema

[ Dodano: 2018-05-17, 18:11 ]
to jest s.lua dobrze jest?

kogutstatus = false

function kogut(thePlayer)
if getPedOccupiedVehicle(thePlayer) then
if kogutstatus == false then
kogutstatus = true
vehicle = getPedOccupiedVehicle(thePlayer)
local x, y, z = getElementPosition(vehicle)
kogut = createObject(3964, x,y,z)
attachElements(kogut, vehicle, 0.5, 0, 0.8)
timerek = setTimer(
function()
if lewy == 0 then
setVehicleLightState(vehicle, 1, 1)
setVehicleLightState(vehicle, 0, 0)
setVehicleLightState(vehicle, 2, 1)
setVehicleLightState(vehicle, 3, 0)
setVehicleHeadLightColor(vehicle, 255, 0, 0)
lewy = 1
else
setVehicleLightState(vehicle, 0, 1)
setVehicleLightState(vehicle, 1, 0)
setVehicleLightState(vehicle, 3, 1)
setVehicleLightState(vehicle, 2, 0)
setVehicleHeadLightColor(vehicle, 0, 0, 255)
lewy = 0
end
end, 300, 0)
elseif kogutstatus == true then
kogutstatus = false
killTimer(timerek)
setVehicleLightState(vehicle, 1, 1)
setVehicleLightState(vehicle, 2, 1)
setVehicleLightState(vehicle, 3, 1)
setVehicleLightState(vehicle, 4, 1)
setVehicleHeadLightColor(vehicle, 255, 255, 255)
setVehicleOverrideLights(vehicle, 2)
destroyElement(kogut)
end
end
end

function bind()
bindKey(source, "J", "down", kogut)
end
addEventHandler("onPlayerJoin", getRootElement(), bind)

addEvent("siren", true)
addEventHandler("siren", root, function(thePlayer)
triggerClientEvent(root, "toggleSiren", root)
end)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-17, 18:20


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Co Ci nie dzia?a? Czy po klikni?ciu danego klawisza wy?wietla warning?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-17, 18:22


Rainbow_Flow

Programista






Wiek: 26
Na forum: 3653 dni
Posty: 15
Nick w MP: raRe`



Respekt: 50

po klikni?ciu klawisza J nie ma ?adnego b?edu ale nie pokazuje sygna??w i koguta same syreny

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-17, 18:41


Nexisten

Moderator






Wiek: 22
Na forum: 4107 dni
Posty: 551
Nick w MP: Nexisten

Piwa: 1479

Respekt: 287,3
Respekt: 287,3Respekt: 287,3Respekt: 287,3

Wy??cz oba zasoby, uruchom najpierw zas?b "samp_objects" a potem "fl-sygnaly".

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-17, 18:49


Rainbow_Flow

Programista






Wiek: 26
Na forum: 3653 dni
Posty: 15
Nick w MP: raRe`



Respekt: 50

dalej i tak nie dzia?a

Postaw piwo autorowi tego posta
 

 
Tagi: skrypt :: kogut :: dachu :: nie :: działa
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