Jump to content

Como por um Spawner de carro que vem com apenas 1 cor


Recommended Posts

Bom pessoal. eu tenho um carro para todas as facções do servidor, ai eu queria variar os carros por cor. porem eu não sei como deixar fixo a cor do carro já de spawn.
Favor ignorem as posições

iniMarker = createMarker( 2529.766, -1571.396, 25.567, "cylinder", 2.5, 255,255,255,50)
destroyM = createMarker( 2535.796, -1572.035, 25.567, "cylinder", 2.5, 255,0,0,100)

function msg(player)
	outputChatBox("#ff0000Voce Pegou Um Carro Do #000000(fac)", player, 255,255,255,true)
end
addEventHandler("onMarkerHit", iniMarker, msg)

veh = {}
function spawnVehicle(player)
	if isElementWithinMarker(player, iniMarker) then
		if veh[player] and isElement( veh[player] ) then destroyElement(veh[player])
			veh[player] = nil 
        end     
        veh[player] = createVehicle(585, 2530.2875976563,-1559.9366455078,25.567188262939)
        warpPedIntoVehicle(player, veh[player])
    end
end
addEventHandler("onMarkerHit", iniMarker, spawnVehicle)

function msgDestroy(player)
	outputChatBox("#ff0000Voce Destroiu o Carro Do #000000(fac)", player, 255,255,255,true)
end
addEventHandler("onMarkerHit", destroyM, msgDestroy)

function destroy(player)
	if isElementWithinMarker(player, destroyM) then
	if isPedInVehicle(player) == true then
		destroyElement(veh[player])
		outputChatBox("", player, 255,255,255,true)
	else
		outputChatBox("", player, 255,255,255,true)
	end
end
end
addEventHandler("onMarkerHit", destroyM, destroy)  

 

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