Ir para conteúdo

Ajuda Aki Galera!


atakashi

Posts Recomendados

galera meu ot tem uma parada aki q o player pode usar comando e meio esquisito,

eu qeria por um exausted de uns 180 segundos pa usa o comando denovo, será que tem como voces ve isso pra mim?

 

os comandos ai, e akeles simples: /c , /goto , /m

 

 

/goto>

 

 

function onSay(cid, words, param, channel)

if(param == '') then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")

return true

end

 

local creature = getCreatureByName(param)

local player = getPlayerByNameWildcard(param)

local waypoint = getWaypointPosition(param)

local tile = string.explode(param, ",")

local pos = {x = 0, y = 0, z = 0}

 

if(player ~= nil and (not isPlayerGhost(player) or getPlayerGhostAccess(player) <= getPlayerGhostAccess(cid))) then

pos = getCreaturePosition(player)

elseif(creature ~= nil and (not isPlayer(creature) or (not isPlayerGhost(creature) or getPlayerGhostAccess(creature) <= getPlayerGhostAccess(cid)))) then

pos = getCreaturePosition(creature)

elseif(type(waypoint) == 'table' and waypoint.x ~= 0 and waypoint.y ~= 0) then

pos = waypoint

elseif(tile[2] and tile[3]) then

pos = {x = tile[1], y = tile[2], z = tile[3]}

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")

return true

end

 

if(not pos or isInArray({pos.x, pos.y}, 0)) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Destination not reachable.")

return true

end

 

pos = getClosestFreeTile(cid, pos, true, false)

if(not pos or isInArray({pos.x, pos.y}, 0)) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cannot perform action.")

return true

end

 

local tmp = getCreaturePosition(cid)

if(doTeleportThing(cid, pos, true) and not isPlayerGhost(cid)) then

doSendMagicEffect(tmp, CONST_ME_POFF)

doSendMagicEffect(pos, CONST_ME_TELEPORT)

end

 

return true

end

 

 

 

 

 

 

 

 

/c>

 

 

 

 

function onSay(cid, words, param, channel)

if(param == '') then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")

return true

end

 

local target = getPlayerByNameWildcard(param)

if(not target) then

target = getCreatureByName(param)

if(not target) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Creature not found.")

return true

end

end

 

if(isPlayerGhost(target) and getPlayerGhostAccess(target) > getPlayerGhostAccess(cid)) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Creature not found.")

return true

end

 

local pos = getClosestFreeTile(target, getCreaturePosition(cid), false, false)

if(not pos or isInArray({pos.x, pos.y}, 0)) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cannot perform action.")

return true

end

 

local tmp = getCreaturePosition(target)

if(doTeleportThing(target, pos, true) and not isPlayerGhost(target)) then

doSendMagicEffect(tmp, CONST_ME_POFF)

doSendMagicEffect(pos, CONST_ME_TELEPORT)

end

 

return true

end

 

 

 

 

 

 

 

/m>

 

 

 

 

 

function onSay(cid, words, param, channel)

local func = doCreateMonster

if(words:sub(2, 2) == "n") then

func = doCreateNpc

end

 

local pid = cid

local t = string.explode(param, ",")

if(t[2]) then

pid = getPlayerByNameWildcard(t[2])

if(not pid) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[2] .. " not found.")

return true

end

end

 

local position = getCreaturePosition(pid)

local effect = CONST_ME_MAGIC_RED

local ret = func(t[1], position, false)

if(tonumber(ret) == nil) then

effect = CONST_ME_POFF

doPlayerSendDefaultCancel(cid, (ret == false and RETURNVALUE_NOTPOSSIBLE or RETURNVALUE_NOTENOUGHROOM))

end

 

doSendMagicEffect(position, effect)

return true

end

 

Link para o comentário
Compartilhar em outros sites

ta ae(n testado)

 

/goto

 

function onSay(cid, words, param, channel)
if exhaustion.check(cid, 23015) == false then
		    exhaustion.set(cid, 23015, 180)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
return true
end

local creature = getCreatureByName(param)
local player = getPlayerByNameWildcard(param)
local waypoint = getWaypointPosition(param)
local tile = string.explode(param, ",")
local pos = {x = 0, y = 0, z = 0}

if(player ~= nil and (not isPlayerGhost(player) or getPlayerGhostAccess(player) <= getPlayerGhostAccess(cid))) then
pos = getCreaturePosition(player)
elseif(creature ~= nil and (not isPlayer(creature) or (not isPlayerGhost(creature) or getPlayerGhostAccess(creature) <= getPlayerGhostAccess(cid)))) then
pos = getCreaturePosition(creature)
elseif(type(waypoint) == 'table' and waypoint.x ~= 0 and waypoint.y ~= 0) then
pos = waypoint
elseif(tile[2] and tile[3]) then
pos = {x = tile[1], y = tile[2], z = tile[3]}
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")
return true
end

if(not pos or isInArray({pos.x, pos.y}, 0)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Destination not reachable.")
return true
end

pos = getClosestFreeTile(cid, pos, true, false)
if(not pos or isInArray({pos.x, pos.y}, 0)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cannot perform action.")
return true
end

local tmp = getCreaturePosition(cid)
if(doTeleportThing(cid, pos, true) and not isPlayerGhost(cid)) then
doSendMagicEffect(tmp, CONST_ME_POFF)
doSendMagicEffect(pos, CONST_ME_TELEPORT)
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "espere"..exhaustion.check(cid, 23015).."para usar denovo")
end
return true
end

 

depois posto os outros to sem tempo agora

cara os player pode puxas os outros,os bixo ,os npc... zuado isso kkkk

obs: so falta os player do seu ot pode usa usa /i , /attr , /ban , /storage kkkkkkkkkkkkkkkkkkkkkkkk

Link para o comentário
Compartilhar em outros sites

kkkk , zoa nao :)

vo testa aki e ja edito.

 

se liga só , a primeira pego o /goto , so que depois quando vo usa denovo naum funfa , axo q e por causa do tempo q tem q espera , mais não ta avisando que falta tempo ... i ta dando um erro no server quando tenta usa denovo.

 

 

 

if exhaustion.check(cid, 23015) == false (< trokei pra true ) then

 

 

i paro de dar erro , so que não tem que esperar o tempo de exausted do comando.

Editado por atakashi
Link para o comentário
Compartilhar em outros sites

  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...