function onSay(cid, words, param, channel)
local toPos = getCreatureLookPosition(cid)
if getPlayerSoul(cid) < 20 then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, '[Teleport Noob] Nie masz 20 Souli.')
return true
end
toPos.stackpos = STACKPOS_TOP_CREATURE
local tmp = getThingFromPos(toPos)
local noob = 0
if getTileInfo(toPos).protection then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, '[Teleport Noob] Nie mozesz uzyc komendy na graczu w PZ.')
return true
end
if(tmp.uid ~= 0) then
if(isPlayer(tmp.uid)) then
noob = tmp.uid
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, '[Teleport Noob] Komende mozna uzyc tylko na graczu z pozimem nizszym niz 50.')
return true
end
end
if noob ~= 0 then
if getPlayerLevel(cid) >= 50 then
if getPlayerLevel(noob) < 50 then
doPlayerAddSoul(cid,-100)
doTeleportThing(noob,getTownTemplePosition(getPlayerTown(noob)))
doSendMagicEffect(toPos, CONST_ME_MAGIC_RED)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, '[Teleport Noob] Gracza przeteleportowano.')
return true
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, '[Teleport Noob] Gracz ma poziom wyzszy od 50.')
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, '[Teleport Noob] Nie masz 50 poziomu.')
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, '[Teleport Noob] Komende mozna uzyc tylko na graczu z poziomem nizszym niz 50.')
end
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return true
end