Dardex Posted June 24, 2013 Share Posted June 24, 2013 Hey guys I would like to ask if there is any script that allows only cops to enter in Police cars, if not is there any way to create it. Link to comment
iPrestege Posted June 24, 2013 Share Posted June 24, 2013 onVehicleStartEnter Read the wiki and the example . Link to comment
EstrategiaGTA Posted June 24, 2013 Share Posted June 24, 2013 Hey it's Dardex :'O I know you :'3 Link to comment
Dardex Posted June 24, 2013 Author Share Posted June 24, 2013 I know you too but not place to talk Link to comment
Dardex Posted June 24, 2013 Author Share Posted June 24, 2013 Prestage if i want it only for groups not for skin is it possible Link to comment
Blaawee Posted June 24, 2013 Share Posted June 24, 2013 Prestage if i want it only for groups not for skin is it possible What do you mean by groups ?! Is are they in teams or aclGroup or data ? Link to comment
Dardex Posted June 24, 2013 Author Share Posted June 24, 2013 Sorry i mean for teams I created Police team.And if it is possible that police cars can be usable only from Police team. Link to comment
Blaawee Posted June 24, 2013 Share Posted June 24, 2013 Try this: policeVehicles = { [598]=true,[596]=true,[597]=true,[599]=true }; addEventHandler ( 'onVehicleStartEnter', root function( player ) if policeVehicles[ getElementModel( source ) ] and not getTeamName( getPlayerTeam ( player ) ) == 'Police' then cancelEvent() end end end ) Link to comment
Dardex Posted June 24, 2013 Author Share Posted June 24, 2013 Try this: policeVehicles = { [598]=true,[596]=true,[597]=true,[599]=true }; addEventHandler ( 'onVehicleStartEnter', root function( player ) if policeVehicles[ getElementModel( source ) ] and not getTeamName( getPlayerTeam ( player ) ) == 'Police' then cancelEvent() end end end ) policeVehicles = { [598]=true,[596]=true,[597]=true,[599]=true }; addEventHandler ( 'onVehicleStartEnter', root ) function( player ) if policeVehicles[ getElementModel( source ) ] and not getTeamName( getPlayerTeam ( player ) ) == 'POLICE' then cancelEvent() end end end ) forgot to close addEventHandler but now it says "" expected near "(" and script failed to start Link to comment
iPrestege Posted June 24, 2013 Share Posted June 24, 2013 Try this: policeVehicles = { [598]=true,[596]=true,[597]=true,[599]=true }; addEventHandler ( 'onVehicleStartEnter', root function( player ) if policeVehicles[ getElementModel( source ) ] and not getTeamName( getPlayerTeam ( player ) ) == 'Police' then cancelEvent() end end end ) policeVehicles = { [598]=true,[596]=true,[597]=true,[599]=true }; addEventHandler ( 'onVehicleStartEnter', root ) function( player ) if policeVehicles[ getElementModel( source ) ] and not getTeamName( getPlayerTeam ( player ) ) == 'POLICE' then cancelEvent() end end end ) forgot to close addEventHandler but now it says "" expected near "(" and script failed to start No he just forget comma . Link to comment
Dardex Posted June 24, 2013 Author Share Posted June 24, 2013 policeVehicles = { [598]=true,[596]=true,[597]=true,[599]=true }; addEventHandler ( 'onVehicleStartEnter', root function( player ) if policeVehicles[ getElementModel( source ) ] and not getTeamName( getPlayerTeam ( player ) ) == 'Police' then cancelEvent() end end end ) Can you fix this Link to comment
iPrestege Posted June 24, 2013 Share Posted June 24, 2013 (edited) policeVehicles = { [598]=true,[596]=true,[597]=true,[599]=true }; addEventHandler ( 'onVehicleStartEnter', root function( player ) if policeVehicles[ getElementModel( source ) ] and not getTeamName( getPlayerTeam ( player ) ) == 'Police' then cancelEvent() end end end ) Can you fix this policeVehicles = { [598]=true,[596]=true,[597]=true,[599]=true }; addEventHandler ( 'onVehicleStartEnter', root, function( player ) if policeVehicles[ getElementModel( source ) ] and not getTeamName( getPlayerTeam ( player ) ) == 'Police' then cancelEvent() end end ) just a comma . Edited June 24, 2013 by Guest Link to comment
Dardex Posted June 24, 2013 Author Share Posted June 24, 2013 policeVehicles = { [598]=true,[596]=true,[597]=true,[599]=true }; addEventHandler ( 'onVehicleStartEnter', root, function( player ) if policeVehicles[ getElementModel( source ) ] and not getTeamName( getPlayerTeam ( player ) ) == 'Police' then cancelEvent() end end end ) i did this but look what it says: ')' expected (to close '(' at line 3) near 'end' Link to comment
iPrestege Posted June 24, 2013 Share Posted June 24, 2013 policeVehicles = { [598]=true,[596]=true,[597]=true,[599]=true }; addEventHandler ( 'onVehicleStartEnter', root, function( player ) if policeVehicles[ getElementModel( source ) ] and not getTeamName( getPlayerTeam ( player ) ) == 'Police' then cancelEvent() end end end ) i did this but look what it says: ')' expected (to close '(' at line 3) near 'end' That's because there'a an extra end remove one . Link to comment
EstrategiaGTA Posted June 25, 2013 Share Posted June 25, 2013 There's an extra end. Use this code: policeVehicles = { [598]=true,[596]=true,[597]=true,[599]=true }; addEventHandler ( 'onVehicleStartEnter', root, function( player ) if policeVehicles[ getElementModel( source ) ] and not getTeamName( getPlayerTeam ( player ) ) == 'Police' then cancelEvent() end end ) Link to comment
iMr.3a[Z]eF Posted June 25, 2013 Share Posted June 25, 2013 policeVehicles = { [598]=true,[596]=true,[597]=true,[599]=true }; addEventHandler ( 'onVehicleStartEnter', root, function( player ) if policeVehicles[ getElementModel( source ) ] and not getTeamName( getPlayerTeam ( player ) ) == 'Police' then cancelEvent() end end end ) i did this but look what it says: ')' expected (to close '(' at line 3) near 'end' dude, there is function and if and you put 3 ends under policeVehicles = { [598]=true,[596]=true,[597]=true,[599]=true }; addEventHandler ( 'onVehicleStartEnter', root, function( player ) if policeVehicles[ getElementModel( player ) ] and not getTeamName( getPlayerTeam ( player ) ) == 'Police' then cancelEvent() end end ) try it 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