Results 1 to 2 of 2
  1. #1
    normiescum's Avatar
    Join Date
    Sep 2016
    Gender
    female
    Posts
    5
    Reputation
    10
    Thanks
    2

    Question [Help] Player Weapon Addresses

    I'm trying to make a server controller with the ability to force what types of classes players use. My knowledge is quite limited in any other area apart from memory editing since h2v days when I use to make things, I never really branched out further than that not to mention I'm a bit rusty anyway it's been about 7 years since I was in the scene. I'm currently attempting to get the address's for all clients primary weapons as per the weapon id and I seem to be succeeding. Whenever I change weapons or a client in my game does the address shows up with the correct id as per what weapon is currently in use. However when I try write to the address to force change it nothing happens it just forces back to whatever weapon they have selected it. There is probably an easier way to do this I'm just sitting in my comfort zone where I have a lot of experience. Does anyone know if this was patched? I've seen several tutorials regarding this on mpgh however they're a bit old.

    References
    [Tutorial] Change your weapon - AuT03x3C
    Ultimate Server Control hack <3 | Weapon ID's - LOLxFUN


    The only other idea I had was similar to Scoudem's mw2 lobby tools where you're able to open the game setup while host of a public match, this way you'd be able to set weapon restrictions etc as mw3 has a lot more setup options than mw2.
    Something like this: (note this is old mw2 code)

    void OpenGameSetupMenu()
    {
    ((void (__cdecl*) (int, const char*))0x59DD70) (0, "popup_gamesetup");
    }

    Obviously I'd have to find the gamesetup popup offset or equivalent to mw3 if one even exists however this is a bit out of my skill set hell I might be completely wrong here. Any input is appreciated.
    Last edited by normiescum; 09-15-2016 at 06:22 PM.

  2. #2
    SamTheDope's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Location
    Australia
    Posts
    106
    Reputation
    30
    Thanks
    387
    My Mood
    Hot
    For c++

    struct playerState_s
    {
    BYTE _0x0[0x1C]; //0x00 //0x01C29440
    vec3_t Origin; //0x1C //0x01C2945C
    vec3_t Velocity; //0x2E //0x01C29468
    BYTE unk1[0x124]; //0x40
    vec3_t ViewAngles; //0x164 //0x01C29598
    BYTE _0x22[0x31C0]; //0x176
    INT Score; //0x3336
    BYTE _0x331C[0x5E]; //0x333A
    CHAR PlayerNameStatic[0x10];//0x3398
    INT MaxHealth; //0x33A8 //correct
    BYTE _0x33B0[0x24]; //0x33AC
    INT Team; //0x33D0
    BYTE _0x33D8[0x3C]; //0x33D4
    CHAR PlayerName[0xF]; //0x3410
    BYTE _0x33D9[0x1BC]; //0x341F /maybe off b F and revert
    INT ClippingFlags; //0x35CC //0x01C2CA0C
    BYTE _spacer[0x2C];
    INT MovementFlags;
    BYTE _0x3600[0x380];
    }; //Size 0x3980

    typedef void(__cdecl* SendServerCommand_T)(int clientNum, int reliable, const char* command);
    typedef int(__cdecl *G_GivePlayerWeapon_T)(playerState_s* ps, int iWeaponIndex, char altModelIndex);
    typedef int(__cdecl *G_GetWeaponIndexForName_T)(const char* name);
    typedef int(__cdecl *BG_TakePlayerWeapon_T)(playerState_s* ps, unsigned int iWeaponIndex, int takeAwayAmmo);
    typedef int(__cdecl *BG_GetViewmodelWeaponIndex_T)(playerState_s* ps);
    typedef int(__cdecl *Add_Ammo_T)(gentity_s* ent, unsigned int weaponIndex, char weaponModel, int count, int fillClip);

    G_GivePlayerWeapon = (G_GivePlayerWeapon_T)0x00531750;
    G_GetWeaponIndexForName = (G_GetWeaponIndexForName_T)0x00530F90;
    BG_TakePlayerWeapon = (BG_TakePlayerWeapon_T)0x00430B30;
    BG_GetViewmodelWeaponIndex = (BG_GetViewmodelWeaponIndex_T)0x0042FB50;
    Add_Ammo = (Add_Ammo_T)0x00508200;
    SV_GameSendServerCommand = (SendServerCommand_T)0x00573100;

    #define SIZE_playerState 0x38EC
    #define ADDRESS_playerState 0x01C29440

    playerState_s* G_PlayerState(int clientIndex)
    {
    return (playerState_s*)(ADDRESS_playerState + (SIZE_playerState * clientIndex));
    }

    void GiveWeapon(const char* weaponName, int client)
    {
    BG_TakePlayerWeapon(G_PlayerState(client), BG_GetViewmodelWeaponIndex(G_PlayerState(client)), 1);
    int index = G_GetWeaponIndexForName(weaponName);
    G_GivePlayerWeapon(G_PlayerState(client), index, 0);
    string cmd = "a " + to_string(index);
    SV_GameSendServerCommand(client, 0, cmd.c_str());
    Add_Ammo(G_Entity(client), index, 0, 9999, 1);
    }

    Credits to seb5594

    For c# there are 3 weapon addresses for each playerState so just change all 3 and it should work.
    #1 AU
    Instagram @SamTheDope

  3. The Following User Says Thank You to SamTheDope For This Useful Post:

    normiescum (09-17-2016)

Similar Threads

  1. [Help Request] Help player pointer (weaponReload)
    By Astr3Lune in forum Crossfire Coding Help & Discussion
    Replies: 1
    Last Post: 08-14-2013, 02:49 AM
  2. [Help Request] Someone help me with address and some questions.
    By coffeegirl in forum Dragon Nest Help
    Replies: 1
    Last Post: 07-20-2012, 05:20 AM
  3. [Help Request] Primary and Seconday Weapon addresses in MP?
    By SoM1 in forum Call of Duty Modern Warfare 3 Help
    Replies: 3
    Last Post: 11-22-2011, 09:50 AM
  4. [HELP] working weapon adress
    By noobi4life in forum Visual Basic Programming
    Replies: 7
    Last Post: 11-04-2007, 04:46 AM
  5. in game weapons address
    By prox32 in forum WarRock - International Hacks
    Replies: 9
    Last Post: 07-24-2007, 06:55 AM