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

Wysłany: 2020-08-15, 14:18


TheSebaPL

Mod-team






Wiek: 21
Na forum: 3098 dni
Posty: 964

Piwa: 3102

Respekt: 640,5
Respekt: 640,5Respekt: 640,5

Matikmontana, spr?buj
warpPlayerIntoVehicle plrveh )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-08-16, 00:20


Matikmontana

Modern Stories






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

Piwa: 1015

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%
Nie dzia?a :P

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-08-16, 10:05


Hemoglobina

Tylko Hema






Wiek: 29
Na forum: 3397 dni
Posty: 89
Nick w MP: Answer

Piwa: 1386

Respekt: 90

Debug wypluwa Tobie, ?e w funkcji getElementType oczekuje elementu, a Ty podajesz nil, export do zmiennej X, kt?ry wykonujesz nie zwraca Tobie pojazdu, poka? kod funkcji, kt?r? exportujesz do zmiennej X, ca?y kod.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-08-16, 10:42


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4394 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

Czy czytanie wiki jest takie ci??kie?


Więcej informacji znajdziesz w Wikipedii MTA:

warpPlayerIntoVehicle


Na g?rze jest napisane jak byk, ?eby u?y?


Więcej informacji znajdziesz w Wikipedii MTA:

warpPedIntoVehicle


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-08-17, 13:10


TheSebaPL

Mod-team






Wiek: 21
Na forum: 3098 dni
Posty: 964

Piwa: 3102

Respekt: 640,5
Respekt: 640,5Respekt: 640,5

addCommandHandler("p", function(plr,cmd,name)
    if getAdmin(plr,4) or  getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,5) or getAdmin(plr,1) or getAdmin(plr7) or getAdmin(plr,8then
            if not name then return end
            if veh then
                if getElementData(veh,"vehicle:spawn"then
                    outputChatBox("#bf0101(✖) #FFFFFFNie mo?esz zmieni? Sobie pojazdu prywatnego."plr255,255,255true)
                    return
                end
            end

            if tonumber(name) ~= nil then
                outputChatBox("#00ccff(ⓘ) #FFFFFFMusisz wpisa? nazw?, nie model."plr255,255,255true)
                return
            end

        if name == "rhino" or name == "hydra" or name =="seasparrow" or name == "hunter" or name == "Rhino" or name == "Hunter" or name == "Hydra" or name == "Infernus" or name == "infernus" then
                outputChatBox("#bf0101(✖) #FFFFFFBrak dost?pu do zakazanego modelu."plr255255,255true )
                return
            end

            local dim getElementDimension(plr)

            local x,y,getElementPosition(plr)
            local rx,ry,rz getElementRotation(plr)
            local veh createVehicle(getVehicleModelFromName(name), xyzrxryrz)
            local model getVehicleModelFromName(name)
            local rej setVehiclePlateText(veh"RESPIONY")

            setElementInterior(veh,getElementInterior(plr))
            setElementDimension(veh,getElementDimension(plr))
                warpPlayerIntoVehicle plrveh )
            outputChatBox("#06B200(✔) #FFFFFFZrespi?e?(a?) pojazd: #00ffff"..nameplr255,255,255true)
    end
end)


Jak ci nie dzia?a dalej to sobie ten kod przer?b pod swoje wymagania ale teleportowanie dzia?a.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-08-23, 15:17


Matikmontana

Modern Stories






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

Piwa: 1015

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%
Zrobi?em tak o:

addCommandHandler("respawnauta",function(plr,cmd,id)
   if getAdmin(plr,4then
   local veh getPedOccupiedVehicle(plr)
   if not id or not tonumber(idthen
        outputChatBox("MS♛ •  Podaj id pojazdu!"plr25500)
        return
    end
    if not veh then
       outputChatBox("MS♛ •  Musisz by? w pojed?dzie."plr255,0,0)
       return
    end
    local id getElementData(veh"vehicle:id")
    local x,y,z=getElementPosition(veh)
    local rx,ry,rz=getElementRotation(veh)
    local poss={x,y,z,rx,ry,rz}
    local name=getVehicleName (veh)
    exports["pystories-vehicles"]:onSaveVehicle(veh)
    setElementFrozen (vehtrue)
    destroyElement(veh)
    exports["pystories-db"]:dbSet("UPDATE pystories_vehicles SET parking=1,tp_to_parking=? WHERE id=?","Respawn RCON"id)
    exports["pystories-vehicles"]:onRespawnVehicles(_,tonumber(id), poss)
    outputChatBox("#FFFFFFZrespi?e?(a?) pojazd: #00ffff"..name.." ("..id..")"plr255,255,255true)
    local cub createColSphere(poss[1],poss[2],poss[3],2)
    local pojazdy getElementsWithinColShapecub"vehicle")
    if #pojazdy == 0 then
    outputChatBox("MS♛ • Brak pojazd?w w pobli?u."plr)
    return end
    for i,pojazd in ipairs(pojazdy) do
    warpPedIntoVehicle plrpojazd )
    end
    setTimer(destroyElement,50,1,cub)

    
    end
end)

mo?e poszed?em na oko?o ale dzia?a :P

Postaw piwo autorowi tego posta
 

 
Tagi: warpplayerintovehicle
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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