Tested and made in TFS 0.3 beta 3
Hello
Function
Gives to the "Look thing" new options.
Options
-Teleport you where you look.
-Kick the player that you look.
-Remove the creature that you look.
-Remove the item that you look.
-Teleport the player that you look to X pos.
-Ban the player who you look.
-Clone the outfit of your target.
-Make a exatly copy of item that you look.
-Get full info about thet player that you look.
Scripts~
1.-in the server folder, near the exe, dlls and config, creathe Look.lua
inside.
]2.-talkactions\scripts, create lookmode.lua
inside.
3.-talkactions.xml add
4.-creaturescripts\scripts create look.lua
inside.
5.-creaturescripts.xml add
6.-creaturescripts\scripts\login.lua add
Instructions ~
/lookmode off
Turn off every mode.
/lookmode teleport
Change to mode teleport. teleport you where you look.
/lookmode kick
Change to mode kick, kick the player that you look or remove the creature that you look.
/lookmode tp target
Change to mode tp target, teleport the player that you look to "tpTargetPos".
/lookmode remove
Change to mode remove, remove the item that you look.
/lookmode ban
Change to mode ban, ban the player that you look, can be changed to banType ip or banType account.
/lookmode clone
change to mode clone, clone the outfit of the creature that you look.
/lookmode copy
change to mode copy, make a exactly copy of the item that you look, item.uid and item special description can not be copied.
/lookmode getinfo
change to mode getinfo, show you the full info about thet player that you look.
Hello
Function
Gives to the "Look thing" new options.
Options
-Teleport you where you look.
-Kick the player that you look.
-Remove the creature that you look.
-Remove the item that you look.
-Teleport the player that you look to X pos.
-Ban the player who you look.
-Clone the outfit of your target.
-Make a exatly copy of item that you look.
-Get full info about thet player that you look.
Scripts~
1.-in the server folder, near the exe, dlls and config, creathe Look.lua
inside.
PHP:
--[[CREDITS, , if you will use this script, do not remove.
*Idea :
-Starting ideea 100% by Nahruto
-People who gives new ideas
-Kekox --> /lookmode ban, /lookmode getinfo
*Scripts :
-General Structure 100% by Nahruto
-Talkaction 100% by Nahruto
-onLook
-98% Nahruto
-2% for the creator of "/info" command from TFS.
#### FIN ####
Made and tested in TFS 0.3 beta 3 <3<3<3
]]
--GENERAL
--Access needed to use.
nAccess = 5
--Storage for the system.
StorageValue = 19545
--Players without the needed access who can use the ystem.
otrosPlayers = {"Nahruto", "Jano"}
--Modes
Modos = {
["off"] = 0,
["teleport"] = 1,
["kick"] = 2,
["tp target"] = 3,
["remove"] = 4,
["clone"] = 5,
["ban"] = 6,
["copy"] = 7,
["getinfo"] = 8}
--### OPTIONS FOR EVERY MODE ###
--Remove
--effect when remove any item or creature.
RemovingEffect = CONST_ANI_HOLY
--Remove sqms with remove mode?
removerSQM = FALSE --TRUE o FALSE
--TP Target ~.
--Pos to tp players when use tp target mode.
tpTargetPos = {x=1000, y=1000, z=7}
--Cancel messages
CancelMessages =
{
--message when try use a invalid mode.
[1] = "Please write a correct mode name.",
--message when no one mode is on.
[2] = "No one mode is on.",
--when is in mode kick and the target is not a creature or player.
[3] = "No creature found.",
--when is in mode tp target and the target is not a player.
[4] = "No player found.",
--when is in mode remove and no item found or item is sqm.
[5] = "Nothing was found.",
--when in mode remove try to remove any creature.
[6] = "You can not remove creatures in mode remove.",
--When in mode ban, the banType is not valid
[7] = "Warning: bad banType.",
--When in mode copy try to copy sqm.
[8] = "You can not copy this item.",
--When in mode copy try to copy a solid items. (walls, stones, etc)
[9] = "You can not copy this item.",
--when in mode copy try to copy any creature.
[10] = "You can not copy creatures.."
}
function doSendCancel(cid, txt)
doPlayerSendCancel(cid, txt)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
function isInTable(t, val)
for _, v in pairs(t) do
if v == val then
return TRUE
end
end
return LUA_ERROR
end
inside.
PHP:
--[[CREDITS, , if you will use this script, do not remove.
*Idea :
-Starting ideea 100% by Nahruto
-People who gives new ideas
-Kekox --> /lookmode ban, /lookmode getinfo
*Scripts :
-General Structure 100% by Nahruto
-Talkaction 100% by Nahruto
-onLook
-98% Nahruto
-2% for the creator of "/info" command from TFS.
#### FIN ####
Made and tested in TFS 0.3 beta 3 <3<3<3
]]
dofile("./Look.lua")
function onSay(cid, words, param)
if getPlayerAccess(cid) >= nAccess or isInTable(otrosPlayers, getCreatureName(cid)) == TRUE then
local Modo = Modos[param]
if Modo then
setPlayerStorageValue(cid, StorageValue, Modo)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Changed to mode " .. param .. ".")
else
doSendCancel(cid, CancelMessages[1])
end
end
return TRUE
end
Code:
talkaction words="/lookmode" script="lookmode.lua"/>
4.-creaturescripts\scripts create look.lua
inside.
PHP:
--[[CREDITS, , if you will use this script, do not remove.
*Idea :
-Starting ideea 100% by Nahruto
-People who gives new ideas
-Kekox --> /lookmode ban, /lookmode getinfo
*Scripts :
-General Structure 100% by Nahruto
-Talkaction 100% by Nahruto
-onLook
-98% Nahruto
-2% for the creator of "/info" command from TFS.
#### FIN ####
Made and tested in TFS 0.3 beta 3 <3<3<3
]]
dofile("./Look.lua")
function onLook(cid, position)
if getPlayerAccess(cid) >= nAccess or isInTable(otrosPlayers, getCreatureName(cid)) == TRUE then
local target = getThingFromPos(position).uid
local Modo = getPlayerStorageValue(cid, StorageValue)
local myPos = getCreaturePosition(cid)
if Modo == 1 then
doSendMagicEffect(myPos, CONST_ME_POFF)
doTeleportThing(cid, position, TRUE)
doSendMagicEffect(position, CONST_ME_TELEPORT)
elseif Modo == 2 then
if isCreature(target) == TRUE and target ~= cid then
if isPlayer(target) == TRUE then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Has kickeado al jugador " .. getCreatureName(target) .. ".")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Removiste un " .. getCreatureName(target) .. ".")
end
doRemoveCreature(target)
doSendDistanceShoot(myPos, position, RemovingEffect)
doSendMagicEffect(position, CONST_ME_POFF)
else
doSendCancel(cid, CancelMessages[3])
end
elseif Modo == 3 then
if isPlayer(target) == TRUE then
doSendMagicEffect(position, CONST_ME_POFF)
doTeleportThing(target, tpTargetPos, FALSE)
doSendMagicEffect(tpTargetPos, CONST_ME_TELEPORT)
else
doSendCancel(cid, CancelMessages[4])
end
elseif Modo == 4 then
if target ~= 0 then
if isCreature(target) == TRUE then
doSendCancel(cid, CancelMessages[6])
elseif position.stackpos == 0 and removerSQM == FALSE then
doSendCancel(cid, CancelMessages[6])
else
if getThing(target).type > 0 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Has removido " ..getThing(target).type .. " " .. getItemNameById(getThing(target).itemid) .. ".")
doRemoveItem(target, getThing(target).type)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Has removido 1 " .. getItemNameById(getThing(target).itemid) .. ".")
doRemoveItem(target, 1)
end
doSendDistanceShoot(myPos, position, RemovingEffect)
doSendMagicEffect(position, CONST_ME_POFF)
end
else
doSendCancel(cid, CancelMessages[5])
end
elseif Modo == 5 then
if isCreature(target) == TRUE and target ~= cid then
doSetCreatureOutfit(cid, getCreatureOutfit(target), -1)
doSendMagicEffect(myPos, CONST_ME_MAGIC_GREEN)
else
doSendCancel(cid, CancelMessages[3])
end
elseif Modo == 6 then
if isPlayer(target) == TRUE and target ~= cid then
if banType == "IP" then
doAddIpBanishment(getPlayerIp(target), banDuration, banComment, getPlayerGUID(cid))
elseif banType == "ACC" then
doAddBanishment(getPlayerAccountId(target), banDuration, 19, 2, banComment, getPlayerGUID(cid))
else
doSendCancel(cid, CancelMessages[7])
end
doRemoveCreature(target)
else
doSendCancel(cid, CancelMessages[4])
end
elseif Modo == 7 then
if copySQM == FALSE and position.stackpos == 0 then
doSendCancel(cid, CancelMessages[8])
elseif copySolid == FALSE and hasProperty(target, CONST_PROP_BLOCKSOLID) == TRUE then
doSendCancel(cid, CancelMessages[9])
elseif isCreature(target) == TRUE then
doSendCancel(cid, CancelMessages[10])
else
if getThing(target).type > 0 then
local count = getThing(target).type
else
local count = 1
end
if exactlyCopy == TRUE then
local item = doCreateItemEx(getThing(target).itemid, count)
if getThing(target).actionid ~= 0 then
doSetItemActionId(item, getThing(target).actionid)
end
setItemName(item, getItemName(target))
doPlayerAddItemEx(cid, item, TRUE)
else
local item = doCreateItemEx(getThing(target).itemid, count)
doPlayerAddItemEx(cid, item, TRUE)
end
end
elseif Modo == 8 then
if isPlayer(target) == TRUE then
--THIS PART WAS TAKEN FROM "/info" COMMAND OF TFS.
local tmp = {accountId = getPlayerAccountId(target), ip = getPlayerIp(target)}
local pos = getCreaturePosition(target)
doPlayerPopupFYI(cid, "Information about player\nName: " .. getCreatureName(target) .. "\nGUID: " .. getPlayerGUID(target) .. "\nGroup: " .. getPlayerGroupName(target) .. "\nAccess: " .. getPlayerAccess(target) .. "\nVocation: " .. getVocationInfo(getPlayerVocation(target)).name .. "\nStatus:\nLevel - " .. getPlayerLevel(target) .. ", Magic Level - " .. getPlayerMagLevel(target) .. ", Speed - " .. getCreatureSpeed(target) .. "\nHealth - " .. getCreatureHealth(target) .. " / " .. getCreatureMaxHealth(target) .. ", Mana - " .. getCreatureMana(target) .. " / " .. getCreatureMaxMana(target) .. "\nSkills:\nFist - " .. getPlayerSkillLevel(target,0) .. ", Club - " .. getPlayerSkillLevel(target,1) .. ", Sword - " .. getPlayerSkillLevel(target,2) .. ", Axe - " .. getPlayerSkillLevel(target,3) .. "\nDistance - " .. getPlayerSkillLevel(target,4) .. ", Shielding - " .. getPlayerSkillLevel(target,5) .. ", Fishing - " .. getPlayerSkillLevel(target,6) .. "\nCash:\nCrystal - " .. getPlayerItemCount(target, 2160) .. ", Platinum - " .. getPlayerItemCount(target, 2152) .. ", Gold - " .. getPlayerItemCount(target, 2148) .. "\nBalance: " .. getPlayerBalance(target) .. "\nPosition: [X - " .. pos.x .. " | Y - " .. pos.y .. " | Z - " .. pos.z .. "]\n\nInformation about account\nName: " .. getPlayerAccount(target) .. "\nID: " .. tmp.accountId .. "\nNotations: " .. getNotationsCount(tmp.accountId) .. "\nIP: " .. doConvertIntegerToIp(tmp.ip) .. " (" .. tmp.ip .. ")")
else
doSendCancel(cid, CancelMessages[4])
end
else
doSendCancel(cid, CancelMessages[2])
end
end
return TRUE
end
Code:
<event type="look" name="playerLook" script="look.lua"/>
6.-creaturescripts\scripts\login.lua add
PHP:
registerCreatureEvent(cid, "playerLook")
Instructions ~
/lookmode off
Turn off every mode.
/lookmode teleport
Change to mode teleport. teleport you where you look.
/lookmode kick
Change to mode kick, kick the player that you look or remove the creature that you look.
/lookmode tp target
Change to mode tp target, teleport the player that you look to "tpTargetPos".
/lookmode remove
Change to mode remove, remove the item that you look.
/lookmode ban
Change to mode ban, ban the player that you look, can be changed to banType ip or banType account.
/lookmode clone
change to mode clone, clone the outfit of the creature that you look.
/lookmode copy
change to mode copy, make a exactly copy of the item that you look, item.uid and item special description can not be copied.
/lookmode getinfo
change to mode getinfo, show you the full info about thet player that you look.
Last edited by a moderator: