Post: [Help] MW2 Sprx GiveWeapon
09-26-2016, 08:59 PM #1
SNMT| Havoc
Do a barrel roll!
(adsbygoogle = window.adsbygoogle || []).push({}); :Note to admins please delete or change thread name to [Solved]

Its been awhile since I coded some mods, so I decided to make a new sprx menu for mw2.
I'm having trouble getting the giveweapon function to work. It seems to hang the sprx but leave the lv2 running (PS3 not freezing).
Wondered if any off you could identify the problem.


Addresses:
    

TOC: 0x00724C38
GiveWeapon: 0x001C0890
AmmoInit: 0x00174BF8
G_Client: 0x14E2200*
G_Entity: 0x01319780



Client

    

G_Client:
int G_Client(int clientIndex)
{
return 0x14E2200 + (0x3700 * clientIndex);
}




Entity

    
G_Entity:
int G_Entity(int clientIndex, int Mod = 0)
{
return (0x01319780+ (0x280 * clientIndex));
}


Functions
    


huds:Gasppd_s G_GivePlayerWeapon_t = { 0x001C0890, TOC::TOCaddress };
int(*G_GivePlayerWeapon)(int clientIndex, int weaponIndex, int Akimbo, int Camo) = (int(*)(int, int, int, int))&G_GivePlayerWeapon_t;
*
huds:Gasppd_s G_InitializeAmmo_t = { 0x00174BF8, TOC::TOCaddress };
int(*G_InitializeAmmo)(int clientIndex, int weaponIndex, int Akimbo, int Camo) = (int(*)(int, int, int, int))&G_InitializeAmmo_t;

void GivePlayerWeapon(int clientIndex, int weaponIndex)
{
G_GivePlayerWeapon(clientFuncs::G_Client(clientIndex), weaponIndex, 0, 0);
G_InitializeAmmo(clientFuncs::G_Entity(clientIndex), weaponIndex, 0, 0);
}



Called using:
GivePlayerWeapon(0, 2);
Should give a riot shield.
Last edited by SNMT| Havoc ; 09-28-2016 at 03:01 AM.
09-27-2016, 07:37 PM #2
TBMRecoveries
Do a barrel roll!
Originally posted by SNMT
Its been awhile since I coded some mods, so I decided to make a new sprx menu for mw2.
I'm having trouble getting the giveweapon function to work. It seems to hang the sprx but leave the lv2 running (PS3 not freezing).
Wondered if any off you could identify the problem.


Addresses:
    

TOC: 0x00724C38
GiveWeapon: 0x001C0890
AmmoInit: 0x00174BF8
G_Client: 0x14E2200*
G_Entity: 0x01319780



Client

    

G_Client:
int G_Client(int clientIndex)
{
return 0x14E2200 + (0x3700 * clientIndex);
}




Entity

    
G_Entity:
int G_Entity(int clientIndex, int Mod = 0)
{
return (0x01319780+ (0x280 * clientIndex));
}


Functions
    


huds:Gasppd_s G_GivePlayerWeapon_t = { 0x001C0890, TOC::TOCaddress };
int(*G_GivePlayerWeapon)(int clientIndex, int weaponIndex, int Akimbo, int Camo) = (int(*)(int, int, int, int))&G_GivePlayerWeapon_t;
*
huds:Gasppd_s G_InitializeAmmo_t = { 0x00174BF8, TOC::TOCaddress };
int(*G_InitializeAmmo)(int clientIndex, int weaponIndex, int Akimbo, int Camo) = (int(*)(int, int, int, int))&G_InitializeAmmo_t;

void GivePlayerWeapon(int clientIndex, int weaponIndex)
{
G_GivePlayerWeapon(clientFuncs::G_Client(clientIndex), weaponIndex, 0, 0);
G_InitializeAmmo(clientFuncs::G_Entity(clientIndex), weaponIndex, 0, 0);
}



Called using:
GivePlayerWeapon(0, 2);
Should give a riot shield.


Don't know a fix, but I hope it Will be a good sprx all the sprx menu's on mw2 are shitty, I can be your tester if you want 👍🏼
09-27-2016, 08:18 PM #3
SNMT| Havoc
Do a barrel roll!
Thanks mate I may release, usually I make my stuff for fun and scrap it.
09-28-2016, 03:01 AM #4
SNMT| Havoc
Do a barrel roll!
I got it working by also including BG_GetWeaponIndexForName and by changing the giveweapon to unsigned int playerState, int weaponIndex, char camo, int akimbo.

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo