Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //By CraigChrist8239
- //A list of perk names:
- /*
- "specialty_gpsjammer"
- "specialty_bulletaccuracy"
- "specialty_fastreload"
- "specialty_rof"
- "specialty_holdbreath"
- "specialty_bulletpenetration"
- "specialty_grenadepulldeath"
- "specialty_pistoldeath"
- "specialty_quieter"
- "specialty_parabolic"
- "specialty_longersprint"
- "specialty_detectexplosive"
- "specialty_exposeenemy"
- "specialty_bulletdamage"
- "specialty_extraammo"
- "specialty_twoprimaries"
- "specialty_armorvest"
- "specialty_fraggrenade"
- "specialty_specialgrenade"
- "specialty_fastmantle"
- "specialty_jumpdive"
- "specialty_explosivebullets"
- "specialty_scavenger"
- "specialty_extendedmags"
- "specialty_lightweight"
- "specialty_marathon"
- "specialty_quickdraw"
- "specialty_coldblooded"
- "specialty_heartbreaker"
- "specialty_selectivehearing"
- "specialty_fastsnipe"
- "specialty_improvedholdbreath"
- "specialty_spygame"
- "specialty_automantle"
- "specialty_fastsprintrecovery"
- "specialty_extendedmelee"
- */
- typedef unsigned int (__cdecl * BG_GetPerkIndexForName_t)(const char *perkName);
- BG_GetPerkIndexForName_t BG_GetPerkIndexForName = (BG_GetPerkIndexForName_t)0x820D1700;
- //"Reversed" from TU8
- void setPerk(int clientIndex, char * perkName, bool isCodePerk = false)
- {
- //Code perks do not work with this...
- if(!isCodePerk)
- {
- unsigned int perkIndex = BG_GetPerkIndexForName(perkName),
- player = 0x82F03600 + (clientIndex*0x280);
- __asm
- {
- mr r31, player
- lwz r11, 0x158(r31)
- rlwinm r9, perkIndex, 29,3,29
- clrlwi r8, perkIndex, 27
- addi r11, r11, 0x428
- li r7, 1
- rlwinm r10, perkIndex, 29,3,29
- slw r6, r7, r8
- lwzx r5, r9, r11
- or r4, r5, r6
- stwx r4, r9, r11
- lwz r11, 0x158(r31)
- addi r11, r11, 0x32BC
- lwzx r3, r10, r11
- or r9, r6, r3
- stwx r9, r10, r11
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment