Quote:
Originally Posted by Styles
What does it output? And pm me, I might ravamp the TS Module, though TS is completely dead..
|
Just wrong results, I came up with this. I found the offsets by looping through the user's weapon ent pdata, untill it matched the clipped size. That's how ava_ts.inc did it. I tested it, it seemed to work fine. But I didn't try it when the weapons I had, had an empty clip. Ether way, better then nothing. My next problem is, actually stripping the weapons.
Code:
MakeOffsets()
{
Offsets[1] = 80; // glock 18
Offsets[2] = -1; // no weapon
Offsets[3] = 108; // uzi
Offsets[4] = 122; // shotgun m3
Offsets[5] = 136; // m4a1
Offsets[6] = 150; // mp5sd
Offsets[7] = 164; // mp5k
Offsets[8] = 94; // bretta
Offsets[9] = 192; // socom
Offsets[10] = 206; // akimbo socom
Offsets[11] = 220; // usas
Offsets[12] = 234; // degal
Offsets[13] = 248; // ak47
Offsets[14] = 262; // 57
Offsets[15] = 276; // aug
Offsets[16] = 290; // akimbo uzi
Offsets[17] = 304; // skorpeon
Offsets[18] = 318; // barret
Offsets[19] = 332; // mp7
Offsets[20] = 346; // spas
Offsets[21] = 360; // colts
Offsets[22] = 374; // glock 20
Offsets[23] = 388; // ump
Offsets[24] = 624; // m61 grenade
Offsets[25] = -1; // combat knife
Offsets[26] = 430; // mossberg
Offsets[27] = 444; // m16a1
Offsets[28] = 458; // rugar
Offsets[29] = -1; // C4
Offsets[30] = 486; // akimbo 57's
Offsets[31] = 500; // bull
Offsets[32] = 514; // m60
Offsets[33] = 528; // sawed off
Offsets[34] = -1; // Katana
Offsets[35] = -1; // Seal Knife
Offsets[36] = -1; // contender // unknown
Offsets[37] = 584;
}
ts_get_user_weapons(const id,Weapons[38],&iNum)
{
new const TSWeapon = ts_get_user_tsgun(id);
if(!TSWeapon)
return 0
for(new Count;Count < sizeof(Offsets);Count++)
{
if(Offsets[Count] <= 0)
continue
if(get_pdata_int(TSWeapon,Offsets[Count]) > 0)
Weapons[iNum++] = Count
}
return 1
}
__________________