Jump to content

create vehicle that i choose


TroyBoy

Recommended Posts

addCommandHandler("createvehicle", 
    function (thePlayer, cmd, ...) 
        for index, v in ipairs({ ... }) do 
            vehicleModel = tonumber(v) 
            if (not vehicleModel) then 
                vehicleModel = getVehicleModelFromName(v) 
            end 
        end 
        local x, y, z = getElementPosition(thePlayer) 
        local vehicle = createVehicle(tonumber(vehicleModel), x, y, z) 
        if (vehicle) then 
            outputChatBox("The vehicle: ".. getVehicleName(vehicle) .." was created.",thePlayer,0,255,0) 
        end 
    end 
) 

Link to comment
addCommandHandler( 'create_vehicle', 
    function( player,_,id_name ) 
        local x,y,z = getElementPosition( player ) 
        local model = getVehicleModelFromName( id_name ) 
        if not model then 
            model = tonumber( id_name ) 
        end 
        if  createVehicle( model,x+1,y,z ) then 
            outputChatBox( 'Success created: '..tostring( getVehicleNameFromModel( model ) ) ) 
        else 
            outputChatBox( 'Vehicle not created: '..tostring( getVehicleNameFromModel( model ) ) ) 
        end 
    end 
) 

/create_vehicle [id/name]

Edited by Guest
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...