Szerző Téma: CarSpawner parancs  (Megtekintve 1116 alkalommal)

CarSpawner parancs
« Dátum: 2016. Augusztus 09. - 17:32:36 »
0
Sziasztok!
Az lenne a kérdésem, hogy irtam egy SZERINTEM teljes parancsot, amivel autót spawnolhatsz a melletted lévő koordinátára, de valamiért nem működik és semmi visszajelzést nem küld. Mi lehet a hiba?
 
function vehicle(source, model, command)
if(tonumber(model) < 400 or tonumber(model) > 611) then
outputChatBox(\"Nem található ilyen jármű id!\", source)
else
local x, y, z = getElementPosition(source)
createVehicle(model, x+3, y, z+2)
outputChatBox(\"Jármű sikeres spawnolása!\", source)
end
end
addCommandHandler(\"cv\", getRootElement(), vehicle)
« Utoljára szerkesztve: 2016. Augusztus 09. - 17:39:27 írta Joe North »

CarSpawner parancs
« Válasz #1 Dátum: 2016. Augusztus 09. - 17:39:15 »
0
Szia!
Szerintem itt van a gond:(záró jel rossz helyen van)
outputChatBox(\"Jármű sikeres spawnolása!\", source
end)
Helyesen:
outputChatBox(\"Pelaszov\", source, 255, 0, 0)
end

CarSpawner parancs
« Válasz #2 Dátum: 2016. Augusztus 09. - 17:40:02 »
0
Most láttam én is, kijavítottam de nem jó:/

Nem elérhető Eduka

  • 214
    • Profil megtekintése
CarSpawner parancs
« Válasz #3 Dátum: 2016. Augusztus 09. - 18:33:49 »
0
function vehicle(thePlayer, cmd, model)
if(tonumber(model) < 400 or tonumber(model) > 611) then
outputChatBox(\"Nem található ilyen jármű id!\", thePlayer, 255, 255, 255)
else
local x, y, z = getElementPosition(thePlayer)
createVehicle(model, x+3, y, z+2)
outputChatBox(\"Jármű sikeres spawnolása!\", thePlayer, 255, 255, 255)
end
end
addCommandHandler(\"cv\", vehicle)

CarSpawner parancs
« Válasz #4 Dátum: 2016. Augusztus 09. - 18:44:46 »
0
Ezzel sem működik

Nem elérhető AnthonyGates

  • 546
  • AnthonyGates
    • Profil megtekintése
CarSpawner parancs
« Válasz #5 Dátum: 2016. Augusztus 09. - 18:55:47 »
0

function kocsiSpawn(thePlayer, vehId)
local rvehid = tonumber(vehId)
local x,y,z = getElementPosition(thePlayer)
if(rvehid < 400 or rvehid > 611) then
outputChatBox(\"Nem létezik ilyen ID!\", thePlayer, 255, 255, 255)
else
local playerveh = createVehicle(rvehid, x,y,z)
warpPedIntoVehicle(thePlayer,playerveh)
outputChatBox(\"A jármű lerakva!\", thePlayer, 255, 255, 255)
end
end
addCommandHandler(\"kocsi\",kocsiSpawn )

 
Még mindíg nem luáztam, ezt dokumentációból írtam, nincs is tesztelve, de szeretettel megáldom, hogy működjön.
/kocsi id

CarSpawner parancs
« Válasz #6 Dátum: 2016. Augusztus 09. - 19:09:04 »
0
Sajnos ez sem működik

CarSpawner parancs
« Válasz #7 Dátum: 2016. Augusztus 09. - 19:24:33 »
0

function kocsispawn(thePlayer, command, vehicleModel)
local x,y,z = getElementPosition(thePlayer)
x = x + 5
local kocsiadd = createVehicle(tonumber(vehicleModel),x,y,z)
if (kocsiadd == false) then
outputChatBox(\"Nem sikerült spawnolni az autót!\")
end
end
addCommandHandler(\"kocsiadd\", kocsispawn)

 
/kocsiadd <id>

Nem elérhető Eduka

  • 214
    • Profil megtekintése
CarSpawner parancs
« Válasz #8 Dátum: 2016. Augusztus 09. - 19:43:42 »
0
Ugye szerver oldalon próbálod?

Dupla hozzászólás automatikusan összefûzve. ( 2016. Augusztus 09. - 19:45:30 )

beni1324[/member]
 
function kocsispawn(thePlayer, command, vehicleModel)
local x,y,z = getElementPosition(thePlayer)
x = x + 5
local kocsiadd = createVehicle(tonumber(vehicleModel),x,y,z)
if not (kocsiadd) then
outputChatBox(\"Nem sikerült spawnolni az autót!\")
end
end
addCommandHandler(\"kocsiadd\", kocsispawn)
« Utoljára szerkesztve: 2016. Augusztus 09. - 19:45:30 írta Eduka »

CarSpawner parancs
« Válasz #9 Dátum: 2016. Augusztus 09. - 19:53:36 »
0
Sikerült, Köszönöm. Zárom. Helyezhető!

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal