Sign in to follow this  
WeeD1

fadeCamera WARNING

Recommended Posts

Olá. alguém para me ajudar por favor? Estou com um problema em um sistema de teleportes, porém não sei como resolver, segue:

 

WARNING: Teleports\teleports.Lua:10: Bad argument @ 'fadeCamera' [Expected element at argument 1]

 

function tele (thePlayer)
    if getPedOccupiedVehicle(thePlayer) then
    outputChatBox ("#ff0000Você precisa sair do veículo para usar teleportes.", thePlayer, 255, 255, 255, true)
    else
    if getElementInterior(thePlayer) > 0 then
    outputChatBox ("#ff0000Você precisa sair do interior para usar teleportes.", thePlayer, 255, 255, 255, true)
    else
    fadeCamera(thePlayer, false, 0.5)
    if not isElement (thePlayer) then return end
    setTimer(fadeCamera, 1000, 1, thePlayer, true)
    if (commando[thePlayer]) then
        return
    end
    setTimer( function(thePlayer)
    if not (isElement(thePlayer)) then return end
    setElementPosition ( thePlayer, 260, -1780, 7 )
    end, tempo, 1, thePlayer)
        commando[thePlayer] = true
    setTimer( function()
        commando[thePlayer] = false
    end, tempo*2, 1)
end
end
end
addCommandHandler ( "praia", tele )

 

Share this post


Link to post

Não percebi erros, tente isto:

function tele (thePlayer)
	if getPedOccupiedVehicle(thePlayer) then
		return outputChatBox ("#ff0000Você precisa sair do veículo para usar teleportes.", thePlayer, 255, 255, 255, true)
	end
	if getElementInterior(thePlayer) ~= 0 then
		return outputChatBox ("#ff0000Você precisa sair do interior para usar teleportes.", thePlayer, 255, 255, 255, true)
	end
	if (commando[thePlayer]) then
		return
	end

	fadeCamera(thePlayer, false, 0.5)	
	setTimer( function(player)
		if isElement(player) then
			fadeCamera( player, true )
		end
	end, 1000, 1, thePlayer )
	
	setTimer( function(thePlayer)
		if (isElement(thePlayer)) then
			setElementPosition ( thePlayer, 260, -1780, 7 )
		end
	end, tempo, 1, thePlayer)
			
	commando[thePlayer] = true
	setTimer( function(thePlayer)
		if (isElement(thePlayer)) then
			commando[thePlayer] = false
		end
	end, tempo*2, 1, thePlayer)
end
addCommandHandler ( "praia", tele )

 

  • Thanks 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.