Resmurf Posted June 13, 2011 Share Posted June 13, 2011 I want to make people dont even join the car (restricted vehicles) i got this script that kicks people out of the car, but i wanna make it to dont even join. copVehicles = { [523]=true,[598]=true[596]=true,[597]=true,[599]=true} copSkins = { [280]=true,[281]=true[282]=true,[283]=true,[284]=true,[288]=true } function copenterVehicle ( player, seat, jacked ) if ( copVehicles[getElementModel ( source )] ) and ( not copSkins[getElementModel ( player )] ) 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 ) Link to comment
BinSlayer1 Posted June 13, 2011 Share Posted June 13, 2011 copVehicles = { [523]=true,[598]=true[596]=true,[597]=true,[599]=true} copSkins = { [280]=true,[281]=true[282]=true,[283]=true,[284]=true,[288]=true } function copenterVehicle ( player, seat, jacked ) if ( copVehicles[getElementModel ( source )] ) and ( not copSkins[getElementModel ( player )] ) and ( seat == 0 ) then cancelEvent() outputChatBox ( "You aren't a Police Officer , you mayn't drive this.", player ) --and tell the player why end end addEventHandler ( "onVehicleStartEnter", getRootElement(), copenterVehicle ) Link to comment
Resmurf Posted June 13, 2011 Author Share Posted June 13, 2011 i still can join the car, then it kicks me, like i had before Link to comment
BinSlayer1 Posted June 13, 2011 Share Posted June 13, 2011 hm make sure you changed the code entirely with mine.. there's no reason why it should "kick" you out of the car now that you're not using removePedFromVehicle anymore.. onVehicleStartEnter gets triggered when the player starts entering the vehicle and afterwards it's cancelled if conditions are matched.. there should be no more entering providing you do meet the "IF" requirements. make sure u changed the whole code again Link to comment
Resmurf Posted June 13, 2011 Author Share Posted June 13, 2011 i get this this error and warning: '}' expected near '[' Link to comment
BinSlayer1 Posted June 13, 2011 Share Posted June 13, 2011 which line? post whole error.. Link to comment
karlis Posted June 13, 2011 Share Posted June 13, 2011 copVehicles = { [523]=true,[598]=true,[596]=true,[597]=true,[599]=true} copSkins = { [280]=true,[281]=true,[282]=true,[283]=true,[284]=true,[288]=true } function copenterVehicle ( player, seat, jacked ) if ( copVehicles[getElementModel ( source )] ) and ( not copSkins[getElementModel ( player )] ) 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 ) there was obvious syntax errors in the tables. Link to comment
Resmurf Posted June 13, 2011 Author Share Posted June 13, 2011 Thansk both now its working 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