Jump to content

¿como puedo hacer esto?


Recommended Posts

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
  • MTA Team
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

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
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
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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...