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

Wysłany: 2015-07-14, 16:33


Daisu

Programista Lua






Wiek: 26
Na forum: 4444 dni
Posty: 193
SPONSOR
Nick w MP: Daisu

Piwa: 24

Respekt: 90

Witam chcia?bym zrobi? skrypt kt?ry respawnuje nie u?ywane auta np mam skrypt
i tak stworzonych aut mam 12 i chcia?bym aby one gdy nie s? u?ywane po 1 minucie respi?y si? na miejscu.


spawn12 createVehicle 462, -xyz180174.50677490234180"Axel")
model getElementModel(spawn12)
setElementData(spawn12,"message","Pojazd Publiczny" )
setVehicleColorspawn122552552552550)


Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-14, 16:44


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4838 dni
Posty: 915

Piwa: 2697

Respekt: 955,3
Respekt: 955,3Respekt: 955,3

if not getVehicleController(spawn12) then
setTimer(function()
respawnVehicle(spawn12)
end, 60*1000, 0)


Co? takiego.

Podpis
Jedyny kontakt ze mną to PW forum

Kod:


local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-14, 16:48


Daisu

Programista Lua






Wiek: 26
Na forum: 4444 dni
Posty: 193
SPONSOR
Nick w MP: Daisu

Piwa: 24

Respekt: 90

Dzi?ki wielkie za pomoc.

[ Dodano: 2015-07-14, 20:43 ]
Mam ma?y problem zrobi?em tak


spawn12 createVehicle 462, -1982.2865.544.9180174.50677490234180"Axel")
model getElementModel(spawn12)
setElementData(spawn12,"message","Pojazd Publiczny 12" )
setVehicleColorspawn122552552552550)


if not getVehicleController(spawn12then
setTimer(function()
respawnVehicle(spawn12)
end2*10000end


wiem ?e pewnie ?le zrobi?em ale auto si? respi co 2 sekundy nawet gdy kto? w nim siedzi.

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-14, 19:11


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

Iksdekowski, niezbyt to optymalny skrypt ;D co minuty b?dzie si? respi? pojazd :D
KineQ, co do twojego problemu to mo?e co? takie:
local czas getTickCount() 
function czas ()
    if getTickCount() - czas 60000 then
    czas getTickCount() 
     local driver getVehicleOccupant source )
        if not driver then
        respawnVehicle(spawn12)
        end
    end
end
addEventHandler("onClientRender"rootczas)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-14, 20:19


Daisu

Programista Lua






Wiek: 26
Na forum: 4444 dni
Posty: 193
SPONSOR
Nick w MP: Daisu

Piwa: 24

Respekt: 90

Luki123 tw?j skrypt nie dzia?a i nw czy czasami win? nie jest to ?e mam czasz realny na serverze.

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-14, 20:33


Maximerr

Programmer PHP, LUA






Wiek: 25
Na forum: 4427 dni
Posty: 548

Piwa: 1051

Respekt: 365,3
Respekt: 365,3Respekt: 365,3Respekt: 365,3Respekt: 365,3

luki123luki123, rendering te? nie jest tak optymalny, jak Ci si? wydaje.
KineQ,
spawn12 createVehicle 462, -1982.2865.544.9180174.50677490234180"Axel")
model getElementModel(spawn12)
setElementData(spawn12,"message","Pojazd Publiczny 12" )
setVehicleColorspawn122552552552550)


setTimer(function()
if not getVehicleController(spawn12then
respawnVehicle(spawn12)
end
end2*10000


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-14, 22:05


Daisu

Programista Lua






Wiek: 26
Na forum: 4444 dni
Posty: 193
SPONSOR
Nick w MP: Daisu

Piwa: 24

Respekt: 90

Maximerr dzia?a ale faggio nie potrafi usta? spada.


spawn12 createVehicle 462, -1982.2865.544.9180174.50677490234180"Axel")
model getElementModel(spawn12)
setElementData(spawn12,"message","Pojazd Publiczny 12" )
setVehicleColorspawn122552552552550)


setTimer(function()
if not getVehicleController(spawn12then
respawnVehicle(spawn12)
end
end2*10000


[ Dodano: 2015-07-15, 00:06 ]
Sorka dodaje ?e je?eli kto? zostawi motor nie postawiony a le??cy na boku motor nie zrespawni si? poprawnie tylko b?dzie spada?.

[ Dodano: 2015-07-15, 00:07 ]
A Chodzi mi bardziej ?eby on wraca? na swoje miejsce z rotacj? w??cznie.

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-14, 22:23


Maximerr

Programmer PHP, LUA






Wiek: 25
Na forum: 4427 dni
Posty: 548

Piwa: 1051

Respekt: 365,3
Respekt: 365,3Respekt: 365,3Respekt: 365,3Respekt: 365,3

KineQ,

spawn12 createVehicle 462, -1982.2865.544.9180174.50677490234180"Axel")
model getElementModel(spawn12)
setElementData(spawn12,"message","Pojazd Publiczny 12" )
setVehicleColorspawn122552552552550)


setTimer(function()
if not getVehicleController(spawn12then
respawnVehicle(spawn12)
setElementRotation (spawn12180174.50677490234180 )
end
end2*10000)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-14, 22:25


Daisu

Programista Lua






Wiek: 26
Na forum: 4444 dni
Posty: 193
SPONSOR
Nick w MP: Daisu

Piwa: 24

Respekt: 90

0 b??d?w w debugu 3 ale nadal to samo.

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-14, 22:28


Maximerr

Programmer PHP, LUA






Wiek: 25
Na forum: 4427 dni
Posty: 548

Piwa: 1051

Respekt: 365,3
Respekt: 365,3Respekt: 365,3Respekt: 365,3Respekt: 365,3

KineQ,

spawn12 createVehicle 462, -1982.2865.544.9180174.50677490234180"Axel")
model getElementModel(spawn12)
setElementData(spawn12,"message","Pojazd Publiczny 12" )
setVehicleColorspawn122552552552550)


setTimer(function()
if not getVehicleController(spawn12then
destroyElement(spawn12)

spawn12 createVehicle 462, -1982.2865.544.9180174.50677490234180"Axel")
model getElementModel(spawn12)
setElementData(spawn12,"message","Pojazd Publiczny 12" )
setVehicleColorspawn122552552552550)
end
end2*10000)

Spr?buj tak. :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-14, 22:30


Daisu

Programista Lua






Wiek: 26
Na forum: 4444 dni
Posty: 193
SPONSOR
Nick w MP: Daisu

Piwa: 24

Respekt: 90

Dzia?a Masz Piwko.

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-15, 16:15


KukiX







Wiek: 34
Na forum: 6718 dni
Posty: 567

Piwa: 17560

Respekt: 160
Respekt: 160Respekt: 160

Nie lepiej skorzysta? funkcji https://wiki.multitheftauto.com/wiki/SetVehicleRespawnDelay zamiast obci??a? serwer zb?dnym timerem?

Podpis
Moje skrypty MTA:
¤PlayDM
¤Mini-Games v0.2
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-15, 16:45


Daisu

Programista Lua






Wiek: 26
Na forum: 4444 dni
Posty: 193
SPONSOR
Nick w MP: Daisu

Piwa: 24

Respekt: 90

KukiX masz racj? zaraz przetestuj? czy tw?j spos?b zadzia?a poprawinie.

[ Dodano: 2015-07-15, 18:51 ]
Mam tu z wiki gotowca kt?ry dzia?a w 50% jak chcia?em i teraz jak do niego doda? aby respawni? si? 60sek gdy nie jest u?ywany i nie stoi blisko swojego respa.



spawn12 createVehicle 462, -1982.2865.544.9180174.50677490234180"Axel")      -- create us a new vehicle
if ( spawn12 then
    toggleVehicleRespawn spawn12true )     -- enable vehicle respawn
    setVehicleRespawnDelay spawn122000 )  -- tell the server to respawn the vehicle 20 seconds after it's blown
end




Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-15, 17:19


Maximerr

Programmer PHP, LUA






Wiek: 25
Na forum: 4427 dni
Posty: 548

Piwa: 1051

Respekt: 365,3
Respekt: 365,3Respekt: 365,3Respekt: 365,3Respekt: 365,3

KineQ, bez timera si? nie obejdzie... Nie podepniesz pod t? funkcj?(setVehicleRespawnDelay) sprawdzenia czy kto? siedzi. :)

Postaw piwo autorowi tego posta
 

 
Tagi: szukam :: funkcji
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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