Jump to content

Function?


joedajoester

Recommended Posts

Posted

Hi all, i am using this script, and need to add a commandhandler and there is no function so i do not know how to add one :D

car1gate1 = createObject(971, 0, 0, 5) 
car1gate2 = createObject(971, 0, 0, 5) 
car2gate1 = createObject(971, 0, 0, 5) 
car2gate2 = createObject(971, 0, 0, 5) 
Car1 = createVehicle ( 567, -1736, -2895, 55, 0, 0, 236 ) 
Car2 = createVehicle ( 567, -1744, -2913.3000488281, 55, 0, 354.488, 220 ) 
attachElements( car1gate1, Car1, 0.4, 6.2, -0.6, 90, 90, 90 ) 
attachElements( car1gate2, Car1, 0.4, 13.2, -0.6, 90, 90, 90 ) 
attachElements( car2gate1, Car2, 0.05, 6.2, -0.6, 90, 90, 90 ) 
attachElements( car2gate2, Car2, 0.05, 13.2, -0.6, 90, 90, 90 ) 
addVehicleUpgrade ( Car1, 1087 ) 
addVehicleUpgrade ( Car2, 1087 ) 
addCommandHandler ( "spatula", attachElements) 

Thanks ^Dev-PoinT^ for helping with the add upgrade

Posted
function attach() 
car1gate1 = createObject(971, 0, 0, 5) 
car1gate2 = createObject(971, 0, 0, 5) 
car2gate1 = createObject(971, 0, 0, 5) 
car2gate2 = createObject(971, 0, 0, 5) 
Car1 = createVehicle ( 567, -1736, -2895, 55, 0, 0, 236 ) 
Car2 = createVehicle ( 567, -1744, -2913.3000488281, 55, 0, 354.488, 220 ) 
attachElements( car1gate1, Car1, 0.4, 6.2, -0.6, 90, 90, 90 ) 
attachElements( car1gate2, Car1, 0.4, 13.2, -0.6, 90, 90, 90 ) 
attachElements( car2gate1, Car2, 0.05, 6.2, -0.6, 90, 90, 90 ) 
attachElements( car2gate2, Car2, 0.05, 13.2, -0.6, 90, 90, 90 ) 
addVehicleUpgrade ( Car1, 1087 ) 
addVehicleUpgrade ( Car2, 1087 ) 
end 
addCommandHandler ( "spatula", attach) 

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

Have you typed the /spatula command?

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

Works perfect, the cars get created and these objects attached to them.

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

Well, your script is totally different, it creates two cars and attaches these objects to them, plus add the hydraulics. Here I'll leave a script that'll attach it to your vehicle.

function attach(thePlayer) 
if not isPedInVehicle(thePlayer) then return end 
local vehicle = getPedOccupiedVehicle(thePlayer) 
local car1gate1 = createObject(971, 0, 0, 5) 
local car1gate2 = createObject(971, 0, 0, 5) 
attachElements( car1gate1, vehicle, 0.4, 6.2, -0.6, 90, 90, 90 ) 
attachElements( car1gate2, vehicle, 0.4, 13.2, -0.6, 90, 90, 90 ) 
addVehicleUpgrade ( vehicle, 1087 ) 
end 
addCommandHandler ( "spatula", attach) 

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

I don't know what are you talking about, maybe you created the objects with the same variables?

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.

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