Jump to content

[HELP]Team Restriction


Alen141

Recommended Posts

Hey guys,I'm stuck again so here is my acl car lock for my pony car but i want to lock it for Team but i got lost in team functions:

Hunter = createVehicle ( 425, 362.26513671875, 1997.4976806641, 21.543445587158, 0, 0, 91.75 ) 
  
  
function lockArmy(player, seat, jacked) 
if source == Hunter then 
local accountname = getAccountName (getPlayerAccount(player)) 
if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Army" ) ) then return end 
cancelEvent() 
outputChatBox ( "Only Army is allowed to use this vehicle!", player, 255, 0, 0, true ) 
end 
end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), lockArmy ) 

Link to comment
Hunter = createVehicle ( 425, 362.26513671875, 1997.4976806641, 21.543445587158, 0, 0, 91.75 ) 
  
function lockArmy ( player, seat, jacked ) 
    if ( source == Hunter ) then 
        local team = getPlayerTeam ( player ) 
        local teamName = ( team and getTeamName ( team ) or "" ) 
        if ( teamName == "Army" ) then 
            cancelEvent ( ) 
            outputChatBox ( "Only Army is allowed to use this vehicle!", player, 255, 0, 0, true ) 
        end 
    end 
end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), lockArmy ) 

That's what you meant?

Link to comment
Hunter = createVehicle ( 425, 362.26513671875, 1997.4976806641, 21.543445587158, 0, 0, 91.75 ) 
  
function lockArmy ( player, seat, jacked ) 
    if ( source == Hunter ) then 
        local team = getPlayerTeam ( player ) 
        local teamName = ( team and getTeamName ( team ) or "" ) 
        if ( teamName == "Army" ) then 
            cancelEvent ( ) 
            outputChatBox ( "Only Army is allowed to use this vehicle!", player, 255, 0, 0, true ) 
        end 
    end 
end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), lockArmy ) 

That's what you meant?

i edited code a bit and it worked so thanks,did this community ever concider about giving you a 100 000$ i mean you relly deserve it cuse if someone helped this community it would be you!

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