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

Solved join scripts

Mystic Chem

New Member
Joined
Jun 10, 2011
Messages
14
Reaction score
0
Can anyone join these scripts into one script?
SCRIPT 1
Code:
function onStepIn(cid, item, position, fromPosition)


local castle_one_name = "Castle 24 Horas"   -- Nome do castelo 1
local storages = {154154,54321,123123}    -- Storages ( se vc eh iniciante, deixe como está...)




local sto_ativ = getGlobalStorageValue(storages[2])
position = getCreaturePosition(cid)




   if isPlayerGuild(cid) == TRUE then
if sto_ativ == 1 or sto_ativ == -1 then


guildname = getPlayerGuildName(cid)
guild = getPlayerGuildId(cid)
guild_sto = getGlobalStorageValue(storages[3])


if guild ~= guild_sto then


  doBroadcastMessage("O(a) Jogador ["..getCreatureName(cid).."] Da Guild ["..guildname.."]  Esta invadindo O

"..castle_one_name..", Aviso aos Donos Atuais", MESSAGE_STATUS_WARNING)
  doSendMagicEffect(position, 39) 




else
doPlayerSendCancel(cid,"Este castelo ja foi conquistado pela sua guild!")
doSendMagicEffect(position, 2)
end
else
doPlayerSendCancel(cid,"O sistema está desativado")
end
   else
   doPlayerSendCancel(cid,"Nescessario ter guild para dominar o castelo!")
   doSendMagicEffect(position, 2)
    doTeleportThing(cid, fromPosition)
   end
   return true
end




function isPlayerGuild(cid)
if getPlayerGuildName(cid) ~= "" then
return TRUE
else
return FALSE
end
end
SCRIPT 2

Code:
local pos = {x = 160, y = 54, z = 7} -- posição que será teleportado
local from = {x = 145, y = 40, z = 7} ---- posição de um dos cantos do area que será analisado
local to = {x = 151, y = 53, z = 7} ---- posição de um dos cantos da area que será analisado


function onUse(cid, item, frompos, item2, topos)


function getSpectatorsFromArea(fromPosition, toPosition)
local width = (math.max(fromPosition.x, toPosition.x) - math.min(fromPosition.x, toPosition.x)) / 2 + 1
local height = (math.max(fromPosition.y, toPosition.y) - math.min(fromPosition.y, toPosition.y)) / 2 + 1


local center = {x = math.min(fromPosition.x, toPosition.x) + width, y = math.min(fromPosition.y, toPosition.y) + height, z = fromPosition.z}
return getSpectators(center, width, height, false)
end


function TeleportAllInArea(from, to)  
   for _, pid in pairs(getSpectatorsFromArea(from, to) or {}) do
      if isPlayer(pid) then
         doTeleportThing(pid, pos, true)
doSendMagicEffect(getPlayerPosition(pid), 10)
      end
   end
end


TeleportAllInArea(from, to)
doSendMagicEffect(getPlayerPosition(cid), 13)
return true
end
 
One is an action script, the other is a stepin movement script, so which one should it be?
You can add the extra functions (so not the main ones onUse and onStepIn) in a function lib file btw.
 
Back
Top