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

Wysłany: 2018-10-15, 20:10


AkossPL







Wiek: 25
Na forum: 4220 dni
Posty: 140
Nick w MP: AkossPL

Piwa: 3

Respekt: 50

Siema zmieniam id innego pojazdu i nie nalicza ?mieci o co chodzi

Kod:
for i,v in ipairs(ustawioneAuta) do
    local veh = createVehicle(423, v[1], v[2], v[3])
    setElementData(veh,"vehicle:desc","Sprz?tanie ulic San Andreas\nSweepery imienia kononowicza")
    toggleVehicleRespawn(veh, true)
    setElementFrozen(veh,true)
    setVehicleColor (veh, 0, 204, 153)
    setVehicleHandling(veh,"maxVelocity",130)
end

addEventHandler("onVehicleEnter", resourceRoot, function(plr, seat)
    if seat == 0 then 
        outputChatBox("Rozpocz??e? prac? zbierania ?mieci.",plr,255,255,255)
        outputChatBox("Aby je zbiera? je?dzij po mapie.",plr,255,255,255)
        local v = getPedOccupiedVehicle(plr)
                triggerClientEvent(plr, "PokazKGokno", resourceRoot)
        setElementFrozen(v,false)
        setElementData(v,"viewki",0)
        setElementData(plr,"pracaView",true)
        toggleControl (plr, "brake_reverse", false )
                setPlayerHudComponentVisible (plr, "area_name", false)
    end
end)
addEventHandler("onVehicleExit", resourceRoot, function(plr, seat)
    if seat == 0 then 
                toggleControl (plr, "brake_reverse", true )
                triggerClientEvent(plr, "UsunKGokno", resourceRoot)
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-15, 20:13


Query

SyndicateMTA






Wiek: 24
Na forum: 3213 dni
Posty: 319
Nick w MP: Query

Piwa: 5238

Respekt: 141
Respekt: 141

poka? strone clienta.

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-15, 20:14


AkossPL







Wiek: 25
Na forum: 4220 dni
Posty: 140
Nick w MP: AkossPL

Piwa: 3

Respekt: 50

darecky02,
function isEventHandlerAdded(sEventName,pElementAttachedTo,func)
    if type(sEventName)=='string' and isElement(pElementAttachedTo) and type(func)=='function' then local aAttachedFunctions = getEventHandlers(sEventName,pElementAttachedTo)
    if type(aAttachedFunctions)=='table' and #aAttachedFunctions > 0 then for i,v in ipairs(aAttachedFunctions) do if v==func then return true end end end
    end return false
end
ww,hh = 1920, 1080
www,hhh = guiGetScreenSize()
w, h = (www/ww), (hhh/hh)
local screenW, screenH = guiGetScreenSize()
local dxfont0_fontbold = dxCreateFont(":ec-interakcja/font-bold.ttf", 18)
function OknoKG()
        local a = interpolateBetween(0,0,255,255,0,255,((getTickCount()-tick)/3000),"Linear") 
        local a2 = interpolateBetween(0,0,141,141,0,141,((getTickCount()-tick)/3000),"Linear") 
        local Pojazd = getPedOccupiedVehicle(localPlayer)
        local kilo = getElementData(Pojazd,"viewki") or 0
        roundedRectangle(screenW * 0.3661, screenH * 0.7917, screenW * 0.2682, screenH * 0.1296, tocolor(1, 0, 0, a2), false)
        dxDrawText("Ilo?? zebranych ?mieci:\n"..string.format("%0.2f",kilo).." kg", screenW * 0.3667, screenH * 0.7917, screenW * 0.6344, screenH * 0.9213, tocolor(255, 255, 255, a), 1*w, dxfont0_fontbold, "center", "center", false, false, false, false, false)
end

function PokazKG() 
addEventHandler("onClientRender",root,OknoKG)
tick = getTickCount()
end
addEvent("PokazKGokno", true)
addEventHandler("PokazKGokno", getRootElement(), PokazKG)

function UsunKG() 
removeEventHandler("onClientRender",root,OknoKG)
end
addEvent("UsunKGokno", true)
addEventHandler("UsunKGokno", getRootElement(), UsunKG)

addEventHandler("onClientRender",root,function ()
   local veh = getPedOccupiedVehicle(localPlayer)
   if not veh then return end
    if getElementModel(veh) ~= 574 then return end
   local sx,sy,sz = getElementVelocity(veh)
   local kmhs = math.ceil(((sx^2+sy^2+sz^2)^(0.5))*155)
   if kmhs >= 29 then
   local view = getElementData(veh,"viewki")
        local view = view + 0.005
        local viewki = setElementData(veh,"viewki",view)
    end
end)

function roundedRectangle(x, y, w, h, color)
  dxDrawRectangle(x, y, w, h, color, false)
  dxDrawRectangle(x + 2, y - 1, w - 4, 1, color, false)
  dxDrawRectangle(x + 2, y + h, w - 4, 1, color, false)
  dxDrawRectangle(x - 1, y + 2, 1, h - 4, color, false)
  dxDrawRectangle(x + w, y + 2, 1, h - 4, color, false)
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-15, 20:15


OchIAch







Wiek: 27
Na forum: 3255 dni
Posty: 144
Nick w MP: OchIAch

Piwa: 1312

Respekt: 105,3
Respekt: 105,3

Ostrzeżeń: 100%
function isEventHandlerAdded(sEventName,pElementAttachedTo,func)
    if type(sEventName)=='string' and isElement(pElementAttachedTo) and type(func)=='function' then local aAttachedFunctions = getEventHandlers(sEventName,pElementAttachedTo)
    if type(aAttachedFunctions)=='table' and #aAttachedFunctions > 0 then for i,v in ipairs(aAttachedFunctions) do if v==func then return true end end end
    end return false
end
ww,hh = 1920, 1080
www,hhh = guiGetScreenSize()
w, h = (www/ww), (hhh/hh)
local screenW, screenH = guiGetScreenSize()
local dxfont0_fontbold = dxCreateFont(":ec-interakcja/font-bold.ttf", 18)
function OknoKG()
        local a = interpolateBetween(0,0,255,255,0,255,((getTickCount()-tick)/3000),"Linear") 
        local a2 = interpolateBetween(0,0,141,141,0,141,((getTickCount()-tick)/3000),"Linear") 
        local Pojazd = getPedOccupiedVehicle(localPlayer)
        local kilo = getElementData(Pojazd,"viewki") or 0
        roundedRectangle(screenW * 0.3661, screenH * 0.7917, screenW * 0.2682, screenH * 0.1296, tocolor(1, 0, 0, a2), false)
        dxDrawText("Ilo?? zebranych ?mieci:\n"..string.format("%0.2f",kilo).." kg", screenW * 0.3667, screenH * 0.7917, screenW * 0.6344, screenH * 0.9213, tocolor(255, 255, 255, a), 1*w, dxfont0_fontbold, "center", "center", false, false, false, false, false)
end

function PokazKG() 
addEventHandler("onClientRender",root,OknoKG)
tick = getTickCount()
end
addEvent("PokazKGokno", true)
addEventHandler("PokazKGokno", getRootElement(), PokazKG)

function UsunKG() 
removeEventHandler("onClientRender",root,OknoKG)
end
addEvent("UsunKGokno", true)
addEventHandler("UsunKGokno", getRootElement(), UsunKG)

addEventHandler("onClientRender",root,function ()
   local veh = getPedOccupiedVehicle(localPlayer)
   if not veh then return end
    if getElementModel(veh) ~= 423 then return end
   local sx,sy,sz = getElementVelocity(veh)
   local kmhs = math.ceil(((sx^2+sy^2+sz^2)^(0.5))*155)
   if kmhs >= 29 then
   local view = getElementData(veh,"viewki")
        local view = view + 0.005
        local viewki = setElementData(veh,"viewki",view)
    end
end)

function roundedRectangle(x, y, w, h, color)
  dxDrawRectangle(x, y, w, h, color, false)
  dxDrawRectangle(x + 2, y - 1, w - 4, 1, color, false)
  dxDrawRectangle(x + 2, y + h, w - 4, 1, color, false)
  dxDrawRectangle(x - 1, y + 2, 1, h - 4, color, false)
  dxDrawRectangle(x + w, y + 2, 1, h - 4, color, false)
end


Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-15, 20:17


Kalizman







Wiek: 24
Na forum: 3792 dni
Posty: 1394

Piwa: 4624

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

if getElementModel(veh) ~= 574 then return end

To wszystko wyja?nia, zmie? na to 'inne' ID.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-15, 20:18


AkossPL







Wiek: 25
Na forum: 4220 dni
Posty: 140
Nick w MP: AkossPL

Piwa: 3

Respekt: 50

OchIAch, Dzia?a wszystko ale do ty?u jecha? nie mog?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-15, 20:19


OchIAch







Wiek: 27
Na forum: 3255 dni
Posty: 144
Nick w MP: OchIAch

Piwa: 1312

Respekt: 105,3
Respekt: 105,3

Ostrzeżeń: 100%
Zeby jechac do tylu:

for i,v in ipairs(ustawioneAuta) do
    local veh = createVehicle(423, v[1], v[2], v[3])
    setElementData(veh,"vehicle:desc","Sprz?tanie ulic San Andreas\nSweepery imienia kononowicza")
    toggleVehicleRespawn(veh, true)
    setElementFrozen(veh,true)
    setVehicleColor (veh, 0, 204, 153)
    setVehicleHandling(veh,"maxVelocity",130)
end

addEventHandler("onVehicleEnter", resourceRoot, function(plr, seat)
    if seat == 0 then 
        outputChatBox("Rozpocz??e? prac? zbierania ?mieci.",plr,255,255,255)
        outputChatBox("Aby je zbiera? je?dzij po mapie.",plr,255,255,255)
        local v = getPedOccupiedVehicle(plr)
                triggerClientEvent(plr, "PokazKGokno", resourceRoot)
        setElementFrozen(v,false)
        setElementData(v,"viewki",0)
        setElementData(plr,"pracaView",true)
        toggleControl (plr, "brake_reverse", true )
                setPlayerHudComponentVisible (plr, "area_name", false)
    end
end)
addEventHandler("onVehicleExit", resourceRoot, function(plr, seat)
    if seat == 0 then 
                toggleControl (plr, "brake_reverse", true )
                triggerClientEvent(plr, "UsunKGokno", resourceRoot)
    end
end)


Podpis
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
AkossPL
Wysłany: 2018-10-15, 20:22


AkossPL







Wiek: 25
Na forum: 4220 dni
Posty: 140
Nick w MP: AkossPL

Piwa: 3

Respekt: 50

OchIAch, Dzienki

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-15, 20:23


Query

SyndicateMTA






Wiek: 24
Na forum: 3213 dni
Posty: 319
Nick w MP: Query

Piwa: 5238

Respekt: 141
Respekt: 141

Tak jak koledzy wcze?niej wspomnieli. Pozamieniaj te rzeczy i bedzie dobrze ;3

Podpis
Postaw piwo autorowi tego posta
 

 
Tagi: nie :: mogę :: zmienić :: auta :: innego :: nisz :: sweeper
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Nie mogę zmienić auta innego nisz Sweeper 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