ISOFX Posted June 8, 2015 Share Posted June 8, 2015 I have some code here but i get these two errors: error C2361: initialization of 'hash' is skipped by 'default' label error C2361: initialization of 'object' is skipped by 'default' label My Code - case 8: Hash hash = GAMEPLAY::GET_HASH_KEY("prop_cs_fuel_nozle"); STREAMING::REQUEST_MODEL(hash); while (!STREAMING::HAS_MODEL_LOADED(hash)) //Put a ; if this doesnt work WAIT(0); Object object = OBJECT::CREATE_OBJECT(hash, 0, 0, 0, true, true, false); ENTITY::ATTACH_ENTITY_TO_ENTITY(object, playerPed, 0x49d9, -0.58, 0.45, -0.07, 0.0, 0.0, 0.0, false, false, false, false, 2, true); break; Can anyone fix these errors? Link to comment Share on other sites More sharing options...
Fireboyd78 Posted June 8, 2015 Share Posted June 8, 2015 You have to post your entire code. And use either pastebin or the code tag so your code doesn't look so messy. ChOcOsKiZo 1 Link to comment Share on other sites More sharing options...
outlier Posted June 8, 2015 Share Posted June 8, 2015 You can fix it 2 ways. 1) Declare hash/object before the switch statement 2) Enclose the case in curly brackets i.e. case 8:{ Hash hash = GAMEPLAY::GET_HASH_KEY("prop_cs_fuel_nozle"); STREAMING::REQUEST_MODEL(hash); while (!STREAMING::HAS_MODEL_LOADED(hash)) //Put a ; if this doesnt work WAIT(0); Object object = OBJECT::CREATE_OBJECT(hash, 0, 0, 0, true, true, false); ENTITY::ATTACH_ENTITY_TO_ENTITY(object, playerPed, 0x49d9, -0.58, 0.45, -0.07, 0.0, 0.0, 0.0, false, false, false, false, 2, true);}break; Fireboyd78 1 Link to comment Share on other sites More sharing options...
ISOFX Posted June 9, 2015 Author Share Posted June 9, 2015 You can fix it 2 ways. 1) Declare hash/object before the switch statement 2) Enclose the case in curly brackets i.e. case 8:{ Hash hash = GAMEPLAY::GET_HASH_KEY("prop_cs_fuel_nozle"); STREAMING::REQUEST_MODEL(hash); while (!STREAMING::HAS_MODEL_LOADED(hash)) //Put a ; if this doesnt work WAIT(0); Object object = OBJECT::CREATE_OBJECT(hash, 0, 0, 0, true, true, false); ENTITY::ATTACH_ENTITY_TO_ENTITY(object, playerPed, 0x49d9, -0.58, 0.45, -0.07, 0.0, 0.0, 0.0, false, false, false, false, 2, true);}break; Thanks! I will try this afterwards. Also do you know how to attach it to a bone? Isn't it something like GET_BONE_INDEX? Link to comment Share on other sites More sharing options...
MrPancakes Posted June 9, 2015 Share Posted June 9, 2015 (edited) You can fix it 2 ways. 1) Declare hash/object before the switch statement 2) Enclose the case in curly brackets i.e. case 8:{ Hash hash = GAMEPLAY::GET_HASH_KEY("prop_cs_fuel_nozle"); STREAMING::REQUEST_MODEL(hash); while (!STREAMING::HAS_MODEL_LOADED(hash)) //Put a ; if this doesnt work WAIT(0); Object object = OBJECT::CREATE_OBJECT(hash, 0, 0, 0, true, true, false); ENTITY::ATTACH_ENTITY_TO_ENTITY(object, playerPed, 0x49d9, -0.58, 0.45, -0.07, 0.0, 0.0, 0.0, false, false, false, false, 2, true);}break; Thanks! I will try this afterwards. Also do you know how to attach it to a bone? Isn't it something like GET_BONE_INDEX? Third param is the bone index. 0x49d9 (the index your currently using) attaches to the players left wrist. here are some bone indexes: http://pastebin.com/D7JMnX1g Edited June 9, 2015 by MrPancakes Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now