Jump to content

Freezar Player Por id


Recommended Posts

eu queria um script que desse freeze em alguem por id, ex : freeeze (id do player)
tentei fazer um script so que ao invez de dar freeze via id, ele da freeze somente em mim mesmo
codigo infuncional meu abaixo

function toggleFreezeStatus(thePlayer, cmd, id)
   if ( id ) then
      local playerID = tonumber(id)
        if ( playerID ) then
         local targetPlayer = getPlayerID(playerID)
            if ( targetPlayer ) then
               setElementFrozen(thePlayer, true)
	local playerVehicle = getPedOccupiedVehicle(thePlayer)
	if playerVehicle then
		local isPlayerVehicleFrozen = isElementFrozen(playerVehicle)

		setElementFrozen(playerVehicle, not isPlayerVehicleFrozen)
        end
      end
	 end
  end
end
	addCommandHandler("rlkfreeze", toggleFreezeStatus)

 

Link to comment
  • Other Languages Moderators

Olá!

Você está armazenando o jogador-alvo na variável targetPlayer, então use-a.

setElementFrozen(targetPlayer, true)

local playerVehicle = getPedOccupiedVehicle(targetPlayer)

 

  • Thanks 1
Link to comment

No lugar de 

setElementFrozen(targetPlayer, true)

 coloque 

setElementFrozen(targetPlayer, not isElementFrozen(targetPlayer))

Obs: pode ter ficado meio bagunçado pq opção <code> do fórum não está funcionando pra mim

Edited by Lord Henry
Textos convertidos para script.
  • Haha 1
Link to comment

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
  • Recently Browsing   0 members

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