Post: [C++] Give Weapons (with Camos)
08-23-2014, 03:42 AM #1
seb5594
Proud Former Admin
(adsbygoogle = window.adsbygoogle || []).push({}); Hey Guys,
Since i worked on my Mod Menu for MW3, i found this out by playing abit in Playerstate.
I guess no one here knew anything about it, but here is it. If you are not bad with Bitwise operations then you can give it a try to give modified Attachments also!
Huge thanks to Kyza aka. Bitwise for helping me to solve a problem with the shifting part :yes:

    
#define G_Client(clientIndex) ( 0x0110A280 + ( clientIndex * 0x3980) )
#define G_Entity(clientIndex) ( 0x00FCA280 + ( clientIndex * 0x280 ) )
int BG_GetViewmodelWeaponIndex(int clientIndex)
{
return *(int*)(G_Client(clientIndex) + 0x370);
}
opd_s GGPW = { 0x001C3034, TOC };
void(*G_GivePlayerWeapon)(int* G_Client, int iWeaponIndex, char altModelIndex) = (void(*)(int*, int, char))&GGPW;
opd_s AA = { 0x0018A29C, TOC };
void(*Add_Ammo)(int* G_Entity, unsigned int weaponIndex, char weaponModel, int count, int fillClip) = (void(*)(int*, unsigned int, char, int, int))&AA;
void TakeWeapon(int clientIndex, int WeaponIndex, int takeAwayAmmo)
{
opd_s BG_TPW = { 0x001C409C, TOC };
void(*BG_TakePlayerWeapon)(int *playerState, int WeaponIndex, int takeAwayAmmo) = (void(*)(int*, int, int))&BG_TPW;
BG_TakePlayerWeapon((int*)G_Client(clientIndex), WeaponIndex, takeAwayAmmo);
}
void GiveWeapon(int clientIndex, int Index)
{
G_GivePlayerWeapon((int*)G_Client(clientIndex), Index, 0);
Add_Ammo((int*)G_Entity(clientIndex), Index, 0, 9999, 1);
}
enum Camo
{
none,
Classic,
Snow,
Multicam,
Digital_Urban,
Hex,
Choco,
Snake,
Blue,
Red,
Autumn,
Gold,
Marine,
Winter
};
void ChangeCamo(int clientIndex, Camo camo)
{
int Index = BG_GetViewmodelWeaponIndex(clientIndex);
TakeWeapon(clientIndex, Index, 0);
int CalcIndex = 0 | ((Index >> 12 & 15) << 12) | ((Index >> 16) << 16) | Index & 0xFF;
GiveWeapon(clientIndex, CalcIndex + (camo << Cool Man (aka Tustin));
}


The function "ChangeCamo" will change the camo of weapon you have currently in hand.
Call this function like that
    ChangeCamo(0, Gold);


PS: I release it because i prob never finish my menu, i have decided to build a Gamemode! Winky Winky
Last edited by seb5594 ; 08-23-2014 at 03:50 AM.

The following 11 users say thank you to seb5594 for this useful post:

-JM-, Hammy, GMTPS3, Joren, Loxy, MegaMister, SaberNGU, seanhellen, Swaqq, Turk_Warrior, witchery
08-23-2014, 03:58 AM #2
Turk_Warrior
League Champion
Originally posted by seb5594 View Post
Hey Guys,
Since i worked on my Mod Menu for MW3, i found this out by playing abit in Playerstate.
I guess no one here knew anything about it, but here is it. If you are not bad with Bitwise operations then you can give it a try to give modified Attachments also!
Huge thanks to Kyza aka. Bitwise for helping me to solve a problem with the shifting part :yes:

    
#define G_Client(clientIndex) ( 0x0110A280 + ( clientIndex * 0x3980) )
#define G_Entity(clientIndex) ( 0x00FCA280 + ( clientIndex * 0x280 ) )
int BG_GetViewmodelWeaponIndex(int clientIndex)
{
return *(int*)(G_Client(clientIndex) + 0x370);
}
opd_s GGPW = { 0x001C3034, TOC };
void(*G_GivePlayerWeapon)(int* G_Client, int iWeaponIndex, char altModelIndex) = (void(*)(int*, int, char))&GGPW;
opd_s AA = { 0x0018A29C, TOC };
void(*Add_Ammo)(int* G_Entity, unsigned int weaponIndex, char weaponModel, int count, int fillClip) = (void(*)(int*, unsigned int, char, int, int))&AA;
void TakeWeapon(int clientIndex, int WeaponIndex, int takeAwayAmmo)
{
opd_s BG_TPW = { 0x001C409C, TOC };
void(*BG_TakePlayerWeapon)(int *playerState, int WeaponIndex, int takeAwayAmmo) = (void(*)(int*, int, int))&BG_TPW;
BG_TakePlayerWeapon((int*)G_Client(clientIndex), WeaponIndex, takeAwayAmmo);
}
void GiveWeapon(int clientIndex, int Index)
{
G_GivePlayerWeapon((int*)G_Client(clientIndex), Index, 0);
Add_Ammo((int*)G_Entity(clientIndex), Index, 0, 9999, 1);
}
enum Camo
{
none,
Classic,
Snow,
Multicam,
Digital_Urban,
Hex,
Choco,
Snake,
Blue,
Red,
Autumn,
Gold,
Marine,
Winter
};
void ChangeCamo(int clientIndex, Camo camo)
{
int Index = BG_GetViewmodelWeaponIndex(clientIndex);
TakeWeapon(clientIndex, Index, 0);
int CalcIndex = 0 | ((Index >> 12 & 15) << 12) | ((Index >> 16) << 16) | Index & 0xFF;
GiveWeapon(clientIndex, CalcIndex + (camo << Cool Man (aka Tustin));
}


The function "ChangeCamo" will change the camo of weapon you have currently in hand.
Call this function like that
    ChangeCamo(0, Gold);


PS: I release it because i prob never finish my menu, i have decided to build a Gamemode! Winky Winky


This is really handy Sebb Nice Release For C++ Users!
08-23-2014, 04:24 AM #3
Have weapon index id list?
08-23-2014, 08:36 PM #4
GMTPS3
Do a barrel roll!
Wusste es schon :P
Aber trozdem nice Smile
08-23-2014, 10:03 PM #5
seb5594
Proud Former Admin
Originally posted by GMTPS3 View Post
Wusste es schon :P
Aber trozdem nice Smile

Ja wusstest du auch wie der part mit shiften usw geht? Von debugger kann jeder ändern Winky Winky
Das ist speziell für Modmenus gut :p

The following user thanked seb5594 for this useful post:

GMTPS3
08-23-2014, 10:54 PM #6
Vanz
Z32 Love <3
Originally posted by seb5594 View Post
I have decided to build a Gamemode! Winky Winky

Yassssss =3

The following user thanked Vanz for this useful post:

iifire
08-23-2014, 11:59 PM #7
Swaqq
Professional Thanker
Build a casino gamemode :fa: have all clients stats, and u bet ur stats lol #GamblingAddiction :fa:
08-24-2014, 02:02 AM #8
GMTPS3
Do a barrel roll!
Originally posted by seb5594 View Post
Ja wusstest du auch wie der part mit shiften usw geht? Von debugger kann jeder ändern Winky Winky
Das ist speziell für Modmenus gut :p

Ich weiss immernoch nicht was du mit Shiften meinst xD
08-24-2014, 02:55 AM #9
seb5594
Proud Former Admin
Originally posted by GMTPS3 View Post
Ich weiss immernoch nicht was du mit Shiften meinst xD


shift links, rechts, xor usw -> Bitwise operations Winky Winky
Google nach dann weisste es ^^
08-24-2014, 03:16 AM #10
GMTPS3
Do a barrel roll!
Originally posted by seb5594 View Post
shift links, rechts, xor usw -> Bitwise operations Winky Winky
Google nach dann weisste es ^^

You must login or register to view this content.

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo