Comando !cp teleportar após 10 segundos. Como fazer?

arkanctrus
em Scripts

arkanctrus

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 19/11/15Posts: 8

Olá, é possível criar um comando !cp que após o player digitar isso ele seja teleportado para sua town city (seu cp) porém mostrando 10, 9, 8, .. 3,2,1 e aí sim ocorrer o teleport?

Em outras palavras, adicionar um delay mostrando no default o tempo para ser teleportado...

Seria genial para mim;


Utilizei o mesmo /t que o god tem porem coloquei acess: 0 para os players tb usarem... Só que assim se o player tiver morrendo fica facil correr, facilitando demais.

Então pretendo dar um delay no teleport !cp ou só deixar usar quando tiver sem PZ .. pode ser um script assim porem que só funcione sem battle

zipter98

avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 20/09/12Posts: 2553Gênero: Masculino

data/talkactions/scripts

local teleport_time, exhaust = 10, 20               --Respectivamente, tempo para teleportar e cooldown.
 
function channel_teleport(cid, time)
    if not isPlayer(cid) then
        return true
    elseif getCreatureCondition(cid, CONDITION_INFIGHT) then
        doPlayerSendCancel(cid, "You can't teleport while in battle.")
        return true
    elseif time <= 0 then
        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
        setPlayerStorageValue(cid, 2910, os.time() + exhaust * 60)
        return true
    end
    
    doPlayerSendTextMessage(cid, 27, time)
    addEvent(channel_teleport, 1000, cid, time - 1)
end
 
function onSay(cid)
    if getPlayerStorageValue(cid, 2910) > os.time() then
        doPlayerSendCancel(cid, "This command is still in cooldown. Wait "..(getPlayerStorageValue(cid, 2910) - os.time()).." seconds to use it again.")
        return true
    elseif getCreatureCondition(cid, CONDITION_INFIGHT) then
        doPlayerSendCancel(cid, "You can't use this command in battle.")
        return true
    end
    
    channel_teleport(cid, teleport_time)
    return true
end
Tag:
<talkaction words="!cp" event="script" value="nome_do_arquivo.lua"/>

 

Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.

Nickbhz

avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 04/01/14Posts: 320

@@zipter98

 

Teria como em vez de aparecer so os segundos, aparecer uma mensagem, tipo essa:

 

07:42 {Teleport} Ativado.
07:42 {Teleport} 5 segundos para se teletransportar.
07:42 {Teleport} 4 segundos para se teletransportar.
07:42 {Teleport} 3 segundos para se teletransportar.
07:42 {Teleport} 2 segundos para se teletransportar.
07:42 {Teleport} 1 segundo para se teletransportar.
Se nao tiver, tranquilo. Otimo script. Parabéns!!!

arkanctrus

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 19/11/15Posts: 8

Sensacional Zipter 98!

Eskylo

boa sorte
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 11/08/10Posts: 477Gênero: Masculino

 

@@zipter98

 

Teria como em vez de aparecer so os segundos, aparecer uma mensagem, tipo essa:

 

07:42 {Teleport} Ativado.
07:42 {Teleport} 5 segundos para se teletransportar.
07:42 {Teleport} 4 segundos para se teletransportar.
07:42 {Teleport} 3 segundos para se teletransportar.
07:42 {Teleport} 2 segundos para se teletransportar.
07:42 {Teleport} 1 segundo para se teletransportar.
Se nao tiver, tranquilo. Otimo script. Parabéns!!!

 

doPlayerSendTextMessage(cid, 27, time)

para

doPlayerSendTextMessage(cid, 27, "{Teleport} "..time.." segundos para teletransportar.")

Atenciosamente, Eskylo

 

 

Ironman-icon.png

.

.

RodriigoRobson

avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 19/12/12Posts: 465

Voce ta querendo impedir que os Players abusam do Comando?

- Isso ae nao vai adiantar e so esperar um "x" Tempo o player pode estar em qualquer lugar e vai sempre abusar do Comando

- Oque voce deveria fazer e Colocar: Tempo + Limite de Uso do Comando

- A mais pq colocar um Limite?

- Para nao abusarem do Comando e caso Atinge o Limite de Uso Voce pode puxar o Player ou Colocar um Sistema (Globalevent) de Zerar o Limite 1x por Dia

- Eu odeio esse Comando pq muitas Pessoas Aproveita disso e para Nao abusarem eu Fiz isso

- Ta ae o Script do Comando:

 

local pos = {x=1051, y=1049, z=7} ------ Posiçao do Templo
local LimiteSto = 15569 ------ Storage Nao Mexa
local Quantia = 10 ------ Quantas vezes Pode Usar o Comando


function onSay(cid, words, param)

local tempo = 1
if getPlayerStorageValue(cid, 10333) > os.time() then
return doPlayerSendTextMessage(cid,19, "[bUG-TELEPORT] Aguarde "..getPlayerStorageValue(cid, 10333) - os.time().." Para usar o Comando Novamente!.")
end
if getPlayerStorageValue(cid, LimiteSto) >= Quantia then
doPlayerSendTextMessage((cid), 27, "[LIMITE] Voce ja Chegou no Limite ["..(getPlayerStorageValue((cid),LimiteSto) + 1).."/"..getPlayerStorageValue(cid,Quantia).."] Caso Esteja Preso Use [HELP/REPORT].")
return true
end

if getPlayerStorageValue(cid, 98797) >= 1 or getPlayerStorageValue(cid, 98796) >= 1 or getPlayerStorageValue(cid, 132132) >= 1 or getPlayerStorageValue(cid, 130130) >= 1 or getPlayerStorageValue(cid, 6598755) >= 1 or getPlayerStorageValue(cid, 6598754) >= 1 then
doPlayerSendTextMessage(cid, 22, "[bUG-TELEPORT] Nao Pode Usar o Comando Durante o [Duel 1x1/PVP Team/BattleField/Torneio/Saffari].")
doPlayerSendTextMessage(cid, 27, "[bUG-TELEPORT] Nao Pode Usar o Comando Durante o [Duel 1x1/PVP Team/BattleField/Torneio/Saffari].")
else
setPlayerStorageValue(cid, 10333, os.time() + tempo * 1200) ----- 600
setPlayerStorageValue(cid,LimiteSto,getPlayerStorageValue(cid,LimiteSto)+1)
doTeleportThing(cid,pos)
doSendMagicEffect(getPlayerPosition(cid),29)
doSendAnimatedText(getCreaturePosition(cid),"TELEPORT",math.random(1,255))
doPlayerSendTextMessage(cid,27,"[TELEPORT-BUG LIMITE] AVISO!! Quantas Vezes eu Posso Usar o Comando: ["..(getPlayerStorageValue(cid,LimiteSto) + 1).."/"..getPlayerStorageValue(cid,Quantia).."]")
return true
end
end

 

29475_4.png

FlamesAdmin

avatar
Infante
Infante

INFOS

Grupo: InfanteRegistrado: 28/01/12Posts: 1550Gênero: Masculino

Comando do zipter só tem um probleminha, quando usa o comando e começa a contagem para ser teleportado, você pode usar várias vezes enquanto ocorre a contagem.

[Show off] Mapping Pokémon (OLD)

[PDA] Pokeball Icon System

 

 

[Mapping] Mapinha Johto = Para conferir, clique Aqui
[Mapping] Outland RockPara conferir, clique Aqui
[Mapping] Centro Pokémon de Cinnabar e cidade de Hamlin(PxG) Para conferir, clique Aqui
[Mapping] Antigo Trade Center(PvP) do PxG Para conferir, clique Aqui
[PDA] Reformulação do level das magias e level dos Pokemons Para conferir, clique Aqui
[PDA] Comando de Clan sem task = Para conferir, clique Aqui
[Utilitário] OT Restarter by: Gabrielbsales(Featzen) Para conferir, clique Aqui
[Database] Descriptografia MD5 & SHA1 = Para conferir, clique Aqui
[Scripting] Level Máximo = Para conferir, clique Aqui

 

Eskylo

boa sorte
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 11/08/10Posts: 477Gênero: Masculino

Comando do zipter só tem um probleminha, quando usa o comando e começa a contagem para ser teleportado, você pode usar várias vezes enquanto ocorre a contagem.

 

bem observado, fiz algumas alterações e corrigi isso

local teleport_time, exhaust = 10, 20               --Respectivamente, tempo para teleportar e cooldown.
 
function channel_teleport(cid, time)

	

    if not isPlayer(cid) then
        return true
    elseif getCreatureCondition(cid, CONDITION_INFIGHT) then
        doPlayerSendCancel(cid, "You can't teleport while in battle.")
		setPlayerStorageValue(cid, 2911, -1)
        return true
    elseif time <= 0 then
        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
        setPlayerStorageValue(cid, 2910, os.time() + exhaust * 60)
        return true
    end
    
    doPlayerSendTextMessage(cid, 27, time)
    addEvent(channel_teleport, 1000, cid, time - 1)
end
 
function onSay(cid)

	

    if getPlayerStorageValue(cid, 2910) > os.time() then
        doPlayerSendCancel(cid, "This command is still in cooldown. Wait "..(getPlayerStorageValue(cid, 2910) - os.time()).." seconds to use it again.")
        return true
    elseif getCreatureCondition(cid, CONDITION_INFIGHT) then
        doPlayerSendCancel(cid, "You can't use this command in battle.")
        return true
    end
	
	if getPlayerStorageValue(cid, 2911) > os.time() then
		return false
	else
		setPlayerStorageValue(cid, 2911, os.time()+teleport_time)
	end
    
    channel_teleport(cid, teleport_time)
    return true
end

Atenciosamente, Eskylo

 

 

Ironman-icon.png

.

.