
Tibia Fans-Czyli serwis o OTS i swiecie Tibia.com
Witam, nie mogłem się powstrzymać by tego tutaj nie dać.
Oto samochód:
Dodajemy do global.lua:
function isWall(id)
local walls = {1025, 1032, 1028, 1030, 1035, 1027, 1219, 4645, 4647, 4646, 4644}
if isInArray(walls, id) == 1 then
return 1
else
return 0
end
end
Teraz wchodzimy w data/movements/scripts i robimy plik o nazwie car.lua a w nim:
Cytat:
local storages = {
isMoving = 12550,
direction = 12551,
speed = 12552
}
function CarMoveLeft(x)
cpos = x.Cpos
Car = getThingfromPos(cpos)
newpos = {x=x.pos.x-1, y=x.pos.y, z=x.pos.z}
doCreateItem(7267,1,newpos)
doTeleportThing(x.cid, newpos)
doRemoveItem(Car.uid,1)
end
function CarMoveRight(x)
cpos = x.Cpos
Car = getThingfromPos(cpos)
newpos = {x=x.pos.x+1, y=x.pos.y, z=x.pos.z}
doCreateItem(7267,1,newpos)
doTeleportThing(x.cid, newpos)
doRemoveItem(Car.uid,1)
end
function CarMoveUp(x)
cpos = x.Cpos
Car = getThingfromPos(cpos)
newpos = {x=x.pos.x, y=x.pos.y-1, z=x.pos.z}
doCreateItem(7266,1,newpos)
doTeleportThing(x.cid, newpos)
doRemoveItem(Car.uid,1)
end
function CarMoveDown(x)
cpos = x.Cpos
Car = getThingfromPos(cpos)
newpos = {x=x.pos.x, y=x.pos.y+1, z=x.pos.z}
doCreateItem(7266,1,newpos)
doTeleportThing(x.cid, newpos)
doRemoveItem(Car.uid,1)
end
function onStepIn(cid, item, pos)
if isPlayer(cid) == 1 then
local status = {
isMoving = getPlayerStorageValue(cid, storages.isMoving),
direction = getPlayerStorageValue(cid, storages.direction),
speed = getPlayerStorageValue(cid, storages.speed)
}
if status.speed <= 0 then
setPlayerStorageValue(cid, storages.speed, 500)
status.speed = 800
elseif status.speed >= 2500 then
setPlayerStorageValue(cid, storages.speed, 500)
status.speed = 800
end
CarPos = getThingPos(item.uid)
if status.isMoving == 1 then
if status.direction == 1 then
CheckLeft = getThingfromPos({x = pos.x-1, y = pos.y, z = pos.z, stackpos = 1})
if isWall(CheckLeft.itemid) == 1 or isCreature(CheckLeft.uid) == 1 then
setPlayerStorageValue(cid, storages.direction, 2)
x = {cid = cid, pos = pos, Cpos = CarPos}
addEvent(CarMoveRight, status.speed, x)
else
x = {cid = cid, pos = pos, Cpos = CarPos}
addEvent(CarMoveLeft, status.speed, x)
end
elseif status.direction == 2 then
CheckRight = getThingfromPos({x = pos.x+1, y = pos.y, z = pos.z, stackpos = 1})
if isWall(CheckRight.itemid) == 1 or isCreature(CheckRight.uid) == 1 then
setPlayerStorageValue(cid, storages.direction, 1)
x = {cid = cid, pos = pos, Cpos = CarPos}
addEvent(CarMoveLeft, status.speed, x)
else
x = {cid = cid, pos = pos, Cpos = CarPos}
addEvent(CarMoveRight, status.speed, x)
end
elseif status.direction == 3 then
CheckUp = getThingfromPos({x = pos.x, y = pos.y-1, z = pos.z, stackpos = 1})
if isWall(CheckUp.itemid) == 1 or isCreature(CheckUp.uid) == 1 then
setPlayerStorageValue(cid, storages.direction, 4)
x = {cid = cid, pos = pos, Cpos = CarPos}
addEvent(CarMoveDown, status.speed, x)
else
x = {cid = cid, pos = pos, Cpos = CarPos}
addEvent(CarMoveUp, status.speed, x)
end
elseif status.direction == 4 then
CheckDown = getThingfromPos({x = pos.x, y = pos.y+1, z = pos.z, stackpos = 1})
if isWall(CheckDown.itemid) == 1 or isCreature(CheckDown.uid) == 1 then
setPlayerStorageValue(cid, storages.direction, 3)
x = {cid = cid, pos = pos, Cpos = CarPos}
addEvent(CarMoveUp, status.speed, x)
else
x = {cid = cid, pos = pos, Cpos = CarPos}
addEvent(CarMoveDown, status.speed, x)
end
end
elseif status.isMoving == -1 then
setPlayerStorageValue(cid, storages.isMoving, 1)
end
end
endTeraz do movements.xml dodajemy:
Cytat:
<movevent event="StepIn" itemid="7267" script="car.lua" /> <movevent event="StepIn" itemid="7266" script="car.lua" />
Teraz wchodzimy w data/talkactions/scripts i robimy plik o nazwie car.lua a w nim:
local storages = {
isMoving = 12550,
direction = 12551,
speed = 12552
}
function onSay(cid, words, param)
local status = {
isMoving = getPlayerStorageValue(cid, storages.isMoving),
direction = getPlayerStorageValue(cid, storages.direction),
speed = getPlayerStorageValue(cid, storages.speed)
}
local controls = {
["up"] = {storage = storages.direction, new = 3, txt = "up"},
["down"] = {storage = storages.direction, new = 4, txt = "down"},
["left"] = {storage = storages.direction, new = 1, txt = "left"},
["right"] = {storage = storages.direction, new = 2, txt = "right"},
["speedup"] = {storage = storages.speed, new = status.speed-50, txt = "fast"},
["speeddown"] = {storage = storages.speed, new = status.speed+50, txt = "slow"},
["stop"] = {storage = storages.direction, new = -1, txt = "stop"}
}
if status.isMoving == 1 then
ctrl = controls[param]
if (ctrl ~= nil) then
setPlayerStorageValue(cid, ctrl.storage, ctrl.new)
doPlayerSay(cid, ctrl.txt, TALKTYPE_SAY)
else
doSendMagicEffect(getPlayerPosition(cid), 2)
doPlayerSendCancel(cid, "Invalid operation.")
end
else
doPlayerSendCancel(cid, "You are not in a car.")
end
endDo talkactions.xml dodajemy:
<talkaction words="car" script="car.lua" />
Skrypt nie jest mój wziełem go z otfans
Pozdro w jażdzie:D
Nie wieżysz patrz?
Tibia Car system
By LukiS
Offline
To natym filmiku raczej nie wyglądało jak samochód ale też dobre tylko szkoda że trzeba mówić ale i tak w hotkeyah sobie ustawisz i jazda.
Offline

heh nawet fajne, podoba mi sie repucik leci xD
Offline

Fajny skrypt ale jednak szkoda ze trzeba mowic aby skrecac Ale tak jak Admin powiedzial hotkeye i jazda
Offline
@up
nie użyteczzne? przykład...
Offline
@up
Na 8.1 za dużo silników jeszcze nie wyszło. Aries za bardzo sobie nie radzi i bardzo często crashuje, a dodatkowe przeciążenie rozstroi go totlanie. A pozatym jeśli każdy na OTSie będzie jeździł takim samochodem gra stanie sie mniej przyjemna (zero możliwości PK) Ale to tylko moje zdanie....
Pozdrawiam

Offline

Mi to nie działa ;( Pomocy! Pisze "Invalid operation."
Offline

nie no super, jak bede mial wiecej postow dam reputa
Offline
@Gicol
Na 8.1 za dużo silników jeszcze nie wyszło
coooooooo nie wyszło dużo silników to ja jestem babcia Edka wiesz ile już silników wyszło mam wymieniać no dobra wymienie te co znam
Evolution, TFS, Develant, B-Fox, Sp33derOT, Quickly OTServ i może jeszcze by się coś znalazło, a to jest może większa połowa całego spisu bo przecież są jeszcze edytowane itp.
To jest nawet fajny dodtaek do OTS z albo bardzo dużym expem żeby ścigać kogoś jak ucieka albo na bardzo małych jakieś wyścigi za kase np. 2 kułka koło tample.
Offline
Gicol napisał:
@up
Na 8.1 za dużo silników jeszcze nie wyszło. Aries za bardzo sobie nie radzi i bardzo często crashuje, a dodatkowe przeciążenie rozstroi go totlanie. A pozatym jeśli każdy na OTSie będzie jeździł takim samochodem gra stanie sie mniej przyjemna (zero możliwości PK) Ale to tylko moje zdanie....
Pozdrawiam
Samochód pod 7.92 to co gadasz o 8.1?
Offline

Na jakim to silniku działa bo przetestowałem 8 i za każdym razem pisze Invit Operation czy jakoś podobnie.
Offline

Pierdolniete to forum nikt sie tu nie udziela!
Offline
@up
żal
@upx3 napisałem odp że pod 7.92
Skoro takie forum ban...
Offline