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

Wysłany: 2017-10-08, 13:10


DaVeCS

Mapper






Wiek: 31
Na forum: 3386 dni
Posty: 193
Nick w MP: DaVe

Piwa: 59

Respekt: 70,5

witam, mam problem z kolczatk?, w takim sensie ?e jestem zalogowany na frakcj? sapd ale nie mog? stawia? kolczatki.


local kolczatki = {}
local cuboidy = {}
local pojazdy = {[598]=true,[411]=true,[597]=true,[451]=true, [560]=true,}
local odporny = {}

addEventHandler("onPlayerLogin",root,function(prevAcc,currAcc,auto)
    local accName getAccountName(currAcc)
if getElementData(source,'player:duty') and getElementData(source,'player:duty')=='SAPD' then
        bindKey(getAccountPlayer(currAcc),"x","down",postawkolczatke)
        bindKey(getAccountPlayer(currAcc),"c","down",usunkolczatke)
    end
end)

function postawkolczatke(plr,key,keyState)
    local veh getPedOccupiedVehicle(plr)
    if pojazdy[getElementModel(veh)] then
        setElementData(plr,"odporny",true)
        triggerClientEvent(plr,"znajdzmiejsce",plr)
        if odporny[plrthen
            killTimer(odporny[plr])
        end
        odporny[plr] = setTimer(function()
            setElementData(plr,"odporny",false)
            odporny[plr] = nil
        end,1000,1)
    end
end

addEvent("postaw",true)
addEventHandler("postaw",root,function(x,y,z,rx,ry,rz)
    if kolczatki[sourcethen
        destroyElement(kolczatki[source])
        kolczatki[source] = nil
        destroyElement(cuboidy[source])
        cuboidy[source] = nil
    end
    local kolczatka createObject(2899,x,y,z-0.3,rx,ry,rz+90) --2899,2892
    local cuboid createColSphere(x,y,z-0.3,2.5)
    cuboidy[source] = cuboid
    kolczatki[source] = kolczatka
end)

function usunkolczatke(plr,key,keyState)
    if source then
        plr source
    end
    if kolczatki[plrthen
        destroyElement(kolczatki[plr])
        kolczatki[plr] = nil
        destroyElement(cuboidy[plr])
        cuboidy[plr] = nil
        if odporny[plrthen
            killTimer(odporny[plr])
            odporny[plr] = nil
        end
    end
end
addEventHandler("onPlayerQuit",root,usunkolczatke)

addEventHandler("onColShapeHit",resourceRoot,function(el,md)
    if getElementType(el) ~= "player" or not md then return end
    if getElementData(el,"odporny"then return end
    local veh getPedOccupiedVehicle(el)
    if veh then
        local x,y,getElementPosition(source)
        triggerClientEvent(el,"sprawdzajopony",el,x,y)
    end
end)

addEventHandler("onColShapeLeave",resourceRoot,function(el,md)
    if getElementType(el) ~= "player" or not md then return end
    if getElementData(el,"odporny"then return end
    local veh getPedOccupiedVehicle(el)
    if veh then
        triggerClientEvent(el,"przestansprawdzacopony",el)
    end
end)

addEvent("przebijopone",true)
addEventHandler("przebijopone",root,function(opona)
    local veh getPedOccupiedVehicle(source)
    if opona == 1 then
        setVehicleWheelStates(veh,1)
    elseif opona == 2 then
        setVehicleWheelStates(veh,-1,1)
    elseif opona == 3 then
        setVehicleWheelStates(veh,-1,-1,1)
    elseif opona == 4 then
        setVehicleWheelStates(veh,-1,-1,-1,1)
    end
end)


Prosz? o pomoc :(

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-10-08, 14:35


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4149 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4662

Respekt: 1436,8
Respekt: 1436,8

local kolczatki = {}
local cuboidy = {}
local pojazdy = {[598]=true,[411]=true,[597]=true,[451]=true, [560]=true,}
local odporny = {}

addEventHandler("onPlayerLogin",root,function(prevAcc,currAcc,auto)
if getElementData(source,'player:duty') and getElementData(source,'player:duty')=='SAPD' then
        bindKey(source,"x","down",postawkolczatke)
        bindKey(source,"c","down",usunkolczatke)
    end
end)

function postawkolczatke(plr,key,keyState)
    local veh getPedOccupiedVehicle(plr)
    if pojazdy[getElementModel(veh)] then
        setElementData(plr,"odporny",true)
        triggerClientEvent(plr,"znajdzmiejsce",plr)
        if odporny[plrthen
            killTimer(odporny[plr])
        end
        odporny[plr] = setTimer(function()
            setElementData(plr,"odporny",false)
            odporny[plr] = nil
        end,1000,1)
    end
end

addEvent("postaw",true)
addEventHandler("postaw",root,function(x,y,z,rx,ry,rz)
    if kolczatki[sourcethen
        destroyElement(kolczatki[source])
        kolczatki[source] = nil
        destroyElement(cuboidy[source])
        cuboidy[source] = nil
    end
    local kolczatka createObject(2899,x,y,z-0.3,rx,ry,rz+90) --2899,2892
    local cuboid createColSphere(x,y,z-0.3,2.5)
    cuboidy[source] = cuboid
    kolczatki[source] = kolczatka
end)

function usunkolczatke(plr,key,keyState)
    if source then
        plr source
    end
    if kolczatki[plrthen
        destroyElement(kolczatki[plr])
        kolczatki[plr] = nil
        destroyElement(cuboidy[plr])
        cuboidy[plr] = nil
        if odporny[plrthen
            killTimer(odporny[plr])
            odporny[plr] = nil
        end
    end
end
addEventHandler("onPlayerQuit",root,usunkolczatke)

addEventHandler("onColShapeHit",resourceRoot,function(el,md)
    if getElementType(el) ~= "player" or not md then return end
    if getElementData(el,"odporny"then return end
    local veh getPedOccupiedVehicle(el)
    if veh then
        local x,y,getElementPosition(source)
        triggerClientEvent(el,"sprawdzajopony",el,x,y)
    end
end)

addEventHandler("onColShapeLeave",resourceRoot,function(el,md)
    if getElementType(el) ~= "player" or not md then return end
    if getElementData(el,"odporny"then return end
    local veh getPedOccupiedVehicle(el)
    if veh then
        triggerClientEvent(el,"przestansprawdzacopony",el)
    end
end)

addEvent("przebijopone",true)
addEventHandler("przebijopone",root,function(opona)
    local veh getPedOccupiedVehicle(source)
    if opona == 1 then
        setVehicleWheelStates(veh,1)
    elseif opona == 2 then
        setVehicleWheelStates(veh,-1,1)
    elseif opona == 3 then
        setVehicleWheelStates(veh,-1,-1,1)
    elseif opona == 4 then
        setVehicleWheelStates(veh,-1,-1,-1,1)
    end
end)


Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-10-08, 15:15


DaVeCS

Mapper






Wiek: 31
Na forum: 3386 dni
Posty: 193
Nick w MP: DaVe

Piwa: 59

Respekt: 70,5

Niestety dalej nie dzia?a :(

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-10-08, 15:41


Yokosik







Wiek: 25
Na forum: 3629 dni
Posty: 58
Nick w MP: Yokosik

Piwa: 1048

Respekt: 21

Podczas logowania na frakcje sapd s? ustawiane wymagane elementdaty?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-10-08, 16:03


DaVeCS

Mapper






Wiek: 31
Na forum: 3386 dni
Posty: 193
Nick w MP: DaVe

Piwa: 59

Respekt: 70,5

wszystko jest dobrze ustawione :)

[ Dodano: 2017-10-08, 16:03 ]
Testowa?em inne, to da?o si? stawia? ale nie da?o si? usuwa?.

[ Dodano: 2017-10-13, 11:58 ]
Pomo?e kto?? :(

Postaw piwo autorowi tego posta
 

 
Tagi: kolczatka
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Kolczatka 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