Julek12
New Member
- Joined
- Feb 19, 2008
- Messages
- 160
- Reaction score
- 0
Chciałbym się zapytać czy dobrze napisałem skrypt jeszcze nie testowałem.
i drugi one ze sobą współpracują
Code:
local config =
{
ice = {x=134, y=199, z=5},
fire = {x=68, y=151, z=5},
energy = {x=72, y=197, z=5},
earth = {x=140, y=158, z=5},
message_type = MESSAGE_EVENT_ORANGE
}
function onStepIn(cid, item, position, fromPosition)
if getPlayerLookDir(cid) == 0 then
newdir = 2
elseif getPlayerLookDir(cid) == 1 then
newdir = 3
elseif getPlayerLookDir(cid) == 2 then
newdir = 0
else
newdir = 1
end
if (item.actionid > 34000 and item.actionid < 34020) then
if getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 6 and getPlayerLevel(cid) >= 30 and isPremium(cid) == TRUE then
doTeleportThing(cid,config.ice)
doSendMagicEffect(config.ice,10)
setPlayerStorageValue(cid, 36002, item.actionid - 34000)
else
doPlayerSendTextMessage(cid, config.message_type, "Only Premium Druids of level 30 or higher are able to enter this portal")
doMoveCreature(cid, newdir)
end
elseif (item.actionid > 34100 and item.actionid < 34120) then
if getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 6 and getPlayerLevel(cid) >= 30 and isPremium(cid) == TRUE then
doTeleportThing(cid,config.earth)
doSendMagicEffect(config.earth,10)
setPlayerStorageValue(cid, 36002, item.actionid - 34100)
else
doPlayerSendTextMessage(cid, config.message_type, "Only Premium Druids of level 30 or higher are able to enter this portal")
doMoveCreature(cid, newdir)
end
elseif (item.actionid > 34200 and item.actionid < 34220) then
if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 5 and getPlayerLevel(cid) >= 30 and isPremium(cid) == TRUE then
doTeleportThing(cid,config.fire)
doSendMagicEffect(config.fire,10)
setPlayerStorageValue(cid, 36002, item.actionid - 34200)
else
doPlayerSendTextMessage(cid, config.message_type, "Only Premium Sorcers of level 30 or higher are able to enter this portal")
doMoveCreature(cid, newdir)
end
elseif (item.actionid > 34300 and item.actionid < 34320) then
if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 5 and getPlayerLevel(cid) >= 30 and isPremium(cid) == TRUE then
doTeleportThing(cid,config.energy)
doSendMagicEffect(config.energy,10)
setPlayerStorageValue(cid, 36002, item.actionid - 34300)
else
doPlayerSendTextMessage(cid, config.message_type, "Only Premium Sorcers of level 30 or higher are able to enter this portal")
doMoveCreature(cid, newdir)
end
end
return TRUE
end
Code:
function onStepIn(cid, item, position, fromPosition)
local array =
{
[1] = {x=134, y=199, z=5},
[2] = {x=134, y=199, z=5},
[3] = {x=134, y=199, z=5},
[4] = {x=134, y=199, z=5},
[5] = {x=134, y=199, z=5},
[6] = {x=134, y=199, z=5},
[7] = {x=134, y=199, z=5},
[8] = {x=134, y=199, z=5},
[9] = {x=134, y=199, z=5},
[10] = {x=134, y=199, z=5},
[11] = {x=134, y=199, z=5},
[12] = {x=134, y=199, z=5},
[13] = {x=134, y=199, z=5},
[14] = {x=134, y=199, z=5},
[15] = {x=134, y=199, z=5},
[16] = {x=134, y=199, z=5},
[17] = {x=134, y=199, z=5},
[18] = {x=134, y=199, z=5},
[19] = {x=134, y=199, z=5},
[20] = {x=134, y=199, z=5}
}
for i, k in pairs(array) do
if getPlayerStorageValue(cid, 36002) == i then
doTeleportThing(cid,k)
doSendMagicEffect(k,10)
setPlayerStorageValue(cid, 36002, -1)
else
doTeleportThing(cid,getTownTemplePosition(getPlayerTown(cid)))
doSendMagicEffect(getTownTemplePosition(getPlayerTown(cid)),10)
setPlayerStorageValue(cid, 36002, -1)
end
end
return TRUE
end