Jump to content

Skav

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by Skav

  1. Hello, i try to do my own ELS and i have a problem. I create this code (client site): local zmienna = 0 local elm = 0 local timer = nil local lp = nil local ll = nil local czas = 500 --[[function czest(player,CommandName,wartosc) tonumber(wartosc) czas = wartosc end addCommandHandler("hz", czest)--]] function swiatla(source) for i,player in ipairs(getElementsByType("player")) do local vehicle = getPedOccupiedVehicle ( player ) if zmienna == 0 then zmienna = 1 destroyElement ( ll ) lp = createMarker ( 0, 0, 0, "corona", 0.5, 255, 0, 0, 170 ) attachElements (lp, vehicle, -0.8, 2.2, 0) setVehicleLightState ( vehicle, 0, 0 ) setVehicleLightState ( vehicle, 1, 1 ) setVehicleHeadLightColor(vehicle,255,0,0) else destroyElement ( lp ) ll = createMarker ( 0, 0, 0, "corona", 0.5, 0, 0, 255, 170 ) attachElements (ll, vehicle, 0.8, 2.2, 0) setVehicleLightState ( vehicle, 0, 1 ) setVehicleLightState ( vehicle, 1, 0 ) setVehicleHeadLightColor(vehicle,0,0,255) zmienna = 0 end end end addCommandHandler("els", function () if elm == 0 then elm = 1 timer = setTimer ( swiatla, czas, 0) elseif elm == 1 then elm = 0 killTimer (timer) for i,player in ipairs(getElementsByType("player")) do local vehicle = getPedOccupiedVehicle(player) setVehicleLightState ( vehicle, 0, 0 ) setVehicleLightState ( vehicle, 1, 0 ) setVehicleLightState ( vehicle, 2, 0 ) setVehicleLightState ( vehicle, 3, 0 ) setVehicleHeadLightColor(vehicle,255,255,255) destroyElement ( lp ) destroyElement ( ll ) end end end) In this script its work if I was alone in a server, if someone join in debugscript 3 i have a error like: setVehicleLightState argument 1 is empty or got boolean. So i do a another code setVehicleLightState local zmienna = 0 local elm = 0 local timer = nil local lp = nil local ll = nil local czas = 500 --[[function czest(player,CommandName,wartosc) tonumber(wartosc) czas = wartosc end addCommandHandler("hz", czest)--]] function swiatla(source) local vehicle = getPedOccupiedVehicle ( source ) if zmienna == 0 then zmienna = 1 destroyElement ( ll ) lp = createMarker ( 0, 0, 0, "corona", 0.5, 255, 0, 0, 170 ) attachElements (lp, vehicle, -0.8, 2.2, 0) setVehicleLightState ( vehicle, 0, 0 ) setVehicleLightState ( vehicle, 1, 1 ) setVehicleHeadLightColor(vehicle,255,0,0) else destroyElement ( lp ) ll = createMarker ( 0, 0, 0, "corona", 0.5, 0, 0, 255, 170 ) attachElements (ll, vehicle, 0.8, 2.2, 0) setVehicleLightState ( vehicle, 0, 1 ) setVehicleLightState ( vehicle, 1, 0 ) setVehicleHeadLightColor(vehicle,0,0,255) zmienna = 0 end end addCommandHandler("els", function () if elm == 0 then elm = 1 timer = setTimer ( swiatla, czas, 0) elseif elm == 1 then elm = 0 killTimer (timer) for i,player in ipairs(getElementsByType("player")) do local vehicle = getPedOccupiedVehicle(player) setVehicleLightState ( vehicle, 0, 0 ) setVehicleLightState ( vehicle, 1, 0 ) setVehicleLightState ( vehicle, 2, 0 ) setVehicleLightState ( vehicle, 3, 0 ) setVehicleHeadLightColor(vehicle,255,255,255) destroyElement ( lp ) destroyElement ( ll ) end end end) And this don't work. erorr like this:setVehicleLightState [expected element at argument 1, got boolean. So what i should do to repair this? I want a flashing light work in car when i on car and when i leave from car. And 1 have a 2st question, what should i do if i want a change a freq of flash light? its my try to do this: function czest(player,CommandName,wartosc) tonumber(wartosc) czas = wartosc end addCommandHandler("hz", czest) ("wartosc" its a whats layer type in chat for example: /hz 100, the "czas" is a stock value (500, its on 6 line of code). I wanna change a "czas" value to a "wartosc" vaule but if i do this i have error: setTimer [expected number at argument 2, got nil] Sorry for my english Thanks
  2. It still isn't it. I don't want a script where i press 1 button and its all, i wan script with opctions to turn on/off siren, leds, front light, lightbar. For example (its cleo) or there:
  3. I have this script but it isn't it what i want. this script add only siren, i want a script who can turn flashing light, leds etc. in menu or using command/buttons. this script: is really close, but it hasn't have downolad. @edit someone can give me a lint to how do a flashing/blinking headlights?
  4. Hello guys, I looking for ELM/ELS for my MTA server, i found a lot of script but no one is this what i looking for. I want a script something like this: All mods what i found is a CLEO mod, but i know mod like this on video is for MTA because i see it on servers/ videos from servers. Sorry for my english :v Thanks
×
×
  • Create New...