depato123 Posted June 27, 2013 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 )
Castillo Posted June 27, 2013 Posted June 27, 2013 Usa getPlayerTeam + getTeamName San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
depato123 Posted June 27, 2013 Author Posted June 27, 2013 Usa getPlayerTeam + getTeamName ¿Me podrías dar algún ejemplo, no entendí los de la wiki?
AlvareZ_ Posted June 27, 2013 Posted June 27, 2013 (edited) Usa esto: local playerTeam = getPlayerTeam(player) if (getTeamName(playerTeam) == "TuTeam") Edited June 28, 2013 by Guest
MTA Team 0xCiBeR Posted June 27, 2013 MTA Team 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 DevOps Engineer, Cloud Advocate & Security Engineer(Red Team) | Coffee, Containers & Burp
BorderLine Posted June 28, 2013 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 ) Actual Nick: [XGN]BorderLine Actual Clan: XLatino Actual Status: Staff, Mod Level 1 (BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline
depato123 Posted June 28, 2013 Author 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 )
BorderLine Posted June 28, 2013 Posted June 28, 2013 algun error el debug? quita la linea de removePedFromVehicle Actual Nick: [XGN]BorderLine Actual Clan: XLatino Actual Status: Staff, Mod Level 1 (BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline
depato123 Posted June 28, 2013 Author 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 )
Castillo Posted June 28, 2013 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 ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Castillo Posted June 28, 2013 Posted June 28, 2013 De nada. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Recommended Posts