Jump to content

Ayuda con script en autos


jdcu

Recommended Posts

local groupName = 'SurvariumZ' 
markerDoor = createMarker(-2879.455078125, 1234.548828125, 7.0988426208496,"cylinder",2, 0, 255, 0, 150) 
  
  
  
addEventHandler("onMarkerHit",root, 
function ( hPlayer ) 
if ( source == markerDoor ) then 
if ( getElementData ( hPlayer, "gang" ) == "SurvariumZ" ) or isPedInVehicle( hPlayer ) then 
setElementPosition ( hPlayer , -2852.0888671875, 1258.0458984375, 7.1015625 ) 
else 
outputChatBox( 'Only '..groupName..' !', hPlayer, 255, 0, 255 ) 
end 
  
end 
end 
) 
  

El problema es el siguiente quiero que funcione con autos tambien no solo que teletransporte al jugador sino tambien, que si el jugador va en auto lo teletransporte con el auto tambien, por favor si alguien me puede ayudar gracias

Link to comment

Esto debería funcionar.

local groupName = 'SurvariumZ' 
markerDoor = createMarker(-2879.455078125, 1234.548828125, 7.0988426208496,"cylinder",2, 0, 255, 0, 150) 
  
addEventHandler ( "onMarkerHit", root, 
    function ( hPlayer ) 
        local vehicle = getPedOccupiedVehicle ( hPlayer ) 
        if ( source == markerDoor ) then 
            if ( getElementData ( hPlayer, "gang" ) == "SurvariumZ" or isPedInVehicle ( hPlayer ) ) then 
                setElementPosition ( hPlayer , -2852.0888671875, 1258.0458984375, 7.1015625 ) 
                setElementPosition ( vehicle , -2852.0888671875, 1258.0458984375, 7.1015625 ) 
            else 
                outputChatBox( 'Only '..groupName..' !', hPlayer, 255, 0, 255 ) 
            end 
        end 
    end 
) 
  

Edited by Guest
Link to comment
Esto debería funcionar.
local groupName = 'SurvariumZ' 
markerDoor = createMarker(-2879.455078125, 1234.548828125, 7.0988426208496,"cylinder",2, 0, 255, 0, 150) 
  
addEventHandler ( "onMarkerHit", root, 
    function ( hPlayer ) 
        local vehicle = getPedVehicle ( hPlayer ) 
        if ( source == markerDoor ) then 
            if ( getElementData ( hPlayer, "gang" ) == "SurvariumZ" or isPedInVehicle ( hPlayer ) ) then 
                setElementPosition ( hPlayer , -2852.0888671875, 1258.0458984375, 7.1015625 ) 
                setElementPosition ( vehicle , -2852.0888671875, 1258.0458984375, 7.1015625 ) 
            else 
                outputChatBox( 'Only '..groupName..' !', hPlayer, 255, 0, 255 ) 
            end 
        end 
    end 
) 
  

*getPedOccupiedVehicle

Link to comment

Esto ya debería funcionar.

local groupName = 'SurvariumZ' 
markerDoor = createMarker(-2879.455078125, 1234.548828125, 7.0988426208496,"cylinder",2, 0, 255, 0, 150) 
  
addEventHandler ( "onMarkerHit", root, 
    function ( hPlayer ) 
        local vehicle = getPedOccupiedVehicle ( hPlayer ) 
        if ( source == markerDoor ) then 
            if ( getElementData ( hPlayer, "gang" ) == "SurvariumZ" ) then 
                if not isPedInVehicle ( hPlayer ) then 
                    setElementPosition ( hPlayer , -2852.0888671875, 1258.0458984375, 7.1015625 ) 
                else isPedInVehicle ( hPlayer ) then 
                    setElementPosition ( hPlayer , -2852.0888671875, 1258.0458984375, 7.1015625 ) 
                    setElementPosition ( vehicle , -2852.0888671875, 1258.0458984375, 7.1015625 ) 
                end 
            else  
                outputChatBox ( "Only "..groupName.."!", hPlayer, 255, 0, 0 ) 
            end 
        end 
    end 
) 
  

Edited by Guest
Link to comment

Esto ya debería funcionar.

local groupName = 'SurvariumZ' 
markerDoor = createMarker(-2879.455078125, 1234.548828125, 7.0988426208496,"cylinder",2, 0, 255, 0, 150) 
  
addEventHandler ( "onMarkerHit", root, 
    function ( hPlayer ) 
        local vehicle = getPedOccupiedVehicle ( hPlayer ) 
        if ( source == markerDoor ) then 
            if ( getElementData ( hPlayer, "gang" ) == "SurvariumZ" ) then 
                if not isPedInVehicle ( hPlayer ) then 
                    setElementPosition ( hPlayer , -2852.0888671875, 1258.0458984375, 7.1015625 ) 
                else isPedInVehicle ( hPlayer ) then 
                    setElementPosition ( hPlayer , -2852.0888671875, 1258.0458984375, 7.1015625 ) 
                    setElementPosition ( vehicle , -2852.0888671875, 1258.0458984375, 7.1015625 ) 
                end 
            else  
                outputChatBox ( "Only "..groupName.."!", hPlayer, 255, 0, 0 ) 
            end 
        end 
    end 
) 
  

Edited by Guest
Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...