Sadboy Posted November 26, 2017 Share Posted November 26, 2017 Ayuda, ¿cómo puedo privatizar todos los autos que haya puesto en un mapa?. Que sea solo para un determinado Team, no de ACL. Link to comment
Simple0x47 Posted November 26, 2017 Share Posted November 26, 2017 Tendrás que controlar el evento OnVehicleStartEnter. Link to comment
Sadboy Posted November 27, 2017 Author Share Posted November 27, 2017 Disculpa, soy algo nuevo, ¿me darías un ejemplo? Link to comment
Simple0x47 Posted November 27, 2017 Share Posted November 27, 2017 -- VARIABLES -- TEAM VEHICLES local team_vehicles = {} -- FUNCTIONS -- SET TEAM VEHICLE local function set_team_vehicle( thePlayer, commandName, theTeam ) if ( thePlayer ) then local vehicle = getPedOccupiedVehicle( thePlayer ) local team = getTeamFromName( theTeam ) if ( ( vehicle ) and ( team ) ) then team_vehicles[ vehicle ] = team outputChatBox( "Vehículo " .. getElementModel( vehicle ) .. " seteado para el equipo " .. getTeamName( team ), root, 0, 255, 0 ) end end end -- ENTER VEHICLE local function handle_enter( thePlayer, theSeat ) if ( ( thePlayer ) and ( theSeat ) and ( team_vehicles[ source ] ) ) then local playerTeam = getPlayerTeam( thePlayer ) local vehicleTeam = team_vehicles[ source ] if ( playerTeam ~= vehicleTeam ) then outputChatBox( "No puedes subirte a un vehículo de otro equipo. ( " .. getTeamName( vehicleTeam ) .. " )", thePlayer, 255, 0, 0 ) cancelEvent() end end end -- COMMAND HANDLERS -- SET TEAM VEHICLE addCommandHandler( "setteam", set_team_vehicle ) -- EVENT HANDLERS -- ENTER VEHICLE addEventHandler( "onVehicleStartEnter", root, handle_vehicle_enter ) Debería servirte para hacerte el sistema según tus necesidades. 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