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)