Jump to content

replace a wheel


Blaawee

Recommended Posts

clientSide -------- 
function Vehicle ( )  
txd = engineLoadTXD ( "YourFileName.txd" ) 
engineImportTXD ( txd, 1082 ) 
dff = engineLoadDFF ( "YourFileName.dff", 1082 ) 
engineReplaceModel ( dff, 1082 ) 
end 
addEvent ( "replaceVeh", true ) 
addEventHandler ( "replaceVeh", getRootElement(), Vehicle ) 
  
serverSide------- 
function ReplaceT ( ) 
triggerClientEvent( "replaceVeh", getRootElement(), replaceVeh ) 
end 
addCommandHandler( "replace", ReplaceT ) 

Link to comment

Wrong + Don't give code, LET HIM LEARN FOR THE LOVE OF...

If you guys always pass whole code, how can the one who requests help, learn to script? Btw at least you could provide comments on the code, but you don't even do that!

Just give him some links to the functions and events he need, and then let him try it.

Link to comment
Wrong + Don't give code, LET HIM LEARN FOR THE LOVE OF...

If you guys always pass whole code, how can the one who requests help, learn to script? Btw at least you could provide comments on the code, but you don't even do that!

Just give him some links to the functions and events he need, and then let him try it.

o.k thx :D

Link to comment

When you copy things from another topics, try to copy them completely.

local wheels = { 
    {fileName="wheel/wheel_gn1", model=1082}, 
} 
      
function load() 
    for index, wheel in pairs(wheels) do 
    txd = engineLoadTXD ( wheel.fileName ..".txd" ) 
    engineImportTXD ( txd, wheel.model ) 
    dff = engineLoadDFF ( wheel.fileName ..".dff", 0 ) 
    engineReplaceModel ( dff, wheel.model ) 
    end 
end 
      
addEventHandler("onClientResourceStart",resourceRoot, 
function () 
    setTimer ( load, 1000, 1) 
end) 

Link to comment
And if your going to give people full code, put in comments and leave an error or two for them to learn.

Leaving error in the code you're giving is just wrong! If you'll give people code with errors, they will learn from the code which is wrong and will keep coming back asking for help again instead of having correct code. If you're leaving an error in, tell them about it otherwise you'll be the one that needs to learn before helping others.

Link to comment
If you hand everyone the answer, they won't learn anything. Sure, short-term it'll be a bit confusing, but long-term they will benefit.

I'm not saying to give them all the code. When you do, tell them what is what, what each line does or the key lines. But giving faulty code is just wrong. They'll never learn from faulty code since they will make the same mistake over and over because that's how they learnt the first time. I know what you're saying but believe me, wrong code is wrong and should not be posted. That's just making the problem even worse. Telling people where the error in their code is way better than giving them faulty code. I don't usually give the entire code out to people, I give them tips and links where they will get the answer to their problem. That makes them use wiki more since most of the answers (if not all) to their questions are there.

Lead them but in the right direction.

Now, stop the offtopic.. It's getting way too far.

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