Jump to content

[Ajuda] Painel VIP


Recommended Posts

Não consigo definir quando o player VIP pegar o carro 1 e for trocar pro carro 2 destruir o carro 1.

local vipcar = {}
addEvent("vgAcao03", true)
addEventHandler("vgAcao03", resourceRoot,
	function(item)
		if getPedOccupiedVehicle(source) then
		triggerClientEvent ( client, "exibirNotificacao", resourceRoot, "desativado", item, "Saia do veiculo primeiro!")
		return
		end
		if vipcar[source] and isElement(vipcar[source]) then
		destroyElement(vipcar[source])
		end
		if (vipcar[client]) and (isElement(vipcar[client])) then destroyElement(vipcar[client]) end
		if isPedInVehicle(client) then removePedFromVehicle(client) end
		local rx,ry,rz = getElementRotation(client)
		local x,y,z = getElementPosition(client)
		vipcar[client] = createVehicle(451,x,y,z,rx,ry,rz)
		warpPedIntoVehicle(client,vipcar[client])
		triggerClientEvent ( client, "exibirNotificacao", resourceRoot, "ativado", item, "Você pegou o carro VIP")
	end
)

 

Link to comment
  • Other Languages Moderators
local vipcar = { };

addEvent( "vgAcao03", true );

addEventHandler ( "vgAcao03", root, function ( item )

		if ( getPedOccupiedVehicle ( source ) ) then
			return triggerClientEvent ( source, "exibirNotificacao", source, "desativado", item, "Saia do veiculo primeiro!" );
		end
		
		if ( vipcar[source] and isElement ( vipcar[source] ) ) then
			destroyElement ( vipcar[source] );
		end
		
		local rx, ry, rz = getElementRotation ( source );
		local x, y, z = getElementPosition ( source );
		
		vipcar[source] = createVehicle ( 451, x, y, z, rx, ry, rz );
		warpPedIntoVehicle ( source, vipcar[source] );
		
		triggerClientEvent ( source, "exibirNotificacao", source, "ativado", item, "Você pegou o carro VIP" );
end )

 

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...