Jump to content

Create class that implements Vehicle class


Piorun

Recommended Posts

Guys, i need help. I have this code:

  
function PoliceVehicle(model,position) 
    local policeVeh = Element("policeVehicle") 
    local vehicle = Vehicle(model,position) 
  
    local PoliceVehicleMT = getmetatable(policeVeh) 
    local VehicleMT = getmetatable(vehicle) 
    PoliceVehicleMT.__parent = VehicleMT 
    local PoliceVehicleClass = getmetatable(policeVeh).__class 
  
    function PoliceVehicleClass:output() 
        outputChatBox("test") 
    end 
  
    return policeVeh 
end 
  

which is contructor of PoliceVehicle class and i want to that class implement all methods from Vehicle class (and also if i for ex. write

  
local police = PoliceVehicle(...) 
police:setPosition(Vector3(x,y,z)) 
  

I want to change that object position [also vehicle]).

This code i shown doesn't work.

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