Hi, im from Poland, so sorry for bad english. Also i will be online tommorow next time, i can't enter today.
At first i need script (yes, request), when player die in area selected by me, i want monsters that are there, die.
Second thing, my script won't work:
Third script, talkaction, tic-tac-toe game, my sript won't work:
I cant copy errors now, sorry.
Thanks for helping :thumbup:
At first i need script (yes, request), when player die in area selected by me, i want monsters that are there, die.
Second thing, my script won't work:
Lua:
local block = {7577,7578,7579,7580,7581,7575,1284}
local noLogoutCondition = createConditionObject(CONDITION_INFIGHT, 24*60*60*1000)
local function stop(cid)
doTeleportThing(cid,back, true)
addEvent(doCreatureChangeOutfit, 1, cid,outfitback)
doCreatureSetNoMove(cid, false)
doRemoveCondition(p.cid, CONDITION_INFIGHT)
return true
end
...
local dir = getCreatureLookDirection(cid)
if direction == NORTH then
local pos = {x=position.x,y=position.y-1,z=position.z-0, stackpos = 1}
elseif direction == EAST then
local pos = {x=position.x+1,y=position.y,z=position.z-0, stackpos = 1}
elseif direction == SOUTH then
local pos = {x=position.x,y=position.y+1,z=position.z-0, stackpos = 1}
else
local pos = {x=position.x-1,y=position.y,z=position.z-0, stackpos = 1}
end
local a = getThingFromPos(pos)
if isInArray(block,a.itemid) == TRUE then ||THIS PART WON'T WORK||
stop(cid)
end
...
Third script, talkaction, tic-tac-toe game, my sript won't work:
Lua:
function getPlayersInRange(pos, rX, rY)
local ret = {}
for x = -rX, rX do
for y = -rY, rY do
local v = getTopCreature({x = pos.x+x, y = pos.y+y, z = pos.z}).uid
if isPlayer(v) == TRUE then
table.insert(ret, v)
end
end
end
return ret
end
local t = {
from = {x=841, y=1246, z=7},
to = {x=843, y=1252, z=7},
storage = {
turn = 11110,
player = 11111,
},
X = 2638,
O = 2639,
effect = CONST_ME_FIREAREA,
text = "Poof!",
temple = {x=842, y=1256, z=7},
positions = {
{x=841, y=1248,z=7},
{x=842, y=1248,z=7},
{x=843, y=1248,z=7},
{x=841, y=1249,z=7},
{x=842, y=1249,z=7},
{x=843, y=1249,z=7},
{x=841, y=1250,z=7},
{x=842, y=1250,z=7},
{x=843, y=1250,z=7};
}
}
function reset()
for x = t.from.x, t.to.x do
for y = t.from.y, t.to.y do
local pos = {x=x,y=y,z=t.from.z}
local i1, i2 = getTileItemById(pos, t.X).uid, getTileItemById(pos, t.O).uid
if i1 > 0 then
doRemoveItem(i1)
end
if i2 > 0 then
doRemoveItem(i2)
end
end
end
end
function onSay(cid, words, param, channel)
local param=param
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
return true
end
if isInRange(getThingPos(cid), t.from, t.to) and getPlayerStorageValue(cid, t.storage.turn)==1 then
if getPlayerStorageValue(cid, t.storage.player)==2 then -- O
local i1,i2 = getTileItemById(t.positions[param], t.X).uid, getTileItemById(t.positions[param], t.O).uid
if i1>0 or i2>0 then
return doPlayerSendCancel(cid, "Place is not empty.")
end
doCreateItem(t.O, 1, t.positions[param])
setPlayerStorageValue(cid, t.storage.turn, 0)
return true
end
if getPlayerStorageValue(cid, t.storage.player)==1 then -- X
local i1,i2 = getTileItemById(t.positions[param], t.X).uid, getTileItemById(t.positions[param], t.O).uid
if i1>0 or i2>0 then
return doPlayerSendCancel(cid, "Place is not empty.")
end
doCreateItem(t.X, 1, t.positions[param])
setPlayerStorageValue(cid, t.storage.turn, 0)
return true
end
end
end
Thanks for helping :thumbup: