Witam,
Tym razem chcialbym sie zapyta? w czym jest problem i co mo?na tutaj ulepszyc, mianowicie chodzi mi o to ?e gry jestem sam na serwerze to wszystko dzia?a a gdy ktos wejdzie to swiatla przestaja mrugac i wywala b?ad ?e setVehicleLightState w 1 argumencie nie ma nic. I te? chcualbym zrobic tak ?eby swiatla swiecily te? po opuszczeniu pojazdu. I czy jest mo?liwa w cliencie blokada tej komedy np tylko dla policji? wiem ze na serverside da sie to zrobic bez problemu jednak na clientside nigdy nie potrafilem tego dokona?. Ju? troche pokombinowalem jednak nic to nie dalo zbytnio. Oto kodzik:
[lua]
local zmienna = 0
local elm = 0
local timer = nil
local lp = nil
local ll = nil
local czas = 500
function swiatla(thePlayer)
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, ... |