Jump to content

Vehicle ACL (Passanger)


DonPro

Recommended Posts

hi, i got this script that create vehicles to an ACL group but i realy like it to allow passangers to enter vehicles.

vehicle1 = createVehicle ( 431 , 1080.7998046875, -1775.599609375, 13.60000038147, 0, 0, 270 ) 
vehicle = createVehicle ( modelID, x, y, z, rotX, rotY, rotZ ) 
state = setVehicleDoorState ( vehicle, 255, 0, 0 ) 
setVehicleDamageProof ( vehicle, true ) 
setVehicleColor(vehicle1,191,76,0 , 27,27,27 ) 
  
function  lockPrivate( player, seat, jacked ) 
    local accName = getAccountName ( getPlayerAccount ( player ) ) 
    if ( not isObjectInACLGroup ( "user."..accName, aclGetGroup ( "Vasity Bus" ) ) ) then 
        cancelEvent ( ) 
        outputChatBox ( "This vehicle belongs to Vasity Bus Services", player, 255, 0, 0, false ) 
    else 
        outputChatBox ( "", player, 255, 0, 0, false ) 
    end 
end 
addEventHandler ( "onVehicleStartEnter", vehicle1, lockPrivate ) 
  
  

Link to comment
  • Administrators

Just use the seat argument.

  
vehicle1 = createVehicle ( 431 , 1080.7998046875, -1775.599609375, 13.60000038147, 0, 0, 270 ) 
vehicle = createVehicle ( modelID, x, y, z, rotX, rotY, rotZ ) 
state = setVehicleDoorState ( vehicle, 255, 0, 0 ) 
setVehicleDamageProof ( vehicle, true ) 
setVehicleColor(vehicle1,191,76,0 , 27,27,27 ) 
  
function  lockPrivate( player, seat, jacked ) 
    if seat == 0 then 
    local accName = getAccountName ( getPlayerAccount ( player ) ) 
    if ( not isObjectInACLGroup ( "user."..accName, aclGetGroup ( "Vasity Bus" ) ) ) then 
        cancelEvent ( ) 
        outputChatBox ( "This vehicle belongs to Vasity Bus Services", player, 255, 0, 0, false ) 
    else 
        outputChatBox ( "", player, 255, 0, 0, false ) 
    end 
end 
end 
addEventHandler ( "onVehicleStartEnter", vehicle1, lockPrivate ) 
  
  

Link to comment
Just use the seat argument.
  
vehicle1 = createVehicle ( 431 , 1080.7998046875, -1775.599609375, 13.60000038147, 0, 0, 270 ) 
vehicle = createVehicle ( modelID, x, y, z, rotX, rotY, rotZ ) 
state = setVehicleDoorState ( vehicle, 255, 0, 0 ) 
setVehicleDamageProof ( vehicle, true ) 
setVehicleColor(vehicle1,191,76,0 , 27,27,27 ) 
  
function  lockPrivate( player, seat, jacked ) 
    if seat == 0 then 
    local accName = getAccountName ( getPlayerAccount ( player ) ) 
    if ( not isObjectInACLGroup ( "user."..accName, aclGetGroup ( "Vasity Bus" ) ) ) then 
        cancelEvent ( ) 
        outputChatBox ( "This vehicle belongs to Vasity Bus Services", player, 255, 0, 0, false ) 
    else 
        outputChatBox ( "", player, 255, 0, 0, false ) 
    end 
end 
end 
addEventHandler ( "onVehicleStartEnter", vehicle1, lockPrivate ) 
  
  

so

   if seat == 0 then 

i can put 30 seats there and i can have 30 people enter the bus to or?

Link to comment
  • Administrators

No, the modification i made was that if it's not the drivers seat, it doesn't make the check, so any player can join the passenger seat even if they do not belong to the ACL.

Also this has a wrong syntax:

state = setVehicleDoorState ( vehicle, 255, 0, 0 ) 

Edited by Guest
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...