• 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!

!tp character >.<

bolero

MikeHere
Joined
Apr 13, 2009
Messages
1,146
Reaction score
12
Location
Venezuela
I need the command !tp character, when one player 40+ see one player -40 lvl and he say !tp character, this lvl -40 could be teleported to temple 1 and remove to the first player 40+ 30 soul points for tp this noob to temple and when 40+ execute this comand have 5minutes of exausted... ^_^
 
talkactions.xml
Code:
	<talkaction words="!tp" event="script" value="tp.lua"/>

tp.lua

LUA:
function onSay(cid, words, param, channel)

	local minLevelToTeleportPlayers = 40
	local maxLevelOfNoobToTeleport = 39
	local townID = getPlayerTown(cid)
	local temple = getTownTemplePosition(townID)

	local pid = 0
	if(param == '') then
		pid = getCreatureTarget(cid)
		if(pid == 0) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You need to pick someone to teleport.")
			return true
		end
	else
		pid = getPlayerByNameWildcard(param)
	end

	if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Player " .. param .. " is not currently online.")
		return true
	end

	if(isPlayer(pid) and getPlayerLevel(cid) < minLevelToTeleportPlayers) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You cannot send people to temple until at least level " .. minLevelToTeleportPlayers .. ".")
		return true
	end

	if(isPlayer(pid) and getPlayerLevel(pid) > maxLevelOfNoobToTeleport) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You cannot teleport this player.")
		return true
	end

	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getCreatureName(pid) .. " has been teleported.")
	doTeleportThing(pid, temple)
	db.executeQuery("UPDATE players SET soul = soul - 30 WHERE id = "..getPlayerGUID(cid)..";")
	return true
end
 
LUA:
<talkaction log="no" words="!tpnoob" access="0" event="script" value="tpnoob.lua"/>

tpnoob.lua
LUA:
local config = {
        exhaustionInSeconds = 420,
        storage = 36531
}
function onSay(cid, words, param)
local player = getPlayerByName(param)
if(isPlayer(player) == TRUE) then
if(exhaustion.check(cid, config.storage) == TRUE) then
                doPlayerSendCancel(cid, "You can teleport players only 1 time per " .. config.exhaustionInSeconds .. " seconds.")
                return TRUE
        end
 if (getPlayerLevel(cid) > 50) then
  if (getPlayerLevel(player) <= 50) then
   if(doPlayerAddSoul(cid, -100) == TRUE) then
    exhaustion.set(cid, config.storage, config.exhaustionInSeconds)
    doTeleportThing(player, getTownTemplePosition(getPlayerTown(player)))
   else
    doPlayerSendCancel(cid,"You dont have 100 soul points.")
   end
  else
   doPlayerSendCancel(cid,"This player have lvl higher than 50.")
  end
 else
  doPlayerSendCancel(cid,"Your level is too low.")
 end
else
 doPlayerSendCancel(cid,"this players doesn exist, or is offline.")
end
return TRUE
end
 
Back
Top