Jump to content

how ?


mjau

Recommended Posts

Posted

How can i somehow atach a marker who still works or a colshape to a vehicle i want the marker to teleport me inot the andro interior and ive aleready fixed that but the attached marker dont work

n-560x95_E60303_FFFFFF_030303_FF0303.png
Posted

Dude, I don't understand anything, could you try to explain yourself again better?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

He means that when he attach the marker to a vehicle and move/drive the vehicle ( in his case is the Andromada ) the marker stops working.Thats an MTA bug i believe.There are other more complicated way's to do/fix your problem.

Posted
function markerattach ( player ) 
  local  vehicle =  getPedOccupiedVehicle(player) 
local Marker = createMarker ( 0, 0, 0, "arrow", 1, 255, 0, 0, 170 ) 
attachElements ( Marker, vehicle, 0, 0, 2 ) 
end 
 addCommandHandler ( "attach", markerattach  ) 
  

Ingame Name : |DGT|Puma

DGT Clan Server 24/7 Owner/Scripter

MultiGameMode in progress :

n-560x95_FFFFFF_FFFFFF_0283C4_000000.png

Posted

That just attahced the marker it wont work after ive attached it

More explained

I have an andromada and i want to create a arrow behind it and when a player hit that arrow they get set into the andromada interior

I have the code to set the interior but the marker dont work when it is attahced

n-560x95_E60303_FFFFFF_030303_FF0303.png
Posted

That's because the marker is local and there is no way else you can get it.

Try:

function markerattach ( player ) 
  local  vehicle =  getPedOccupiedVehicle(player) 
local Marker = createMarker ( 0, 0, 0, "arrow", 1, 255, 0, 0, 170 ) 
attachElements ( Marker, vehicle, 0, 0, 2 ) 
addEventHandler("onMarkerHit", Marker, 
function(hitElement) 
if getElementType(hitElement) ~= "player" then return end 
--code to set the player to the anadorma interior 
end) 
end 
 addCommandHandler ( "attach", markerattach  ) 

Business System viewtopic.php?f=108&t=35797

Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726

SQLite Tutorial viewtopic.php?f=148&t=38203

Posted (edited)

tried and dont work heres my full code

function markerattach ( player ) 
local  vehicle = getPedOccupiedVehicle(player) 
local Marker = createMarker ( 0, 0, 0, "arrow", 1, 255, 0, 0, 170 ) 
attachElements ( Marker, vehicle, 0, 0, 2 ) 
addEventHandler( "onMarkerHit", Marker, movehim ) 
function movehim(hitElement) 
if getElementType(hitElement) ~= "player" then return end 
setElementInterior(hitElement, 9, 315.48, 984.13, 1959.11 ) 
end 
end 
addCommandHandler ( "attach", markerattach ) 

Edit tried another thing stil dont work

function markerattach ( player ) 
  local  vehicle =  getPedOccupiedVehicle(player) 
local Marker = createMarker ( 0, 0, 0, "arrow", 1, 255, 0, 0, 170 ) 
attachElements ( Marker, vehicle, 0, 0, 4 ) 
addEventHandler("onMarkerHit", Marker, test 
function test(hitElement) 
if getElementType(hitElement) ~= "player" then return end 
setElementInterior(hitElement, 9, 315.48, 984.13, 1959.11 ) 
end) 
end 
 addCommandHandler ( "attach", markerattach  ) 

Edited by Guest
n-560x95_E60303_FFFFFF_030303_FF0303.png
Posted

Try:

function markerattach ( player ) 
local  vehicle = getPedOccupiedVehicle(player) 
local Marker = createMarker ( 0, 0, 0, "arrow", 1, 255, 0, 0, 170 ) 
attachElements ( Marker, vehicle, 0, 0, 2 ) 
function movehim(hitElement) 
if getElementType(hitElement) ~= "player" then return end 
setElementInterior(hitElement, 9, 315.48, 984.13, 1959.11 ) 
end 
addEventHandler( "onMarkerHit", Marker, movehim ) 
end 
addCommandHandler ( "attach", markerattach ) 

Business System viewtopic.php?f=108&t=35797

Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726

SQLite Tutorial viewtopic.php?f=148&t=38203

Posted
plane = createVehicle( ... ) 
       tmarker = createMarker( ... ) 
       attachElements( marker, plane, ... ) 
  
    function markerHit( hitPlayer ) 
    setElementInterior( hitPlayer, 9, 315.48, 984.13, 1959.11 ) 
    end 
    addEventHandler( "onMarkerHit", tmarker, markerHit ) 

Posted

ehh xD if u didnt knew attached markers dont work thats why i am asking had something like that before but didnt work

n-560x95_E60303_FFFFFF_030303_FF0303.png
Posted
function markerattach ( player ) 
local  vehicle = getPedOccupiedVehicle(player) 
local Marker = createMarker ( 0, 0, 0, "arrow", 1, 255, 0, 0, 170 ) 
local colTube = createColTube ( 0, 0, 0, 1, 1 ) 
attachElements ( Marker, vehicle, 0, 0, 5 ) 
attachElements ( colTube, Marker, 0, 0, 5 ) 
function movehim(hitElement) 
if getElementType(hitElement) ~= "player" then return end 
setElementInterior(hitElement, 9, 315.48, 984.13, 1959.11 ) 
end 
addEventHandler( "onColShapeHit", colTube, movehim ) 
end 
addCommandHandler ( "attach", markerattach ) 

No erros but nothig happens when i enter the marker

n-560x95_E60303_FFFFFF_030303_FF0303.png
Posted

Ohh shit sorry, wasn't looking closely.

Try this:

  
function createAndroMarker(thePlayer) 
    local vehicle = getPedOccupiedVehicle(thePlayer) 
    local marker = createMarker(0, 0, 0, "arrow", 1, 255, 0, 0, 170) 
    local colTube = createColTube(0, 0, 0, 1, 1) 
    attachElements(marker, vehicle, 0, 0, 5) 
    attachElements(colTube, marker, 0, 0, 5) 
    addEventHandler("onColShapeHit", colTube, warpPlayerIntoAndro, false) 
end 
addCommandHandler("attatch", createAndroMarker) 
function warpPlayerIntoAndro(hitElement, dimensionMatch) 
    if getElementType(hitElement) ~= "player" then return end 
    if not dimensionMatch then return end 
    setElementInterior(hitElement, 9, 315.48, 984.13, 1959.11 ) 
end 
  

Posted

Add this to the warpPlayerIntoAndro function, first thing:

outputDebugString("Warp function triggered")

Try it, and if you dont see "Warp function triggered", then the error is in addEventHandler. Which I think is just another MTA bug.

Posted

tried and your right i dont see it but i know it is possible cuz SAES did sumething like that before they got new ways of recruitng people

n-560x95_E60303_FFFFFF_030303_FF0303.png

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