JA
pedido

Teleport pelo Channel

Por Jake1, 13 de jun. de 2013 em Scripts

5
1.2k
Jake1J
13 de junho de 2013 às 18:00

Em Data---Xml---Channels tem isso

 

<?xml version="1.0" encoding="UTF-8"?>

<channels>

<!-- README:

0 - dynamic, reserved for guilds

1 - always acts as Party channel, only "name" tag available

3 - always acts as Rule Violations channel

9 - acts as Help channel- clientsided message

65535 - DO NOT CHANGE THE ID- only "name", "enabled", "active" and "logged" tags available

-->

<channel id="1" name="Party"/>

<channel id="2" name="Staff" access="3"/>

<channel id="3" name="Rule Violations" logged="yes"/>

<channel id="4" name="Counselor" access="1"/>

<channel id="5" name="Event" logged="yes"/>

<channel id="6" name="Trade" level="8" muted="120" conditionId="2" conditionMessage="You may only place one offer in two minutes.">

<vocation id="1-2"/>

</channel>

<channel id="7" name="Trade-Rookgaard" level="2" muted="120" conditionId="3" conditionMessage="You may only place one offer in two minutes.">

<vocation id="0"/>

</channel>

<channel id="8" name="RL-Chat" level="2"/>

<channel id="9" name="Help" logged="yes"/>

<!-- <channel id="10" name="My Custom Channel"/> -->

<channel id="65535" name="Private Chat Channel"/>

</channels>

 

Tem como fazer para que quando alguém clica ali no lugar de abrir o channel, teleport para esse local?

y=1987 x=354 z=7

????

 

Vodkart,

Skymagnun,

Roksas.

 

Alguém me ajuda.

Darei muitos Rep+

SkymagnumS
13 de junho de 2013 às 18:07

/data/creaturescripts/scripts/nome:

function onJoinChannel(cid, channel, users)

local toPosition = {x = 1, y = 2, z = 3}

   if(channel == 5) then
       if(not getTileInfo(getThingPos(cid)).protection) then
           return doPlayerSendCancel(cid, "Só pode usar em protection zone.")
       elseif(getCreatureCondition(cid, CONDITION_INFIGHT)) then
           return doPlayerSendCancel(cid, "Só pode usar se não estiver com battle.")
       end
       doTeleportThing(cid, toPosition)
   end

   return true
end

 

creaturescripts.xml

<event type="joinchannel" name="eventJoin" event="script" value="nome.lua"/>

 

login.lua:

registerCreatureEvent(cid, "eventJoin")

 

Nunca usei essa função, então não te garanto que funcione.

Jake1J
13 de junho de 2013 às 20:45

Blz vo testa

 

a script fucionor perfeitamente como sempre mais....

tem como fazer pro channel não abrir ou então quando desloga ou morre ele fecha?

pq ele continuar aberto quando desloga ou morre.

 

não deixa eu tive outra ideia.

Vlw

 

Pode fecha o topic

 

Manda mensagem que te do outro Rep+

Editado Junho 13 por Jake1

SlicerS
13 de junho de 2013 às 20:48

para nao abrir o channel la embaixo eh soh por return false...

function onJoinChannel(cid, channel, users)

local toPosition = {x = 1, y = 2, z = 3}

   if(channel == 5) then
    if(not getTileInfo(getThingPos(cid)).protection) then
	    return doPlayerSendCancel(cid, "Só pode usar em protection zone.")
    elseif(getCreatureCondition(cid, CONDITION_INFIGHT)) then
	    return doPlayerSendCancel(cid, "Só pode usar se não estiver com battle.")
    end
    doTeleportThing(cid, toPosition)
    return false
   end

   return true
end

EnselfE
13 de junho de 2013 às 20:48

Pedido Atendido / Reportado Para Moverem.