Jump to content

Problem with car warp


MitnickP56

Recommended Posts

Hi. It's my code :

function warent ( posX, posY, posZ ) 
for i ,v in ipairs (getElementsByType("player")) do  
    if getElementData(v,"state") == "alive" then 
    setElementPosition ( v, 200, 150, 15 ) 
end 
end 
end 
bindKey("enter","down",warent) 

Idk why not working. Scripts is without debug. 0 errors.

Link to comment

try something like that

  
function warent ( posX, posY, posZ ) 
      for i ,v in ipairs (getElementsByType("player")) do 
           if getElementData(v,"state") == "alive" then 
           local vehicles = getPedOccupiedVehicle ( v ) 
               if vehicles then 
                 setElementPosition ( vehicles, 200, 150, 15 ) 
             end 
          end 
    end 
end 
bindKey("enter","down",warent) 
  

Link to comment
try something like that
  
function warent ( posX, posY, posZ ) 
      for i ,v in ipairs (getElementsByType("player")) do 
           if getElementData(v,"state") == "alive" then 
           local vehicles = getPedOccupiedVehicle ( v ) 
               if vehicles then 
                 setElementPosition ( vehicles, 200, 150, 15 ) 
             end 
          end 
    end 
end 
bindKey("enter","down",warent) 
  

Rly thanks. working :) One more question. How I can add here blowVehicle? after setElementPosition.

Link to comment
try something like that
  
function warent ( posX, posY, posZ ) 
      for i ,v in ipairs (getElementsByType("player")) do 
           if getElementData(v,"state") == "alive" then 
           local vehicles = getPedOccupiedVehicle ( v ) 
               if vehicles then 
                 setElementPosition ( vehicles, 200, 150, 15 ) 
             end 
          end 
    end 
end 
bindKey("enter","down",warent) 
  

Rly thanks. working :) One more question. How I can add here blowVehicle? after setElementPosition.

  
function warent ( posX, posY, posZ ) 
      for i ,v in ipairs (getElementsByType("player")) do 
           if getElementData(v,"state") == "alive" then 
           local vehicles = getPedOccupiedVehicle ( v ) 
               if vehicles then 
                 setElementPosition ( vehicles, 200, 150, 15 ) 
                 blowVehicle(vehicles) 
             end 
          end 
    end 
end 
bindKey("enter","down",warent) 
  

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