Jump to content

[Ayuda] Privatizad autos por team


Atouk

Recommended Posts

asi esta bien?

vehicle1 = createVehicle( 411, -3207.15234375, 404.6005859375, 1.4312574863434, 0, 0, 0 ) 
function private() 
    if ( source == vehicle1 ) then 
local playerTeam = getPlayerTeam ( source ) 
team = getTeamName  (  E.P.A.Z ) 
cancelEvent() 
outputChatBox("Este vehiculo esta reservado para el clan: E.P.A.Z . ", player, 255, 0, 0, false) 
else 
outputChatBox("Bienvenido al vehiculo de E.P.A.Z.", player, 0, 255, 0, false) 
end 
end 
end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), private ) 

Link to comment
team = getTeamName  (  E.P.A.Z ) 

'getTeamName' te pide un elemento de team.

local playerTeam = getPlayerTeam ( source ) 

'source' es un vehiculo, no un jugador.

outputChatBox("Bienvenido al vehiculo de E.P.A.Z.", player, 0, 255, 0, false) 

'player' no esta definido.

Link to comment

no entendi mucho pero asi esta bien?

vehicle1 = createVehicle( 411, -3207.15234375, 404.6005859375, 1.4312574863434, 0, 0, 0 ) 
function private() 
    if ( source == vehicle1 ) then 
local playerTeam = getPlayerTeam ( player ) 
team = getTeamName  (  E.P.A.Z ) 
local player = getLocalPlayer ( ) 
cancelEvent() 
outputChatBox("Este vehiculo esta reservado para el clan: E.P.A.Z . ", player, 255, 0, 0, false) 
end 
end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), private ) 

tenganme paciencia porfavor no soy tan bueno.

Link to comment

Intenta así

vehicle1 = createVehicle( 411, -3207.15234375, 404.6005859375, 1.4312574863434, 0, 0, 0 ) 
  
function private ( thePlayer, seat, jacked ) 
    if ( source == vehicle1  ) and ( getPlayerTeam(thePlayer) and getTeamName(getPlayerTeam(thePlayer)) ~= "E.P.A.Z" ) then 
      outputChatBox("Este vehiculo esta reservado para el clan: E.P.A.Z", thePlayer, 255,90,0, true) 
    end 
end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), private) 

Link to comment
Intenta así
vehicle1 = createVehicle( 411, -3207.15234375, 404.6005859375, 1.4312574863434, 0, 0, 0 ) 
  
function private ( thePlayer, seat, jacked ) 
    if ( source == vehicle1  ) and ( getPlayerTeam(thePlayer) and getTeamName(getPlayerTeam(thePlayer)) ~= "E.P.A.Z" ) then 
      outputChatBox("Este vehiculo esta reservado para el clan: E.P.A.Z", thePlayer, 255,90,0, true) 
    end 
end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), private) 

Y donde cancelas el evento cuando el player entra al auto?.

Link to comment
  • Recently Browsing   0 members

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