if xxx then
doPlayerRemoveMoney(cid, money)
elseif xxx then
return false
end
function kasa()
doPlayerRemoveMoney(cid, 1)
end
functionOnThink
if xxx then
AddEvent(kasa, 2000, cid)
elseif xxx then
return 0
end
end
local function money(cid)
if(isPlayer(cid)) then
if(getPlayerMoney(cid) > 1) then
doPlayerRemoveMoney(cid, 1)
addEvent(money, 2000, cid)
else
doTeleportThing(cid, getTownMasterPos(getPlayerTown(cid)))
end
end
return true
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(getPlayerMoney(cid) > 1) then
addEvent(money, 2000, cid)
end
return true
end
Czytanie za zrozumieniem... Czas - chodziło mi o czas!
To ze ma usuwac np. gp z bp to mi to kolo dupy lata... to byl przyklad
Mam rozumiec ze "addEvent(x,x,cid)" jest odpowiedzialny za czas?
@ iMperator - popatrz na siebie ^^ wiem jak to dodac tylko ze nie znam funkcji odpowiedzialnej za czas... (nie znałem*)
To sie robi tak:PHP:function kasa() doPlayerRemoveMoney(cid, 1) end functionOnThink if xxx then AddEvent(kasa, 2000, cid) elseif xxx then return 0 end end
To sie robi tak:
AddEvent(x, y, z)
x - jaki event(skrypt)
y - czas(1s = 1000ms)
z - gracz
local noob = getCreatureByName("Your Master")
if(noob) then
doPlayerSendTextMessage(noob, MESSAGE_STATUS_CONSOLE_BLUE, "Za 3 sekundy giniesz!")
addEvent(doRemoveCreature, 3000, noob)
end
Wiec trzeba bylo urzyc petli i kazde zapetlenie opoznic o ta sekunde.
Code:local noob = getCreatureByName("Your Master") if(noob) then doPlayerSendTextMessage(noob, MESSAGE_STATUS_CONSOLE_BLUE, "Za 3 sekundy giniesz!") addEvent(doRemoveCreature, 3000, noob) end
Lepiej dodaj skrypt Chojraka.
Najpierw wytestuj dzialanie, pozniej zobacz jak jest zbudowany
Jak już to:
if(noob) == true, albo getCreatureByName(cid) == Your Master, i jak już, to otlander'a a nie playera bo nie gram w Tibie xD
I w grach nie używam tego nicku :ninja:
Yhy niby czemu?
local boolTest = true
if(boolTest) then
print("\o/ FLAWLESS VICTORY \o/")
end
[B]isCreature[/B]([B][U]cid[/U][/B])
[B]isMonster[/B]([B][U]uid[/U][/B])
isNpc(uid)
isPlayer(cid)
[...]A tak w ogole creature != player, a stworzeniem to chyba jestes c'nie?