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 ) 

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.

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?

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

Posted

I will look into this a lot deeper, thanx for the info, but how did you get the model id, not the texture id?

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