Jump to content

what is wrong with this script?


Recommended Posts

rancher = createVehicle ( 490, 101.17621, 1942.22717, 18.41861 ) 
  
addEventHandler ( "onVehicleStartEnter", rancher, 
    function ( thePlayer ) 
        if ( not isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "Adam" ) ) ) then 
            outputChatBox ( "You cannot use this vehicle as it belongs to Adam!", thePlayer, 255, 0, 0 ) 
            cancelEvent ( ) 
        end 
    end 
) 
  
sultan = createVehicle ( 560, -398.38452, 1290.49658, 9.23544 ) 
  
addEventHandler ( "onVehicleStartEnter", sultan, 
    function ( thePlayer ) 
        if ( not isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "Martin" ) ) ) then 
            outputChatBox ( "You cannot use this vehicle as it belongs to Martin!", thePlayer, 255, 0, 0 ) 
            cancelEvent ( ) 
        end 
    end 
) 
  
  
  
function martinVehicle() 
setElementPosition (source, -400.31415, 1294.04468, 9.95310) 
end 
addCommandHandler ( "mv", martinVehicle  ) 
  
function adamVehicle() 
setElementPosition (source, 92.69779, 1945.70471, 18.06420) 
end 
addCommandHandler ("av", adamVehicle) 
  

Link to comment

function martinVehicle() 
setElementPosition (source, -400.31415, 1294.04468, 9.95310) 
end 
addCommandHandler ( "mv", martinVehicle  ) 

should be :

function martinVehicle(player) 
setElementPosition (player, -400.31415, 1294.04468, 9.95310) 
end 
addCommandHandler ( "mv", martinVehicle  ) 

and

function adamVehicle() 
setElementPosition (source, 92.69779, 1945.70471, 18.06420) 
end 
addCommandHandler ("av", adamVehicle) 

should be :

function adamVehicle(player) 
setElementPosition (player, 92.69779, 1945.70471, 18.06420) 
end 
addCommandHandler ("av", adamVehicle) 
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...