• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction Temple Position

Idiot

New Member
Joined
Oct 4, 2008
Messages
87
Reaction score
0
Location
Sweden
Yo, this is a script that is made by KuGaSh1rA:)!!
Only for TFS 0.3.4

1.Create a file in talkactions\scripts and name it temple.lua
Lua:
local templePos = {x = 1000, y = 1000, z = 7}
 
function onSay(cid, words, param, channel)
    if param == nil then
        doWarnPlayer(cid, 'Command requires a param.')
        return TRUE
    end
 
    local target = nil
 
    if isPlayer(getPlayerByName(param)) then
        local target = getPlayerByName(param)
    else
        doWarnPlayer(cid, 'The target you specified is either a creature or an NPC or is not logged.')
        return TRUE
    end
 
    if getPlayerGroup(cid) >= 3 then
        local tmp = getPlayerPosition(target)
        if(target ~= nil and doTeleportThing(target, templePos)) then
            doSendMagicEffect(tmp, CONST_ME_POFF)
            doSendMagicEffect(templePos, CONST_ME_TELEPORT)
            doPlayerSendTextMessage(cid, 'description', 'You have sent "'..param..'" to temple.')
            doPlayerSendTextMessage(target, 'description', 'You have been teleported to temple.')
        else
            warnPlayer(cid, 'Could not teleport player "'..param..'" to temple.')
        end
    else
        doWarnPlayer(cid, 'You may not execute this command.')
        return TRUE
    end
 
    return TRUE
end
 
function doWarnPlayer(cid, message)
    doPlayerSendCancel(cid, message)
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
2.Open talkactions\talkactions.xml and add this:
PHP:
<talkaction log="yes" access="4" words="/temple" event="script" value="templelua"/>
A big thanks to KuGaSh1rA:)
 
Last edited by a moderator:
lol
change this:
Code:
local templePos = {x = 1000, y = 1000, z = 7}
for
Code:
local templePos = getTownTemplePosition(getPlayerTown(target))
 
tfs already have this. The command is called /t.. :S but thanks anyway!
 
Back
Top