Haze Posted June 20, 2011 Share Posted June 20, 2011 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. Link to comment
Castillo Posted June 20, 2011 Share Posted June 20, 2011 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. Link to comment
Haze Posted June 20, 2011 Author Share Posted June 20, 2011 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 Link to comment
JR10 Posted June 20, 2011 Share Posted June 20, 2011 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. Link to comment
Haze Posted June 20, 2011 Author Share Posted June 20, 2011 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 Link to comment
JR10 Posted June 20, 2011 Share Posted June 20, 2011 acl ?? That code is not for acl its for teams isObjectInACLGroup click on the function for a job. Link to comment
Haze Posted June 20, 2011 Author Share Posted June 20, 2011 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 Link to comment
JR10 Posted June 20, 2011 Share Posted June 20, 2011 Why are you using acl for teams? use the normal team system, and you should add user.Accountname in the group. Link to comment
Haze Posted June 20, 2011 Author Share Posted June 20, 2011 can you Make the Code for Me plz I realy Need Your Help Plz Link to comment
JR10 Posted June 20, 2011 Share Posted June 20, 2011 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. Link to comment
Haze Posted June 20, 2011 Author Share Posted June 20, 2011 Ok Thanks i Willl Try Thank you for your Help Link to comment
JR10 Posted June 20, 2011 Share Posted June 20, 2011 No problem, and when you face any problems you can post it here (with the code). Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now