Jump to content

Anti spam de comando


Lalalu

Recommended Posts

Hola qué tal, paso por acá para ver si me pueden ayudar con algo por favor.. como hago para:

Ponerle este anti spam de comando de este script:

local tiempo = {}
addCommandHandler("miaumiau", function(l_3_0)
  if not tiempo[l_3_0] then tiempo[l_3_0] = 0 end
  if getTickCount() - tiempo[l_3_0] > 10000 then
    outputChatBox("Jutsu Proteccion", l_3_0, 0, 255, 0, false)
    tiempo[l_3_0] = getTickCount()
    local x, y, z = getElementPosition(l_3_0)
    do
      setTimer(function()
		
        objeto = createObject(1248, x + 0, y + 0, z, 0, 0, 0)
        setTimer(destroyElement, 6500, 1, objeto)
        triggerClientEvent("CreateNinjaSound",root,l_3_0,"poof.mp3")
		setElementRotation(objeto,x,y,z,"default",true)
       
        setTimer(destroyElement, 6500, 1, objeto)
         end, 300, 1)
      setPedAnimation(l_3_0, "CARRY", "liftup", -1, true, false, false)
      setTimer(function()
        setPedAnimation(l_3_0)
         end, 1000, 1)
    end
  else
   return outputChatBox ( "Espera 10 segundos para volver a utilizar este jutsu!", l_3_0, 225, 0, 0 )
  end
end
)

addEventHandler("onPlayerQuit", root,
  	function ()
    	if tiempo[l_3_0] then
      		tiempo[l_3_0] = nil
     	end
   	end
)

A este script:

local Fs = {}
local flyerPlayersTimer = {}

 function AnimationNula(P,T)
setTimer(setPedAnimation,T,1,P,nil)
end

function CreateObjectNinja(Ob,x,y,z,T)
object = createObject(Ob,x,y,z)
setElementCollisionsEnabled(object,false)
setTimer(destroyElement,T,1,object)
return object
end

Fs.Katon = function (player,k,ks)
setPedAnimation(player,"BAR","dnk_stndM_loop")
local x,y,z = getElementPosition(player)
local r = getPedRotation(player)
triggerClientEvent("CreateNinjaSound",root,player,"Katon.mp3")
AnimationNula(player,2500)
local ob = CreateObjectNinja(2024,x+math.sin(math.rad(-r))*(0.15),y+math.cos(math.rad(-r))*(0.15),z+0.35,1500)
setElementRotation(ob,0,0,r)
local EsferaColisao = createColSphere ( x+math.sin(math.rad(-r))*3.5, y+math.cos(math.rad(-r))*3.5, z+0.3, 3.5 )
setTimer(destroyElement,1500,1,EsferaColisao)
local players = getElementsWithinColShape (EsferaColisao,"player")
local peds = getElementsWithinColShape (EsferaColisao,"ped")
if(#players>0) then
for k,v in ipairs(players)do
setPedOnFire(v,true)
end
end

if(#peds>0) then
for a,b in ipairs(peds)do
setPedOnFire(b,true)
end
end

end

addCommandHandler ("plos", Fs.Katon)

Espero sus respuestas y su ayuda por favor, traté pero no funciono nada de lo que hice :/ 

Link to comment

Prueba esto 

 

local Fs = {}
local flyerPlayersTimer = {}
commando = { }
tiempo = 3000

 function AnimationNula(P,T)
setTimer(setPedAnimation,T,1,P,nil)
end

function CreateObjectNinja(Ob,x,y,z,T)
object = createObject(Ob,x,y,z)
setElementCollisionsEnabled(object,false)
setTimer(destroyElement,T,1,object)
return object
end

function Fs.Katon (playerSource,k,ks)
if (commando[playerSource]) then
		return outputChatBox ( "Espera 3 segundos para usar el comando.", playerSource, 225, 0, 0 ,true)
end
	setPedAnimation(playerSource,"BAR","dnk_stndM_loop")
	local x,y,z = getElementPosition(playerSource)
	local r = getPedRotation(playerSource)
		triggerClientEvent("CreateNinjaSound",root,playerSource,"Katon.mp3")
		AnimationNula(playerSource,2500)
	local ob = CreateObjectNinja(2024,x+math.sin(math.rad(-r))*(0.15),y+math.cos(math.rad(-r))*(0.15),z+0.35,1500)
		setElementRotation(ob,0,0,r)
	local EsferaColisao = createColSphere ( x+math.sin(math.rad(-r))*3.5, y+math.cos(math.rad(-r))*3.5, z+0.3, 3.5 )
		setTimer(destroyElement,1500,1,EsferaColisao)
	local players = getElementsWithinColShape (EsferaColisao,"player")
	local peds = getElementsWithinColShape (EsferaColisao,"ped")
	commando[playerSource] = true
	setTimer( function()
		commando[playerSource] = false
end, tiempo, 1)	
	if(#players>0) then
	for k,v in ipairs(players)do
		setPedOnFire(v,true)
	end
end

if(#peds>0) then
for a,b in ipairs(peds)do
setPedOnFire(b,true)
end
end

end

addCommandHandler ("plos", Fs.Katon)

 

Edited by Slash14
Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...