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

Wysłany: 2013-07-25, 09:57


TheTroll

Pan Majster






Wiek: 38
Na forum: 4764 dni
Posty: 219
Nick w MP: TheTroll

Piwa: 1114

Respekt: 120
Respekt: 120

Siema. Napisalem skrypt na na zmiane spawnu pojazdu. Polega on na tym ze kiedy jestesmy w danym pojezdzie i wpiszemy komende /setspawn to ustawi sie on tam gdzie stoi dane autko. Ale niestety mi to nie dziala tutaj macie kod:
Kod:

function respawn(thePlayer, command)
local x, y, z = getElementPosition(thePlayer)
local setVehicleRespawnPosition (vehicle)
local spawnVeh then outputChatBox("Spawn pojazdu ustawionio pomyslnie!", thePlayer) else outputChatBox("Error",thePlayer) end
end

addCommandHandler("setspawn", respawn)

Za pomoc beda piwka :D

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-07-25, 10:02


Riot

3X






Wiek: 29
Na forum: 5729 dni
Posty: 1123
Nick w MP: Riot/3X

Piwa: 286

Respekt: 123
Respekt: 123

Yyy..Polecam poczytanie o warunkach i argumentach.

function respawn(thePlayercommand)
local xygetElementPosition(thePlayer)
local vehicle getPedOccpuedVehicle(thePlayer)
       if vehicle then
       local spawnVeh setVehicleRespawnPosition (vehicle)
              if spawnVeh then
             outputChatBox("Spawn pojazdu ustawionio pomyslnie!"thePlayer) 
             else 
             outputChatBox("Error",thePlayer)
             end
     else
     outputChatBox("Nie jeste? w pojedzie!"thePlayer)
     end
end
addCommandHandler("setspawn"respawn)


W sumie warunek spawnVeh jest kompletnie nie przydatny bo 99.9% skrypt si? wykona no ale jak ju? napisa?e? to ?ap.


Poczytaj te? co to zmienne i jak sie je tworzy.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-07-25, 10:23


TheTroll

Pan Majster






Wiek: 38
Na forum: 4764 dni
Posty: 219
Nick w MP: TheTroll

Piwa: 1114

Respekt: 120
Respekt: 120

Ziomek11, cos nie dziala :( . W debugu wyskoczylo to: ERROR: setspawn/skrypt.lua:3: attempt to call global 'getPedOccpuedVehicle' (a nil value)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-07-25, 11:32


Riot

3X






Wiek: 29
Na forum: 5729 dni
Posty: 1123
Nick w MP: Riot/3X

Piwa: 286

Respekt: 123
Respekt: 123

function respawn(thePlayercommand)
local xygetElementPosition(thePlayer)
local vehicle getPedOccupiedVehicle(thePlayer)
       if vehicle then
       local spawnVeh setVehicleRespawnPosition (vehicle)
              if spawnVeh then
             outputChatBox("Spawn pojazdu ustawionio pomyslnie!"thePlayer) 
             else 
             outputChatBox("Error",thePlayer)
             end
     else
     outputChatBox("Nie jeste? w pojedzie!"thePlayer)
     end
end
addCommandHandler("setspawn"respawn)


liter?wka

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-07-25, 12:36


TheTroll

Pan Majster






Wiek: 38
Na forum: 4764 dni
Posty: 219
Nick w MP: TheTroll

Piwa: 1114

Respekt: 120
Respekt: 120

dalej nie dziala ale teraz pisze w debugu: bad arugumet setVehicleRespawnPosition

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-07-25, 13:20


Riot

3X






Wiek: 29
Na forum: 5729 dni
Posty: 1123
Nick w MP: Riot/3X

Piwa: 286

Respekt: 123
Respekt: 123

function respawn(thePlayercommand)
local xygetElementPosition(thePlayer)
local vehicle getPedOccupiedVehicle(thePlayer)
       if vehicle then
       local spawnVeh setVehicleRespawnPosition (vehiclexyz)
              if spawnVeh then
             outputChatBox("Spawn pojazdu ustawionio pomyslnie!"thePlayer) 
             else 
             outputChatBox("Error",thePlayer)
             end
     else
     outputChatBox("Nie jestes w pojedzie!"thePlayer)
     end
end
addCommandHandler("setspawn"respawn)


Dziwne by dzia?a?o skoro nie poda?e? gdzie ten pojazd ma si? respawnowa?.

Postaw piwo autorowi tego posta
 

 
Tagi: respawn :: pojazdu
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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