Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: teleportowanie
1. Teleportowanie się na dane koordynaty.
Witam,
mam problem poniewa? nie chce mi dzia?a? komenda na serwerze "tp" nie wiem czy dobrze xml napisa?em ale my?l? ?e tak tutaj Skrypt lua:
Kod:





addCommandHandler("tp", function(plr, cmd, x, y, z)


setElementPosition(tp, x, y, z)


end)



A tutaj xml:

Kod:


</meta>
<script src="tp.lua" type="server" />
</meta>
2. teleportowanie się
Jest jaki? skrypt na teleportowanie si? do przodu?
Widzia?em takie co? tylko nie moge tego znale??,
polega to na tym, ?e jest komenda i po prostu administrator Sobie to binduje i tepa si? np o 10metr?w przed Siebie
3. Teleportowanie się do map.
Jak mog? teleportowa? si? do mapy gdy jest w .zip ale w plikach nie ma podanych kord?w gdzie si? pojawia. Jest na to jaki? skrpyt czy co?? ZA POMOC +REP I PIWKO
4. Teleportowanie auto po uzyskaniu odpowiedniego koordynatu
Chcia?bym aby samoch?d po wpadni?ciu do wody teleportowa? si? na dane kordy.
Nigdy nie pisa?em z if kt?ry co? sprawdza wi?c prosz? o pomoc :)


function podw ()
    
local xygetElementPosition (Vehicle)
    if 
< -1 then
    
    setElementPosition
(vehZ1863.3369140625585.72070312510.64077091217 )
    
    
end
    
5. teleportowanie do pojazdu
witam.
mam prawo jazdy (kurs) lecz przedtem dzialalo bez narzekania. mianowicie chodzi o to ze nie repsi nas w pojezdzie (nie raz zadziala ze nas zrespi)
za poprawke kodu :piwo: + R* help:
s-side
[lua]
local egzaminowany=nil

function sethpnpc ()
end
setTimer( sethpnpc, 1000,0 )
local marker = createMarker ( 2274.41, -79.25, 25.7, "cylinder", 1.5, 0, 255, 40)
setElementDimension (marker, 0)
setElementInterior (marker, 0)

function onhit( source )
outputChatBox("Aby zda? prawo jazdy, wpisz nast?puj?ca komend? /rozpocznij.kurs.", source)
end
addEventHandler( "onMarkerHit", marker, onhit)

function kurs(source)
if isElementWithinMarker ( source, marker )
then
local konto = getPlayerAccount ( source )

if not getAccountData(konto,"prawojazdy" ) then
outputChatBox("Rozpoczynasz kurs prawa do jazdy. Przestrzegaj przepis?w na drogach! ", source)
outputDebugString( "Start prawo jazdy")
auto = createVehicle ( 401, 2277, -84, 26, 0, 0, 0)
setElementData(auto, "pojazd_opis", "Pojazd egzaminacyjny")
setVehicleColor ( auto, 255, 0, 255 )
setVehiclePlateText(auto, "PRAWKO")
setVehicleHandling(auto, "maxVelocity", 60)
setElementData(auto, "pojazd_paliwo", 99)
warpPedIntoVehicle ( source, auto )
toggleControl(source, "enter_exit", false)
triggerClientEvent ("zdajemyprawko", source )
else
out...
6. teleportowanie do auta ttv
Nie dzia?a , pomocy.

function ttv plr,cmd,id )
    
local login getAccountName getPlayerAccount plr ) )
    if 
sprawdzRoota(login) or sprawdzAdmina(login) or sprawdzModeratora(loginthen
    
if id then
        local id 
tonumber(id)
        
local v znajdzpojazd(id)
        if 
v then
            warpPedIntoVehicle
(plr,v)
            
outputChatBox("Teleportowano do pojazdu o ID: "..id,plr,255,0,0,true)
        else
            
outputChatBox("Nie znaleziono pojazdu o takim ID.",plr,255,0,0,true)
        
end
    
else
        
outputChatBox("Nie wpisa?e? ID pojazdu.",plr,255,0,0,true)
    
end
end
addCommandHandler
("ttv",ttv)

function 
znajdzpojazd(id)
    for 
i,v in pairs(getElementsByType("vehicle")) do
        if 
getElementData(v,"car_id") == id then
            
return v
        end
    end
end
7. Blip na markery, teleportowanie po zakonczeniu pracy
Witam, chcialbym sie zapytac was jak zrobic by
1. Po dojechaniu do ostatniego markera teleportowalo nas na miejsce rozpoczecia pracy ( Kordy : -1998.69, 70.68, 28.62.)
Oraz kolejne :
2. Zeby pokazywalo nam blipem gdzie mamy kolejny marker (czyli jak np zdaje sie prawo jazdy, to tam na mini mapce lub tez na F11 sa zaznaczone te markery blipem i wlasnie o to was prosze)
Z gory wielkie Dziekuje!!

Serwer

[lua]
local m1 = createMarker(-1998.69, 70.68, 28.62, "cylinder", 4.0, 255, 0, 0)
vehs = {}

local blip = createBlip(-1998.69, 70.68, 28.62, 52)

addEvent("givePlayerMoney", true)
addEventHandler("givePlayerMoney", getRootElement(),function(ile)
givePlayerMoney(source, tonumber(ile))
end)

function removePreviousVehicles(plr)
for i,v in ipairs(getElementsByType("vehicle", resourceRoot)) do
local sby = getElementData(v, "zrespilGracz")
if sby and sby == plr and getPedOccupiedVehicle(plr) ~= v then
destroyElement(v)
end
end
end

addEventHandler("onMarkerHit", m1, function(el, md)
if getElementData(el, "zrespilGracz") then
outputChatBox("[Informacja] Praca w trakcie poprawek", el)
return
end

if not md or getElementType(el) ~= "player" or getPedOccupiedVehicle(el) then return end

local x,y,z = getElementPosition(el)
local bus = createVehicle(572, x,y,z,-1992.3388671875, 75.3896484375, 27.813388824463)

setElementData(bus, "zrespilGracz", el)
...
8. Teleportowanie się adminów
Witam mam problem , dosta?em od kolegi kod na komendy i bajery admina , ale mam problem z teleportacj?.

addCommandHandler("test", function(el,md)
    
local gracz el
    
if isPedInVehicle(elthen gracz getPedOccupiedVehicle(elend
    setElementPosition
(gracz2500.5952, -1669.445413.3532)
    
outputChatBox("test."el2552550)
end)


ten kod dzia?a tylko ?e mo?e tepa? si? tam normalny gracz.

wi?c prosz? o pomoc jak zrobi? aby m?g? tepa? si? tam Moderator,Admin,Rcon

za pomoc :arrow: :piwo: R*
9. Teleportowanie do pojazdu
Cze??. Zrobi?em system pojazd?w oraz komend? do teleportowania do pojazdu o podanym UID. Problem w tym ?e ci?gle wy?wietla wiadomo??: "* Nie odnaleziono takiego pojazdu!". Nie mam poj?cia co jest ?le. W debugu nie ma ?adnego b??du.

addCommandHandler("ttv", function(plrcomid)
    if 
isObjectInACLGroup("user."..getAccountName(getPlayerAccount(plr)), aclGetGroup("Admin")) then
        
if id then
        local veh 
getVehiclesByUID(id)
            if 
veh then
            local x
,y,getElementPosition(veh)
            
setElementPosition(plrxyz+1)
            
outputChatBox("* Teleportowa?e? si? do pojazdu o UID: "..getElementData(veh"uid").."."plr)
            else
            
outputChatBox("* Nie odnaleziono takiego pojazdu!"plr)
            
end
        
else
        
outputChatBox("* Musisz poda? ID pojazdu!"plr)
        
end
    end
end
)


getVehiclesByUID:
function getVehiclesByUID(id)
    if 
id then
        
for k,v in ipairs(getElementsByType("vehicle")) do
            if 
getElementData(v"uid") == id then
            local veh 
v
            
else
            
local veh false
            end
        end
        
return veh
    end
end



//EDIT:

UID jest nadane poprawnie, poniewa? komenda /getid kt?ra je sprawdza, zwraca poprawn? warto??.
10. Teleportowanie pojazdu po id do siebie
jak to zrobic
11. Teleportowanie
Witam, m?g?by kto? poda? funkcje teleportowania gracza i funkcje kt?ra zmienia "dimenszon" xd... chc? zrobi? wej?cie do interioru i potrzebuj? tych 2 funkcji.
Daj? naj :piwo: