Jump to content

Como Oculta Blip Que Marca La Ubicacion De Los Player's


eloriginal

Recommended Posts

Posted

Hoy hago este post por que no tengo la menor idea de como hacer que se oculte el blip que marca a un player's en el mapa (el cuadrito). Les daría mil gracias si me ayudan :D:D:D:D

Posted
2 hours ago, eloriginal said:

Ok Me sirvió pero le quita el blip  a todo por igual yo nada mas quiero que me quite el blip a mi solo xD

 

  Reveal hidden contents

 

addCommandHandler("hideblip", 
  function (p)
    el = getAttachedElements(p)
    for element in ipairs(el) do
      if getElementType(element) == "blip" then
        setElementAlpha(element, 0)
      end
    end
  end
)

 

Posted

Me dice que 'ipairs' (table expected, got boolean) :'| 

1 hour ago, Tomas said:

addCommandHandler("hideblip", 
  function (p)
    el = getAttachedElements(p)
    for element in ipairs(el) do
      if getElementType(element) == "blip" then
        setElementAlpha(element, 0)
      end
    end
  end
)

 

Me dice que 'ipairs' (table expected, got boolean) :'| 

Posted
1 hour ago, eloriginal said:

Me dice que 'ipairs' (table expected, got boolean) :'| 

Me dice que 'ipairs' (table expected, got boolean) :'| 

Es un script de tipo server.

Posted
58 minutes ago, Tomas said:

Postea el meta.

<meta>
<info author="ElOriginal" name="VIP Oro" type="script" version="1.0.1" />
<script src="Client.lua" type="client" />
<file src="vip-hosting.png" />
<script src="Server.lua" type="server" />
</meta>

 

Posted
addCommandHandler("hideblip", 
  function (p)
    el = getAttachedElements(p)
	for idx,value in ipairs(el) do
		if getElementType(value) == "blip" then
			destroyElement(value, 0)
		end
    end
  end
)

 

Posted (edited)

Es porque se ejecuta otra vez después de haberlos ya borrado obteniendo un valor núlo.

addCommandHandler("hideblip", 
  function (p)
    local el = getAttachedElements(p)
    if ( el ) then
      for i = 1, #el do
        local element = el[ i ]
        if getElementType(element) == "blip" then
          destroyElement( element )
        end
      end
    end
  end
)

 

Edited by Simple01
Variable local.
Posted
function deleteAlllPlayerBlips(player)
	local elements = getAttachedElements(player)
	if (elements) then
		for i, element in ipairs(elements) do
			if (getElementType(element) == "blip") then
				destroyElement(element)
			end
		end
	end
function hideblip (source)
	deleteAlllPlayerBlips(source)
end
addCommandHandler ("noblip", hideblip)

Prueba con estó

Posted
3 minutes ago, MarkFlash said:

function deleteAlllPlayerBlips(player)
	local elements = getAttachedElements(player)
	if (elements) then
		for i, element in ipairs(elements) do
			if (getElementType(element) == "blip") then
				destroyElement(element)
			end
		end
	end
end

function hideblip (source)
	deleteAlllPlayerBlips(source)
end
addCommandHandler ("noblip", hideblip)

Prueba con estó


Te faltó un "end"

Posted
blip = false

addCommandHandler("hideblip", 
	function (p)
		if blip == false then
			el = getAttachedElements(p)
			for idx,value in ipairs(el) do
				if getElementType(value) == "blip" then
					destroyElement(value, 0)
				end
			end
			blip = true
		else
			local r, g, b = math.random(50, 255), math.random(50, 255), math.random(50, 255)
			createBlipAttachedTo(p, 0, 2, r, g, b)
			blip = false
		end
	end
)

 

Posted
13 hours ago, #Dv^ said:

blip = false

addCommandHandler("hideblip", 
	function (p)
		if blip == false then
			el = getAttachedElements(p)
			for idx,value in ipairs(el) do
				if getElementType(value) == "blip" then
					destroyElement(value, 0)
				end
			end
			blip = true
		else
			local r, g, b = math.random(50, 255), math.random(50, 255), math.random(50, 255)
			createBlipAttachedTo(p, 0, 2, r, g, b)
			blip = false
		end
	end
)

 

No hace nada sigue el  Me dice que 'ipairs' (table expected, got boolean) :'|  sera que hay que poner algo en el CLIENT?

 

Posted
2 minutes ago, #Dv^ said:

Eso es por que es un script tipo Server y lo estás haciendo del lado del cliente

no Bro lo estoy haciendo en el tipo SERVER Con decirte que es un panel vip y uso triggerServerEvent Y para que todas la funciones las aga desde el SERVER. :S:S 

 

Posted

Oh, hubieras dicho que usabas un trigger entonces

blip = false

addEvent("prueba", true)
addEventHandler("prueba", root,
	function ()
		if blip == false then
			el = getAttachedElements(source)
			for idx,value in ipairs(el) do
				if getElementType(value) == "blip" then
					destroyElement(value, 0)
				end
			end
			blip = true
		else
			local r, g, b = math.random(50, 255), math.random(50, 255), math.random(50, 255)
			createBlipAttachedTo(source, 0, 2, r, g, b)
			blip = false
		end
	end
)

 

  • Like 1
Posted
1 hour ago, #Dv^ said:

Oh, hubieras dicho que usabas un trigger entonces


blip = false

addEvent("prueba", true)
addEventHandler("prueba", root,
	function ()
		if blip == false then
			el = getAttachedElements(source)
			for idx,value in ipairs(el) do
				if getElementType(value) == "blip" then
					destroyElement(value, 0)
				end
			end
			blip = true
		else
			local r, g, b = math.random(50, 255), math.random(50, 255), math.random(50, 255)
			createBlipAttachedTo(source, 0, 2, r, g, b)
			blip = false
		end
	end
)

 

Pues no veo ningun debug. Asi que Graciaass A Todos por igual Se les Quiere :D:D:D:D:D Me Funciono a la perfecciónB|B| 

Posted
23 hours ago, eloriginal said:

Pues no veo ningun debug. Asi que Graciaass A Todos por igual Se les Quiere :D:D:D:D:D Me Funciono a la perfecciónB|B| 

No es necesario destruirlo y crearlo, solo esconderlo.

 

el = getAttachedElements(player)
for _,value in ipairs(el) do
	if getElementType(value) == "blip" then
		setElementAlpha(value, getElementAlpha(value) == 255 and 0 or 255)
	end
end

 

  • Like 1
  • Recently Browsing   0 members

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