Jump to content

Team Vehicles HELP


Mike269

Recommended Posts

try this

     
 veh = createVehicle( 519, 0, 0, 3) 
  
 function privateCar (thePlayer) 
     if source == veh  then 
        local playerTeam = getPlayerTeam ( thePlayer ) 
     local Clann = getTeamFromName ( "Your Team name" ) 
    if ( playerTeam ) == Clann then 
       outputChatBox ( "Welcome to your private car.", thePlayer, 0, 255, 0 ) 
    else 
     cancelEvent () 
     outputChatBox ( "This this a private car.", thePlayer, 255, 0, 0 ) 
     end 
     end 
     end 
addEventHandler ( "onVehicleStartEnter", root,privateCar ) 
  

Link to comment
local vehicleTable = {} 
  
table.insert ( vehicleTable, createVehicle ( model, x, y, z ) ) 

That should get you started, but why do you want to store them in a table... would be easier to do with a small database. :)

everyone have a way so i prefer my way

Link to comment
local vehicleTable = {} 
  
table.insert ( vehicleTable, createVehicle ( model, x, y, z ) ) 

That should get you started, but why do you want to store them in a table... would be easier to do with a small database. :)

everyone have a way so i prefer my way

That's true, but I did like to start a discussion with you about this. If you don't mind, feel free to send me a PM if you're willing to start this discussion. :lol:

Link to comment

So I must make script like that?

local vehicleTable = {} 
  
table.insert ( vehicleTable, createVehicle ( model, x, y, z ) ) 
table.insert ( vehicleTable, createVehicle ( model, x, y, z ) ) 
table.insert ( vehicleTable, createVehicle ( model, x, y, z ) ) 
table.insert ( vehicleTable, createVehicle ( model, x, y, z ) ) 
  
function privateCar (thePlayer) 
     if source == veh  then 
        local playerTeam = getPlayerTeam ( thePlayer ) 
     local Clann = getTeamFromName ( "Your Team name" ) 
    if ( playerTeam ) == Clann then 
       outputChatBox ( "Welcome to your private car.", thePlayer, 0, 255, 0 ) 
    else 
     cancelEvent () 
     outputChatBox ( "This this a private car.", thePlayer, 255, 0, 0 ) 
     end 
     end 
     end 
addEventHandler ( "onVehicleStartEnter", root,privateCar ) 

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...