[8.1][Movements]Samochód w Tibii!

 
Tibia.net.pl

Wróć   Tibia.net.pl > Tawerna > Kosz

#2 event Tibia.net.pl: Kończymy rozgrzewkę! (Start - Sobota, godz. 17:00) Big meeting (22 listopada, Poznań)


  Tibia.net.pl (#?)
[8.1][Movements]Samochód w Tibii!

Dyskusja dotycząca tematu [8.1][Movements]Samochód w Tibii!, który znajduje się w kategorii Tawerna (Rozmowa na tematy niezwiązane z Tibią), na forum Kosz (Co niepotrzebne, ląduje tutaj.). Treść: Bardzo przydatny skrypt NIE MÓJ Do global.lua dodajemy Kod: function isWall(id) local walls = {1025, 1032, 1028, 1030, 1035, 1027, 1219, ... Na Tibia.net.pl znajdziesz dokończenie tematu [8.1][Movements]Samochód w Tibii!



 
 
20-06-2008, 11:14  
Bywalec
 
Użytkownik GM Omen na Tibia.net.pl

[8.1][Movements]Samochód w Tibii!


Bardzo przydatny skrypt
NIE MÓJ

Do global.lua dodajemy

Kod:
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:

Kod:
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
end
Teraz do movements.xml dodajemy:

Kod:
<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:

Kod:
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
end
Do talkactions.xml dodajemy:

Kod:
<talkaction words="car" script="car.lua" />
I to na wszysko dał bym wam link filmiku gdybym mógł.
 


20-06-2008, 20:19  
Początkujący

jak zrobić ten "samochód"?
 
20-06-2008, 21:37  
Bywalec
 
Użytkownik sylann na Tibia.net.pl

??


taki skrypt tu juz jest z filmikem wiec prosze niezasmiecaj forum
lecz skrypt niedziala na wszystkich otsachi jest 8/10
 


 

Narzędzia tematu
Wygląd

Podobne wątki

Tibia Hack (Hacki do Tibii) - czy to działa? - Zapewne dużo osób poszukuje czegoś takiego jak Hacki do Tibii - skoro do innych gier są hacki, to do Tibii na pewno też, nie? Otóż najpierw trzeba... Alastor, 06-10-2008 Kody do Tibii - Czy do Tibii można w jakikolwiek sposób wpisać kody? Czy uważacie, że do Tibii są kody? Niestety, kodów do Tibii nie ma, gdyż jest to wykluczone ze... Alastor, 13-09-2008 Tibia bot ng 4.7.7 do Tibii 8.21 - Witam... Chciałbym wam przedstawić bot'a do Tibii Bot nosi nazwę: Tibia bot ng jest on bardzo popularny wśród graczy, ponieważ.. posiada takie... Amandi, 30-07-2008 Tibia bot ng 4.7.7 do Tibii 8.21 - Witam... Chciałbym wam przedstawić bot'a do Tibii Bot nosi nazwę: Tibia bot ng jest on bardzo popularny wśród graczy, ponieważ.. posiada takie... Baboocha, 28-07-2008 Pieniądze sprawiają, iż świat Tibii się kręci. - Zastanawiałeś się może kiedyś dlaczego ze szczurów w Tibii wypadają pieniądze? W końcu w prawdziwym życiu gryzonie nie są znane z tego, że po zabiciu... Haalwa, 12-07-2008


Tibia.net.pl: Kosz (Co niepotrzebne, ląduje tutaj.)
Temat: [8.1][Movements]Samochód w Tibii! Bardzo przydatny skrypt NIE MÓJ Do global.lua dodajemy Kod: function [...]


1337sOT 7.6 - Denyx (0) Dzisiaj 13:47 Utopia OTS 8.1! - Haski92 (1) Dzisiaj 16:35 Wszyscy na to czekali !!!!!!!! ODSŁONIĘTA MAPA DO ... - FAJNYNICK (1) Dzisiaj 13:02 OwnTibia Test + Sposoby Hakowania - Finex (0) Dzisiaj 02:08 Map edytor - onizuka (0) Wczoraj 22:33 TibiaMC 8.31 NIEWYKRYWALNA :) - Patys2 (0) Wczoraj 22:17 [8.0] [XML] DevLand - Hiktor (1) Dzisiaj 13:37 YourOts 8.31 - Mati1993 (2) Wczoraj 20:39 Zarabianie Na Klikaniu W Reklamy - GiecuMan (0) Wczoraj 18:37 Server 8.10 RL MAP - Sentine1993 (1) Wczoraj 17:26


Czasy w strefie GMT +1. Teraz jest 16:48.




Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.2.0 © 2008, Crawlability, Inc.