Jump to content

is it possible


tim260

Recommended Posts

is it possible to use like i did it so [team1]=true etc ? cuz its not working please help me :)

team1 = createVehicle ( 470, -1490.802734375, 2642.0087890625, 55.8359375, 0, 0, 0   ) 
team2 = createVehicle ( 470, -1490.802734375, 2642.0087890625, 55.8359375, 0, 0, 0   ) -- i know same coords just for showing 
  
militaryVehicles = { [team1]=true, [team2]=true } 
militaryTeams = {["Military"]=true,["Naval"]=true} 
  
function lockTheHydras(player, seat, jacked) 
if ( militaryVehicles[getElementModel ( source )] ) and ( getPlayerTeam( player ) ) and ( not militaryTeams[getTeamName(getPlayerTeam( player ))] ) and ( seat == 0 ) then 
        outputChatBox ( "You aren't a Military Officer , you mayn't drive this.", player ) --and tell the player why 
        cancelEvent() 
    end 
end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), lockTheHydras ) 

Link to comment

if I understood you right.

protectVehicles = { [470]=true } 
  
  
  
function enterVehicle ( player, seat, jacked ) 
    if ( protectVehicles[getElementModel(source)] ) and getTeamName(getPlayerTeam(player)) ~= "Military" and getTeamName(getPlayerTeam(player)) ~= "Naval" and ( seat == 0 ) then  
        cancelEvent() 
        outputChatBox ("You cannot enter this vehicle.", player) 
    end 
end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle )) 

Link to comment
if I understood you right.
protectVehicles = { [470]=true } 
  
  
  
function enterVehicle ( player, seat, jacked ) 
    if ( protectVehicles[getElementModel(source)] ) and getTeamName(getPlayerTeam(player)) ~= "Military" and getTeamName(getPlayerTeam(player)) ~= "Naval" and ( seat == 0 ) then  
        cancelEvent() 
        outputChatBox ("You cannot enter this vehicle.", player) 
    end 
end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle )) 

No thats all cars i just want the cars i created with createvehicle

Link to comment
team1 = createVehicle ( 470, -1490.802734375, 2642.0087890625, 55.8359375, 0, 0, 0   ) 
team2 = createVehicle ( 470, -1490.802734375, 2642.0087890625, 55.8359375, 0, 0, 0   ) -- i know same coords just for showing 
  
militaryVehicles = { [team1]=true, [team2]=true } 
militaryTeams = {["Military"]=true, ["Naval"]=true} 
  
function lockTheHydras(player, seat, jacked) 
if ( militaryVehicles[source] ) and ( getPlayerTeam( player ) ) and ( not militaryTeams[getTeamName(getPlayerTeam( player ))] ) and ( seat == 0 ) then 
        outputChatBox ( "You aren't a Military Officer , you mayn't drive this.", player ) --and tell the player why 
        cancelEvent() 
    end 
end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), lockTheHydras ) 

Link to comment
team1 = createVehicle ( 470, -1490.802734375, 2642.0087890625, 55.8359375, 0, 0, 0   ) 
team2 = createVehicle ( 470, -1490.802734375, 2642.0087890625, 55.8359375, 0, 0, 0   ) -- i know same coords just for showing 
  
militaryVehicles = { [team1]=true, [team2]=true } 
militaryTeams = {["Military"]=true, ["Naval"]=true} 
  
function lockTheHydras(player, seat, jacked) 
if ( militaryVehicles[source] ) and ( getPlayerTeam( player ) ) and ( not militaryTeams[getTeamName(getPlayerTeam( player ))] ) and ( seat == 0 ) then 
        outputChatBox ( "You aren't a Military Officer , you mayn't drive this.", player ) --and tell the player why 
        cancelEvent() 
    end 
end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), lockTheHydras ) 

ty :D

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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