Jump to content

Really new to LUA lol


xXBaddaBingXx

Recommended Posts

Hey, I just wanted to ask and stuff I already know how to add like the custom models to the script but I don't know where to put the models at like the custom models? If you could also try to explain to me how to add like custom handling and stuff I'm just trying to start a server with a few friends and have some fun with modding and playing online lol. Thanks for your kind help it be so much appreciated.

Link to comment

Here is an example code:

function ClientStarted() 
  
txd = engineLoadTXD ("infernus.txd") 
engineImportTXD (txd, 411) 
dff = engineLoadDFF ("infernus.dff") 
engineReplaceModel (dff, 411) 
end 
addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), ClientStarted ) 

Meta file for simplish:

<meta> 
    <script src="client.lua" type="client" /> 
    <file src="infernus.txd" /> 
    <file src="infernus.dff" /> 
</meta> 

Make sure you have script and the 1 (or 2 files if you include custom dff) in the resource folder.

Link to comment

I put two custom Infernus files into the freeroam folder located under server > mods > deathmatch > resources-cache > unzipped > freeroam > infernus.dff, and infernus.txd. Did i do the following correctly?

I put in the fr_client.lua and click saved I didn't go to compile.

addEventHandler('onClientResourceStart', getResourceRootElement(getThisResource()), ClientStarted ) 
    function() 
        fadeCamera(true) 
        setTimer(getPlayers, 1000, 1) 
         
  
        txd = engineLoadTXD ("infernus.txd") 
        engineImportTXD (txd, 411) 
        dff = engineLoadDFF ("infernus.dff") 
        engineReplaceModel (dff, 411) 
        bindKey('f1', 'down', toggleFRWindow) 
        createWindow(wndMain) 
        hideAllWindows() 
        guiCheckBoxSetSelected(getControl(wndMain, 'jetpack'), doesPedHaveJetPack(g_Me)) 
        guiCheckBoxSetSelected(getControl(wndMain, 'falloff'), canPedBeKnockedOffBike(g_Me)) 
        setJetpackMaxHeight ( 9001 ) 
        triggerServerEvent('onLoadedAtClient', g_ResRoot, g_Me) 
    end 
) 

For the meta.xml just a snippet of it:

<info name="Freeroam GUI" author="arc_" version="1.3.4" /> 
     
    <script src="util_server.lua" type="server" /> 
    <script src="fr_server.lua" type="server" /> 
     
    <script src="util.lua" type="client" /> 
    <script src="gui.lua" type="client" /> 
    <script src="fr_client.lua" type="client" /> 
  
     
    <export function="appendControl" type="client" /> 
     
    <file src="colorselect.png" /> 
    <file src="localplayerblip.png" /> 
    <file src="map.png" /> 
    <file src="playerblip.png" /> 
    <file src="vehiclecolors.png" /> 
        <file src="infernus.txd" /> 
    <file src="infernus.dff" /> 

Link to comment

I done the following, now I'm just having a issue with the car not showing up any suggestions :S? I copied the freeroam the one that came with the MTA install and I put the lines in the meta.xml and then I put the lines of the TXD and DFF under the OnClientResourceStarted like this:

addEventHandler('onClientResourceStart', g_ResRoot,getResourceRootElement(getThisResource()), ClientStarted ) 
  
  
  
    function() 
        fadeCamera(true) 
        setTimer(getPlayers, 1000, 1) 
         
        bindKey('f1', 'down', toggleFRWindow) 
        createWindow(wndMain) 
        hideAllWindows() 
        txd = engineLoadTXD ("infernus.txd") 
        engineImportTXD (txd, 411) 
        dff = engineLoadDFF ("infernus.dff") 
        engineReplaceModel (dff, 411) 
        guiCheckBoxSetSelected(getControl(wndMain, 'jetpack'), doesPedHaveJetPack(g_Me)) 
        guiCheckBoxSetSelected(getControl(wndMain, 'falloff'), canPedBeKnockedOffBike(g_Me)) 
        setJetpackMaxHeight ( 9001 ) 
        triggerServerEvent('onLoadedAtClient', g_ResRoot, g_Me) 
    end 
) 

I merged the code from this into the code above this one.

function ClientStarted() 
txd = engineLoadTXD ("infernus.txd") 
engineImportTXD (txd, 411) 
dff = engineLoadDFF ("infernus.dff") 
engineReplaceModel (dff, 411) 
end 

Link to comment
addEventHandler("onClientResourceStart", g_ResRoot,getResourceRootElement(getThisResource()),  
function() 
        fadeCamera(true) 
        setTimer(getPlayers, 1000, 1) 
        bindKey('f1', 'down', toggleFRWindow) 
        createWindow(wndMain) 
        hideAllWindows() 
        txd = engineLoadTXD ("infernus.txd") 
        engineImportTXD (txd, 411) 
        dff = engineLoadDFF ("infernus.dff") 
        engineReplaceModel (dff, 411) 
        guiCheckBoxSetSelected(getControl(wndMain, 'jetpack'), doesPedHaveJetPack(g_Me)) 
        guiCheckBoxSetSelected(getControl(wndMain, 'falloff'), canPedBeKnockedOffBike(g_Me)) 
        setJetpackMaxHeight ( 9001 ) 
        triggerServerEvent('onLoadedAtClient', g_ResRoot, g_Me) 
    end 
) 

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