Mike269 Posted August 15, 2014 Share Posted August 15, 2014 I made base and at base I spawned vehicles how could I lock vehicles only for team? Link to comment
DNL291 Posted August 15, 2014 Share Posted August 15, 2014 'onVehicleStartEnter' getPlayerTeam getTeamName cancelEvent() Link to comment
Mike269 Posted August 15, 2014 Author Share Posted August 15, 2014 What do u mean with that? Link to comment
Anubhav Posted August 15, 2014 Share Posted August 15, 2014 local myVehi = createVehicle(...) setElementData(myVehi, "car-team", "yourTeamName") addEventHandler('onVehicleStartEnter', root, function(enteringPlayer, seat, jacked, door) if not getTeamName(getPlayerTeam(enteringPlayer)) == getElementData(source, "car-team") then cancelEvent() end end ) Link to comment
#DRAGON!FIRE Posted August 15, 2014 Share Posted August 15, 2014 addEventHandler( "onVehicleStartEnter", resourceRoot, function( player ) if ( getPlayerTeam ( player ) and getPlayerTeam ( player ) ~= getTeamFromName ( "Team Name" ) ) then cancelEvent ( true ) end end ) Link to comment
Anubhav Posted August 15, 2014 Share Posted August 15, 2014 That won't work. You must add getTeamName for it. Link to comment
#DRAGON!FIRE Posted August 15, 2014 Share Posted August 15, 2014 That won't work. You must add getTeamName for it. ?? .. your code wrong Link to comment
Castillo Posted August 15, 2014 Share Posted August 15, 2014 That won't work. You must add getTeamName for it. Makes no difference, it's the same as comparing the team name. Link to comment
Mike269 Posted August 15, 2014 Author Share Posted August 15, 2014 Still don't know how to make vehicles for team Link to comment
#DRAGON!FIRE Posted August 16, 2014 Share Posted August 16, 2014 put this code in your script ( team vehicles ) .. and make the vehicles addEventHandler( "onVehicleStartEnter", resourceRoot, function( player ) if ( getPlayerTeam ( player ) and getPlayerTeam ( player ) ~= getTeamFromName ( "Team Name" ) ) then cancelEvent ( true ) end end ) 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