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

Wysłany: 2020-12-13, 17:07


NoNamik







Wiek: 35
Na forum: 2185 dni
Posty: 289
Nick w MP: JestemNoNamem

Piwa: 374

Respekt: 60

Witam posiadam skrypt na nozyco rozpieracz lecz chcia?bym zeby on dzia?a? na paczce od pysa co trzeba w nim zmienic?

addEvent("ev",true)
addEventHandler("ev",resourceRoot,
    function(ev,arg1,arg2)
        if (ev=="wylam_drzwi"then
            local veh=arg1
            local drzwi=arg2
            local x,y,z=getElementPosition(client)
            if (getVehicleDoorState(veh,drzwi)==4then
                return
            end
            triggerClientEvent(root,"evc",resourceRoot,"wlacz_dzwiek",x,y,z)
            setPedAnimation(client,"CHAINSAW","csaw_part",-1truefalsefalse)
            setTimer(function()
                if veh and isElement(veh) and drzwi then
                    setVehicleDoorState(veh,drzwi,2)
                end
            end,2500,1)
            setTimer(function(client)
                if client and isElement(client) and veh and isElement(veh) and drzwi then
                    setPedAnimation(client)
                    setVehicleDoorState(veh,drzwi,4)
                    local vehid=getElementData(veh,"dbid")
                    if not vehid then
                        vehid="pojazd nie jest prywatny - nie posiada ID"
                    end
                    exports["es-logi"]:outputUcho("ROZPIERACZ PSP: "..getPlayerName(client).." DBID: "..getElementData(client,"dbid").." u?ywa rozpieracza na poje?dzie o ID: "..vehid..".")
                end
            end,5000,1,client)
        end
    end
)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-12-13, 18:25


_jvneczek







Wiek: 22
Na forum: 4325 dni
Posty: 1513
Nick w MP: _jvneczek

Piwa: 3949

Respekt: 337,5
Respekt: 337,5Respekt: 337,5Respekt: 337,5

elementdata dbid, zapewne export es-logi bo w pysie nie ma takiego skryptu, no i to tyle

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-12-14, 00:19


NoNamik







Wiek: 35
Na forum: 2185 dni
Posty: 289
Nick w MP: JestemNoNamem

Piwa: 374

Respekt: 60

ok ale na co zmieni? te dbid bo odpowiada za id auta

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-12-14, 00:22


Matikmontana

Modern Stories






Wiek: 22
Na forum: 2473 dni
Posty: 423
Nick w MP: Mazeusz*

Piwa: 1015

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%
na vehicle:id chyba ?e zmienia?e? przejrzyj sobie skrypt na pojazdy

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-12-14, 16:33


NoNamik







Wiek: 35
Na forum: 2185 dni
Posty: 289
Nick w MP: JestemNoNamem

Piwa: 374

Respekt: 60

jeszcze client



function getPositionFromElementOffset(element,offX,offY,offZ)
  local m getElementMatrix element )  -- Get the matrix
  local x offX m[1][1] + offY m[2][1] + offZ m[3][1] + m[4][1]  -- Apply transform
  local y offX m[1][2] + offY m[2][2] + offZ m[3][2] + m[4][2]
  local z offX m[1][3] + offY m[2][3] + offZ m[3][3] + m[4][3]
  return xyz                               -- Return the transformed point
end

local isStrazak=(
    function(plr)
        if ((getElementData(plr,"PSP:ranga") and getElementData(plr,"PSP:sluzba")) or (getElementData(plr,"OSP:ranga") and getElementData(plr,"OSP:sluzba")))  then
            return true
        end
        return false
    end
)

--[[
addEventHandler("onClientRender",root,
    function()
        local x,y,z=getElementPosition(localPlayer)
        local offx,offy,offz=getPositionFromElementOffset(localPlayer,0,1.1,0)
        dxDrawLine3D(x,y,z,offx,offy,offz)
    end
)]]--

bindKey("h","down",
    function()
        if not isStrazak(localPlayerthen
            return
        end
        if (getPedWeapon(localPlayer)~=37then
            return
        end
        
        local x,y,z=getElementPosition(localPlayer)
        local offx,offy,offz=getPositionFromElementOffset(localPlayer,0,1.1,0)
        if isLineOfSightClear(x,y,z,offx,offy,offz,false,true,false,false,falsethen
            --exports["es-komunikaty"]:komunikat("Sta? twarz? do pojazdu lub podejd? bli?ej.")
            return
        end
        local hit,_,_,_,veh,_,_,_,_,_,piece=processLineOfSight(x,y,z,offx,offy,offz,false,true,false,false,false)
        if not hit then
            return
        end
        if (getElementType(veh)~="vehicle"then
            return
        end
        if veh and isElement(vehthen
            if not piece then
                return
            end
            if (piece==5then
                piece=2
            elseif (piece==6then
                piece=3
            elseif (piece==7then
                piece=4
            elseif (piece==8then
                piece=5
            else
                exports["es-komunikaty"]:komunikat("Musisz sta? przodem do wybranych drzwi.")
                return
            end
            triggerServerEvent("ev",resourceRoot,"wylam_drzwi",veh,piece)
        end
    end
)

addEvent("evc",true)
addEventHandler("evc",resourceRoot,
    function(ev,arg1,arg2,arg3)
        if (ev=="wlacz_dzwiek"then
            local x,y,z=arg1,arg2,arg3
            local s=playSound3D("rozpierak.mp3",x,y,z,false)
            setSoundVolume(s,25)
            setSoundMaxDistance(s,20)
        end
    end
)

--piece:
--5Front left door
--6Front right door
--7Rear left door
--8Rear right door
--doorstate:
--2Front left
--3Front right
--4Rear left
--5Rear right


--[[
bool               -- hit
float float float  -- hitXhitYhitZ
element            -- hitElement
float float float  -- normalXnormalYnormalZ
int                -- material
float              -- lighting
int                -- piece
int                -- worldModelID
float float float  -- worldModelPositionX,Y,Z
float float float  -- worldModelRotationX,Y,Z
int                -- worldLODModelID
                  processLineOfSight float startXfloat startYfloat startZ, 
                                       float endXfloat endYfloat endZ, 
                                       [ bool checkBuildings true, 
                                       bool checkVehicles true, 
                                       bool checkPlayers true, 
                                       bool checkObjects true, 
                                       bool checkDummies true, 
                                       bool seeThroughStuff false, 
                                       bool ignoreSomeObjectsForCamera false, 
                                       bool shootThroughStuff false, 
                                       element ignoredElement nil,
                                       bool includeWorldModelInformation false,
                                       bool bIncludeCarTyres ] )
]]--


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-12-14, 16:37


_jvneczek







Wiek: 22
Na forum: 4325 dni
Posty: 1513
Nick w MP: _jvneczek

Piwa: 3949

Respekt: 337,5
Respekt: 337,5Respekt: 337,5Respekt: 337,5

Tylko

if ((getElementData(plr,"PSP:ranga") and getElementData(plr,"PSP:sluzba")) or (getElementData(plr,"OSP:ranga") and getElementData(plr,"OSP:sluzba")))  then

na przyk?ad na elementdate player:faction == "SAFD"

if getElementData(plr,"player:faction") == "SAFD" then


Postaw piwo autorowi tego posta
 

 
Tagi: nozyco :: rozpieracz
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » nozyco rozpieracz Odpowiedz do tematu

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