Jump to content

2 markers and spawn only 1 position


Hassam

Recommended Posts

Hello guys, I need help from this script, I want put 2 markers, and when I enter on first marker, I want spawn some car, and when I want enter another marker, the car will go to first position, can help me?

addEvent ( "spawnVehicle", true ) 
addEventHandler ( "spawnVehicle", root, 
    function ( vehID) 
        if ( isElement ( vehicles [ source ] ) ) then 
            destroyElement ( vehicles [ source ] ) 
        end 
        if isElementWithinMarker(thePlayer, marker1) then 
        vehicles [ source ] = createVehicle ( vehID, 2001.04370, -1407.97461, 16.91025, 0, 0, 180) 
        if ( vehicles [ source ] ) then 
            setVehicleColor ( vehicles [ source ], 6, 183, 248 ) 
        end 
        setTimer ( warpPedIntoVehicle, 100, 1, source, vehicles [ source ] ) 
        triggerClientEvent ( source, "closeWindow", root ) 
        elseif (isElementWithinMarker(thePlayer, marker2))then 
        vehicles [ source ] = createVehicle ( vehID, 1180.0832519531, -1338.3778076172, 13.409983634949, 0, 0, 270) 
        if ( vehicles [ source ] ) then  
            setVehicleColor ( vehicles [ source ], 6, 183, 248 ) 
        end 
        setTimer ( warpPedIntoVehicle, 100, 1, source, vehicles [ source ] ) 
        triggerClientEvent ( source, "closeWindow", root ) 
    end 
    end 
) 

[2013-07-14 01:37:17] WARNING: Emergency\_server.lua:14: Bad argument @ 'isElementWithinMarker' [Expected element at argument 1, got nil]

[2013-07-14 01:37:17] WARNING: Emergency\_server.lua:21: Bad argument @ 'isElementWithinMarker' [Expected element at argument 1, got nil]

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