Jump to content

[HELP] with Error fix


cratzy42O

Recommended Posts

:shock::shock: So as first idk if is a right place to post here about my problem

here you go The codes ... .lua scrip Resource in folder file

lua code

function ReplaceCar() 
txd = engineLoadTXD('buffalo.txd', 402) 
engineImportTXD(txd, 402) 
dff = engineLoadDFF('buffalo.dff', 402) 
engineReplaceModel(dff, 402) 
end 
addEventHandler( 'onClientResourceStart', getResourceRootElement(getThisResource()), ReplaceCar) 
  

Error ?

here


  • attemp to call global "getThisResource" (a nil value)

Link to comment

yup i got this in meta

  
<meta> 
<info author="CraTzy" description="fasat BMW model" version="1.3" type="script" /> 
<script src="client.lua" type="client"/> 
<file src="buffalo.dff" type="client"/> 
<file src="buffalo.txd" type="client"/> 
</meta> 
  

ERROR STILL POP UP

Link to comment
yup i got this in meta

  
<meta> 
<info author="CraTzy" description="fasat BMW model" version="1.3" type="script" /> 
<script src="client.lua" type="client"/> 
<file src="buffalo.dff" type="client"/> 
<file src="buffalo.txd" type="client"/> 
</meta> 
  

ERROR STILL POP UP

"CraTzy" description="fasat BMW model" version="1.3" type="script" /> 

Link to comment
function replaceskin()  --- i change it to replaceskin for vehicle 
    txd = engineLoadTXD ( "buffalo.txd" ) ---file.txd 
    engineImportTXD ( txd, 402) 
    dff = engineLoadDFF ( "buffalo.dff", 402)  -- file.dff 
    engineReplaceModel ( dff, 402) 
end 
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceskin) ---- here when the mod started the skin will be automatic changed 

Link to comment
function replaceskin()  --- i change it to replaceskin for vehicle 
    txd = engineLoadTXD ( "buffalo.txd" ) ---file.txd 
    engineImportTXD ( txd, 402) 
    dff = engineLoadDFF ( "buffalo.dff", 402)  -- file.dff 
    engineReplaceModel ( dff, 402) 
end 
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceskin) ---- here when the mod started the skin will be automatic changed 

bro i am sorry always same error i just copy/paste whole code and .. Shiet.. same error ii am bored of it whole day trying to fix it

EDIT: getThisResource makes error in lua :(

Edited by Guest
Link to comment

Tested and worked.

meta.xml

"TEST" description="TEST" version="TEST" type="script" /> 

client-side:

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

Link to comment
Actually this work too.

meta.xml

"TEST" description="TEST" version="TEST" type="script" /> 

client-side:

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

you forget add

function replaceskin() 

Link to comment
Tested and worked.

meta.xml

"TEST" description="TEST" version="TEST" type="script" /> 

client-side:

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

luaedit Gives me always same error :(

Link to comment
Tested and worked.

meta.xml

"TEST" description="TEST" version="TEST" type="script" /> 

client-side:

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

luaedit Gives me always same error :(

So you're doing something wrong. For me it is functioning normally.

Use this:

1 - use /refreshall

2 - restart script

and tell me if work.

Link to comment
Actually this work too.

meta.xml

"TEST" description="TEST" version="TEST" type="script" /> 

client-side:

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

you forget add

function replaceskin() 

no? if i use this i don't must use function name.

Link to comment
Tested and worked.

meta.xml

"TEST" description="TEST" version="TEST" type="script" /> 

client-side:

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

luaedit Gives me always same error :(

So you're doing something wrong. For me it is functioning normally.

Use this:

1 - use /refreshall

2 - restart script

and tell me if work.

ill go try ingame this i am scares the Folder of Server is frozen to yesterday date because the logo files dont output in current time it output yesterday date 12pm :(

EDIT: yes ingame works all fine i just ignored the "Error"

anyway thanks for nice help

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