PlsGoobez Posted May 11, 2016 Share Posted May 11, 2016 So I'm trying to give the player weapons with this code: CPed *k = FindPlayerPed(-1); k->GiveWeapon(WEAPON_M4, 10, true); k->SetCurrentWeapon(WEAPON_M4); and it gives the weapon to the player, but it is invisible and the anim for holding the weapon doesn't show. Is there a function to load the weapon model to memory or something? Am I missing something here? The_GTA 1 Link to comment Share on other sites More sharing options...
HeresOtis Posted May 13, 2016 Share Posted May 13, 2016 You need to load the weapon model and then execute the GiveWeapon and SetCurrentWeapon functions. Link to comment Share on other sites More sharing options...
PlsGoobez Posted May 13, 2016 Author Share Posted May 13, 2016 Do you know what the function is to load models in the SDK? Link to comment Share on other sites More sharing options...
HeresOtis Posted May 13, 2016 Share Posted May 13, 2016 You have to make use of CStreaming, which I put together. http://pastebin.com/tzucu1zr http://pastebin.com/Pam7npZE Ex. CStreaming::RequestModel(modelId, 8);CStreaming::LoadAllRequestedModels(false);// model is now available DK22Pac and The_GTA 2 Link to comment Share on other sites More sharing options...
PlsGoobez Posted May 13, 2016 Author Share Posted May 13, 2016 (edited) What about "COMMAND_REQUEST_MODEL = 0x0247" in eCommandName? Edited May 13, 2016 by PlsGoobez Link to comment Share on other sites More sharing options...
HeresOtis Posted May 14, 2016 Share Posted May 14, 2016 You'll have to be able to know how to properly call command codes. Have you tried what I gave you? Link to comment Share on other sites More sharing options...
DK22Pac Posted May 14, 2016 Share Posted May 14, 2016 https://github.com/DK22Pac/plugin-sdk/blob/master/examples/SA_PlayerWeapon/Main.cpp The_GTA 1 Link to comment Share on other sites More sharing options...
PlsGoobez Posted May 14, 2016 Author Share Posted May 14, 2016 Thanks Pac, and yeah I did Otis (it worked) but I just found the command and was asking if that was a possible solution. Link to comment Share on other sites More sharing options...
HeresOtis Posted May 15, 2016 Share Posted May 15, 2016 It can work, but you need to make sort of a wrapper class to call it appropriately. More tedious to do. Link to comment Share on other sites More sharing options...
fastman92 Posted May 15, 2016 Share Posted May 15, 2016 It can work, but you need to make sort of a wrapper class to call it appropriately. More tedious to do.Someone made one: http://gtaforums.com/topic/838490-cleo-plugin-how-to-call-an-opcode-within-a-cleo-plugin/ Link to comment Share on other sites More sharing options...
HeresOtis Posted May 15, 2016 Share Posted May 15, 2016 It can work, but you need to make sort of a wrapper class to call it appropriately. More tedious to do. Someone made one: http://gtaforums.com/topic/838490-cleo-plugin-how-to-call-an-opcode-within-a-cleo-plugin/ I also made this while working on my project. Excuse the redundancy within the code. Header: http://pastebin.com/7szvNbSD Source: http://pastebin.com/zQwfegtv Wesser 1 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