Jump to content

Cars_Team


Haze

Recommended Posts

Posted

Hi I want to make some Cars only for Admins and some other group Like Gangs for Example i want Hydra Only For Millitery

We got Script That it Kick you Frome The Car if you are not a Millitery Skin it Kick you frome Hydra i want to Change it to Teams that mean with ACL not with The Skins Can some one Help

  
2.copVehicles = { [523]=true,[598]=true[596]=true,[597]=true,[599]=true} 
3.copSkins = { [280]=true,[281]=true[282]=true,[283]=true,[284]=true,[288]=true } 
4.  
5.function copenterVehicle ( player, seat, jacked ) 
6.    if ( copVehicles[getElementModel ( source )] ) and ( not copSkins[getElementModel ( player )] ) and ( seat == 0 ) then 
7.        removePedFromVehicle ( player )--force the player out of the vehicle 
8.        outputChatBox ( "You aren't a Police Officer , you mayn't drive this.", player ) --and tell the player why 
9.    end 
10.end 
11.addEventHandler ( "onVehicleEnter", getRootElement(), copenterVehicle ) 
12.  
  

Posted
copVehicles = { [523]=true,[598]=true[596]=true,[597]=true,[599]=true} 
copTeams = { ["Military"]=true,["Police"]=true } 
  
function copenterVehicle ( player, seat, jacked ) 
local team = getPlayerTeam(player) 
if not team then return end 
    if ( copVehicles[getElementModel ( source )] ) and ( not copTeams[getTeamName(team)] ) and ( seat == 0 ) then 
        removePedFromVehicle ( player )--force the player out of the vehicle 
        outputChatBox ( "You aren't a Police Officer , you mayn't drive this.", player ) --and tell the player why 
    end 
end 
addEventHandler ( "onVehicleEnter", getRootElement(), copenterVehicle ) 

Try that.

Posted

SCRIPT ERROR: Restricted_Cars\script2.lua:1: '}' expected near '['

[2011-06-20 22:57:03] WARNING: Loading script failed: Restricted_Cars\script2.lua:1: '}' expected near '[' I got this ERROR

Posted
copVehicles = { [523]=true,[598]=true, [596]=true,[597]=true,[599]=true} 
copTeams = { ["Military"]=true,["Police"]=true } 
  
function copenterVehicle ( player, seat, jacked ) 
local team = getPlayerTeam(player) 
if not team then return end 
    if ( copVehicles[getElementModel ( source )] ) and ( not copTeams[getTeamName(team)] ) and ( seat == 0 ) then 
        removePedFromVehicle ( player )--force the player out of the vehicle 
        outputChatBox ( "You aren't a Police Officer , you mayn't drive this.", player ) --and tell the player why 
    end 
end 
addEventHandler ( "onVehicleEnter", getRootElement(), copenterVehicle ) 

A mistake in your copVehicles table.

Posted

dud its Not working Now Everyone Can Drive the Car I tried to Remove my Self Frome the ACL group and Try to Drive the car and its not working Can someone Help me Plz i Chek the ID of Cars and i chek The Teams Now everyone can Drive the Car and Hydra Plz Help plz

Posted

acl ?? That code is not for acl its for teams

isObjectInACLGroup 

click on the function for a job.

Posted

no its not Should i add the Name Of the Car in ACL Group or what Plz Can Tape what sould i Add in ACL group in The Team

Posted

Why are you using acl for teams? use the normal team system, and you should add user.Accountname in the group.

Posted

What code?, i gave you the function it's easy to make a vehicle restriction script, you should do it by yourself, we don't give out the code here we just help you fix yours.

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