Mike269 Posted August 15, 2014 Posted August 15, 2014 I made base and at base I spawned vehicles how could I lock vehicles only for team?
DNL291 Posted August 15, 2014 Posted August 15, 2014 'onVehicleStartEnter' getPlayerTeam getTeamName cancelEvent() Please do not PM me with scripting related question nor support, use the forums instead.
Anubhav Posted August 15, 2014 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 ) See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
#DRAGON!FIRE Posted August 15, 2014 Posted August 15, 2014 addEventHandler( "onVehicleStartEnter", resourceRoot, function( player ) if ( getPlayerTeam ( player ) and getPlayerTeam ( player ) ~= getTeamFromName ( "Team Name" ) ) then cancelEvent ( true ) end end ) To Contact Me at Skype : [email protected]
Anubhav Posted August 15, 2014 Posted August 15, 2014 That won't work. You must add getTeamName for it. See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
#DRAGON!FIRE Posted August 15, 2014 Posted August 15, 2014 That won't work. You must add getTeamName for it. ?? .. your code wrong To Contact Me at Skype : [email protected]
Castillo Posted August 15, 2014 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. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Mike269 Posted August 15, 2014 Author Posted August 15, 2014 Still don't know how to make vehicles for team
#DRAGON!FIRE Posted August 16, 2014 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 ) To Contact Me at Skype : [email protected]
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