depato123 Posted June 27, 2013 Share Posted June 27, 2013 Quiero cambiar este script para que enves de darle permiso a alguien para subir a un vehiculo por skin lo cambie por team limoVehicles = { [409]=true } limoSkins = { [255]=true } function limoenterVehicle ( player, seat, jacked ) if ( limoVehicles[getElementModel ( source )] ) and ( not limoSkins[getElementModel ( player )] ) and ( seat == 0 ) then removePedFromVehicle ( player ) outputChatBox ( "Este vehículo no es de tu trabajo.", player ) end end addEventHandler ( "onVehicleEnter", getRootElement(), limoenterVehicle ) Link to comment
Castillo Posted June 27, 2013 Share Posted June 27, 2013 Usa getPlayerTeam + getTeamName Link to comment
depato123 Posted June 27, 2013 Author Share Posted June 27, 2013 Usa getPlayerTeam + getTeamName ¿Me podrías dar algún ejemplo, no entendí los de la wiki? Link to comment
AlvareZ_ Posted June 27, 2013 Share Posted June 27, 2013 (edited) Usa esto: local playerTeam = getPlayerTeam(player) if (getTeamName(playerTeam) == "TuTeam") Edited June 28, 2013 by Guest Link to comment
MTA Team 0xCiBeR Posted June 27, 2013 MTA Team Share Posted June 27, 2013 limoVehicles = { [409]=true } limoSkins = { [255]=true } function limoenterVehicle ( player, seat, jacked ) local clan = getPlayerTeam ( player ) local clanPermitido = "Admin" local clannombre = getTeamName ( clan ) if ( limoVehicles[getElementModel ( source )] ) and (clannombre == clanPermitido) and ( seat == 0 ) then cancelEvent () outputChatBox ( "Este vehículo no es de tu trabajo.", player ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), limoenterVehicle ) Algo asi seria, cambie tu evento a onVehicleStartEnter para cancelar la entrada si no sos del team.. No esta probado..Dime si funciona y si no avisame del error Link to comment
BorderLine Posted June 28, 2013 Share Posted June 28, 2013 intenta asi limoVehicles = { [409]=true } limoSkins = { [255]=true } function limoenterVehicle ( player, seat, jacked ) team = getPlayerTeam(player) tName = getTeamName(team) if ( limoVehicles[getElementModel ( source )] ) and ( tName == "Conductor Limucina" ) and ( seat == 0 ) then -- fuera el caso si el team se llama conductor limucina. hay lo cambias --removePedFromVehicle ( player )-- te recomiendo omitir esta linea y usar cancelEvent outputChatBox ( "Este vehículo no es de tu trabajo.", player ) cancelEvent() end end addEventHandler ( "onVehicleEnter", getRootElement(), limoenterVehicle ) Link to comment
depato123 Posted June 28, 2013 Author Share Posted June 28, 2013 intenta asi limoVehicles = { [409]=true } limoSkins = { [255]=true } function limoenterVehicle ( player, seat, jacked ) team = getPlayerTeam(player) tName = getTeamName(team) if ( limoVehicles[getElementModel ( source )] ) and ( tName == "Conductor Limucina" ) and ( seat == 0 ) then -- fuera el caso si el team se llama conductor limucina. hay lo cambias --removePedFromVehicle ( player )-- te recomiendo omitir esta linea y usar cancelEvent outputChatBox ( "Este vehículo no es de tu trabajo.", player ) cancelEvent() end end addEventHandler ( "onVehicleEnter", getRootElement(), limoenterVehicle ) lo edite así pero no funciono limoVehicles = { [409]=true } limoSkins = { [255]=true } function limoenterVehicle ( player, seat, jacked ) team = getPlayerTeam(player) tName = getTeamName(team) if ( limoVehicles[getElementModel ( source )] ) and ( tName == "Pilotos de limosina" ) and ( seat == 0 ) then -- fuera el caso si el team se llama conductor limucina. hay lo cambias removePedFromVehicle ( player )-- te recomiendo omitir esta linea y usar cancelEvent outputChatBox ( "Este vehículo no es de tu trabajo.", player ) cancelEvent() end end addEventHandler ( "onVehicleEnter", getRootElement(), limoenterVehicle ) Link to comment
BorderLine Posted June 28, 2013 Share Posted June 28, 2013 algun error el debug? quita la linea de removePedFromVehicle Link to comment
depato123 Posted June 28, 2013 Author Share Posted June 28, 2013 algun error el debug? quita la linea de removePedFromVehicle listo pero me sigue dejando usar el automóvil yo tengo así el "createteam" teamlimo = createTeam ( "Pilotos de limosina", 0, 150, 255 ) Link to comment
Castillo Posted June 28, 2013 Share Posted June 28, 2013 limoVehicles = { [ 409 ] = true } function limoenterVehicle ( player, seat, jacked ) local team = getPlayerTeam ( player ) if ( limoVehicles [ getElementModel ( source ) ] ) and ( not team or getTeamName ( team ) ~= "Pilotos de limosina" ) and ( seat == 0 ) then removePedFromVehicle ( player )-- te recomiendo omitir esta linea y usar cancelEvent outputChatBox ( "Este vehículo no es de tu trabajo.", player ) cancelEvent ( ) end end addEventHandler ( "onVehicleEnter", getRootElement(), limoenterVehicle ) Link to comment
Recommended Posts