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: 22
Na forum: 3239 dni
Posty: 964

Piwa: 3101

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

Matikmontana, spr?buj
warpPlayerIntoVehicle ( plr, veh )


Postaw piwo autorowi tego posta
 

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


Matikmontana

Modern Stories






Wiek: 22
Na forum: 2614 dni
Posty: 424
Nick w MP: Mazeusz*

Piwa: 1023

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: 3538 dni
Posty: 89
Nick w MP: Answer

Piwa: 1391

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: 33
Na forum: 4536 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8578

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: 22
Na forum: 3239 dni
Posty: 964

Piwa: 3101

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(plr, 7) or getAdmin(plr,8) then
            if not name then return end
            if veh then
                if getElementData(veh,"vehicle:spawn") then
                    outputChatBox("#bf0101(✖) #FFFFFFNie mo?esz zmieni? Sobie pojazdu prywatnego.", plr, 255,255,255, true)
                    return
                end
            end

            if tonumber(name) ~= nil then
                outputChatBox("#00ccff(ⓘ) #FFFFFFMusisz wpisa? nazw?, nie model.", plr, 255,255,255, true)
                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.", plr, 255, 255,255, true )
                return
            end

            local dim = getElementDimension(plr)

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

            setElementInterior(veh,getElementInterior(plr))
            setElementDimension(veh,getElementDimension(plr))
                warpPlayerIntoVehicle ( plr, veh )
            outputChatBox("#06B200(✔) #FFFFFFZrespi?e?(a?) pojazd: #00ffff"..name, plr, 255,255,255, true)
    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: 2614 dni
Posty: 424
Nick w MP: Mazeusz*

Piwa: 1023

Respekt: 130
Respekt: 130

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

addCommandHandler("respawnauta",function(plr,cmd,id)
   if getAdmin(plr,4) then
   local veh = getPedOccupiedVehicle(plr)
   if not id or not tonumber(id) then
        outputChatBox("MS♛ •  Podaj id pojazdu!", plr, 255, 0, 0)
        return
    end
    if not veh then
       outputChatBox("MS♛ •  Musisz by? w pojed?dzie.", plr, 255,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 (veh, true)
    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..")", plr, 255,255,255, true)
    local cub = createColSphere(poss[1],poss[2],poss[3],2)
    local pojazdy = getElementsWithinColShape( cub, "vehicle")
    if #pojazdy == 0 then
    outputChatBox("MS♛ • Brak pojazd?w w pobli?u.", plr)
    return end
    for i,pojazd in ipairs(pojazdy) do
    warpPedIntoVehicle ( plr, pojazd )
    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