Ir para conteúdo

Featured Replies

Postado

Oi este meu primeiro pedido , simples gostaria apenas de um script que deslg o player apos X tempo em uma tile , n precisa rsponder n precisa fazer nada apenas kick ele apos x tempo com batle ou sem SIMPLES obg aguardo Respostas

Resolvido por wandersonnc

Ir para solução
  • Respostas 10
  • Visualizações 640
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • idletile.lua (data/creaturescripts/scripts): function onThink(cid, interval)     local kicktime = 10     local tileactionid = 54321     local idletime = getPlayerIdleTime(cid) + interval          if

Postado

idletile.lua (data/creaturescripts/scripts):

function onThink(cid, interval)
    local kicktime = 10
    local tileactionid = 54321
    local idletime = getPlayerIdleTime(cid) + interval
    
    if getTileThingByPos(getCreaturePosition(cid)).actionid == tileactionid then
        if getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_ALLOWIDLE) then return true end
        doPlayerSetIdleTime(cid, idletime)
        if idletime > kicktime * 60 * 1000 then
            doRemoveCreature(cid)
        end
    end

    return true
end




Tag - creaturescripts.xml (data/creaturescripts):

<event type="think" name="IdleTile" event="script" value="idletile.lua"/>



Registre o creature event em login.lua (data/creaturescripts/scripts):

registerCreatureEvent(cid, "IdleTile")


Adicione o action ID (declarado na variável local tileactionid do script, que como exemplo foi 54321) ao tile que você deseja.

The corrupt fear us.

The honest support us.

The heroic join us.

Postado
  • Autor

desde ja vou dar o rep+ pela tentativa , porem vou testar e dou a resposta obg. =D


  Em 25/12/2014 em 22:49, Suicide disse:

idletile.lua (data/creaturescripts/scripts):

function onThink(cid, interval)
    local kicktime = 10
    local tileactionid = 54321
    local idletime = getPlayerIdleTime(cid) + interval
    
    if getTileThingByPos(getCreaturePosition(cid)).actionid == tileactionid then
        if getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_ALLOWIDLE) then return true end
        doPlayerSetIdleTime(cid, idletime)
        if idletime > kicktime * 60 * 1000 then
            doRemoveCreature(cid)
        end
    end

    return true
end



Tag - creaturescripts.xml (data/creaturescripts):

<event type="think" name="IdleTile" event="script" value="idletile.lua"/>


Registre o creature event em login.lua (data/creaturescripts/scripts):

registerCreatureEvent(cid, "IdleTile")

Adicione o action ID (declarado na variável local tileactionid do script, que como exemplo foi 54321) ao tile que você deseja.

CARA OTIMO SCRIPT MAIS N FUNFO , PRECISO APENAS DE UM SCRIPT Q AO PISAR EM X TILE ESTANDO LA COM BATLE OU N APOS 1 MIN E KIKADO SO ISSO , TENTEI ESTE E N DEU CERTO , TEM Q KIKAR ELE MESMO Q ESTEJA COM BATLE

Editado por wandersonnc (veja o histórico de edições)

Postado

movement

kick_time = 60 -- tempo que precisa ficar no tile para ser deslogado


function kick_time_by_pos(cid, ml, kicktime, postile)
	if not isCreature(cid) then return true end
	if ml == kicktime then
		return doRemoveCreature(cid)
	end
	if getThingPos(cid).x ~= postile.x or getThingPos(cid).y ~= postile.y or getThingPos(cid).z ~= postile.z then
		return true
	end
	addEvent(kick_time_by_pos, 1, cid, ml+1, kicktime, postile)
end

function function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	return kick_time_by_pos(cid, 0, kick_time * 10000, position)
end
<movevent type="StepIn" actionid="" event="script" value=".lua"/>

whatsapp-4in.png (18) 98134-9991

 

icon-skype.png miillerdomingues@hotmail.com

 

Postado
  • Autor
  Em 29/12/2014 em 02:23, Gantz disse:

 

movement

kick_time = 60 -- tempo que precisa ficar no tile para ser deslogado


function kick_time_by_pos(cid, ml, kicktime, postile)
	if not isCreature(cid) then return true end
	if ml == kicktime then
		return doRemoveCreature(cid)
	end
	if getThingPos(cid).x ~= postile.x or getThingPos(cid).y ~= postile.y or getThingPos(cid).z ~= postile.z then
		return true
	end
	addEvent(kick_time_by_pos, 1, cid, ml+1, kicktime, postile)
end

function function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	return kick_time_by_pos(cid, 0, kick_time * 10000, position)
end
<movevent type="StepIn" actionid="" event="script" value=".lua"/>

Me explica um pouco a mais do script tipo onde fica o id q vou por na tile , e este 60 representa 1 min ?

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo