Jump to content

Question - CJ "moto" Helmet


manve1

Recommended Posts

Posted
I Found this on the Wiki...

*Serverside

function addHelmetOnEnter ( theVehicle, seat, jacked ) 
    if ( getElementModel ( theVehicle ) == 522 ) then -- if its a nrg 
        addPedClothes ( source, "moto", "moto", 16 ) -- add the helmet 
    end 
end 
addEventHandler ( "onPlayerVehicleEnter", getRootElement(), addHelmetOnEnter ) 
  
function removeHelmetOnExit ( theVehicle, seat, jacked ) 
    if ( getElementModel ( theVehicle ) == 522 ) then -- if its a nrg 
        removePedClothes ( source, 16 ) -- remove the helmet 
    end 
end 
addEventHandler ( "onPlayerVehicleExit", getRootElement(), removeHelmetOnExit ) 

No, he wants to replace it with another texture.

@manve1: You can find the ID (or the name) on this page: https://wiki.multitheftauto.com/wiki/Cl ... ponent_IDs

Example:

txd = engineLoadTXD("textureName.txd") 
engineImportTXD( txd, 30403 ) 

Please do not PM me with scripting related question nor support, use the forums instead.

Posted

I did not understand why you said "replace the model", it really confused me (the model in this case is the helmet (?)).

Anyway sorry for the misunderstanding.

Please do not PM me with scripting related question nor support, use the forums instead.

Posted

WARNING: script\client:13: Bad usage @ 'engineReplaceModel' [Model ID 30403 replace failed]

As far as i know this error suggests that there isn't a model with an ID of 30403?

Looking for tutorials or information? check out: www.simpleask.co.uk

Posted

30403 is the texture ID of the helm, you need the Model ID to get that fixed I guess. Vehicle's do have the same ID's but clothes etc doesn't. I replaced a necklace with a flower band for a hawai party a few weeks ago. :P

logo-small.png?v=3 tiny-sapdfr.png

 

If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]

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