CabConModding
Facebook
Twitter
youtube
Discord
Contact us
RSS
Menu
CabConModding
Home
New
Top
Premium
Rules
FAQ - Frequently Asked Questions
Games
Fornite
Call of Duty: Black Ops 3
Clash of Clans
Grand Theft Auto 5
Apex Legends
Assassin’s Creed Origins
Forums
Premium
Latest posts
What's new
Latest posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Log in
Register
What's new
Premium
Latest posts
Menu
Log in
Register
Navigation
Install the app
Install
More options
Dark Theme
Contact us
Close Menu
Forums
Gaming
Call of Duty Classics
Call of Duty: Black Ops 2
Call of Duty: Black Ops 2 Mods and Scripts
Call of Duty: Black Ops 2 Scripts
[C++] Small Code Thread
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Pyrex BLJ" data-source="post: 31116" data-attributes="member: 420"><p style="text-align: center">Hey guys, I'm beginning to release some source functions from my menu</p> <p style="text-align: center">because I'm feeling generous and i don't like</p> <p style="text-align: center">keeping information from all you people</p> <p style="text-align: center"></p> <p style="text-align: center">I didn't find these anywhere else (although i didn't look that hard)</p> <p style="text-align: center">and yes it is gross but idk c++ very well, ok?</p> <p style="text-align: center"></p> <p style="text-align: center">[SPOILER="Show Playercard"]</p> <p style="text-align: center">[CODE]</p> <p style="text-align: center">char showcard[75] = "xshowgamercardbyclientnumingame ";</p> <p style="text-align: center">void showgamercard(int client) {</p> <p style="text-align: center"> char buffer[2];</p> <p style="text-align: center"> sprintf(buffer, "%d", client);</p> <p style="text-align: center"> Cbuf_AddText(0, strcat(showcard, buffer));</p> <p style="text-align: center"> buffer[0] = *"";</p> <p style="text-align: center"> buffer[1] = *"";</p> <p style="text-align: center"> buffer[2] = *"";</p> <p style="text-align: center"> showcard[32] = *"";</p> <p style="text-align: center"> showcard[33] = *"";</p> <p style="text-align: center"> showcard[34] = *"";</p> <p style="text-align: center">}[/CODE]</p> <p style="text-align: center"></p> <p style="text-align: center">Call it like [CODE]showgamercard(1);[/CODE]</p> <p style="text-align: center"></p> <p style="text-align: center"><img src="https://image.prntscr.com/image/JcUEeuiWQt65n78PXzyKNQ.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p> <p style="text-align: center">[/SPOILER]</p> <p style="text-align: center"></p> <p style="text-align: center">[SPOILER="Lag Out of Lobby"]</p> <p style="text-align: center">[CODE]Cbuf_AddText(0, "xstopallparties");[/CODE]</p> <p style="text-align: center"><img src="https://i.gyazo.com/c75f76ca435c618c49717059f54a83db.gif" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p> <p style="text-align: center">[/SPOILER]</p> <p style="text-align: center"></p> <p style="text-align: center">[SPOILER="Quit BO2"]</p> <p style="text-align: center">[CODE]Cbuf_AddText(0, "quit");[/CODE]</p> <p style="text-align: center"><img src="https://i.gyazo.com/6bba93cec9f83c478363dd973e51de9e.gif" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p> <p style="text-align: center">[/SPOILER]</p> <p style="text-align: center"></p> <p style="text-align: center">[SPOILER="Dank Map"]</p> <p style="text-align: center">The First Requested Function:</p> <p style="text-align: center">this will show errors in vs, but it will still work/build</p> <p style="text-align: center">[CODE]void dankestMap(uint64_t nothing) {</p> <p style="text-align: center"> int delay = 1500;</p> <p style="text-align: center"> while(var.dankestMapkek) {</p> <p style="text-align: center"> Cbuf_AddText(0, "r_lightTweakSunColor 1 0 0;r_lightTweakSunDirection 100 180 0;r_specularColorScale 1;r_specularmap 1;r_glow \"1\";r_glow_allowed \"1\";r_glowtweakbloomintensity 1;r_glowtweakradius 1;r_glowTweakEnable 1;r_glowUseTweaks 1;r_skyColorTemp 7500;");</p> <p style="text-align: center"> sleep(delay);</p> <p style="text-align: center"> Cbuf_AddText(0, "r_lightTweakSunColor 0.5 1 0");</p> <p style="text-align: center"> sleep(delay);</p> <p style="text-align: center"> Cbuf_AddText(0, "r_lightTweakSunColor 0.5 0.5 0");</p> <p style="text-align: center"> sleep(delay);</p> <p style="text-align: center"> Cbuf_AddText(0, "r_lightTweakSunColor 0 1 0");</p> <p style="text-align: center"> sleep(delay);</p> <p style="text-align: center"> Cbuf_AddText(0, "r_lightTweakSunColor 0 0.5 1");</p> <p style="text-align: center"> sleep(delay);</p> <p style="text-align: center"> Cbuf_AddText(0, "r_lightTweakSunColor 0 0.5 0.5");</p> <p style="text-align: center"> sleep(delay);</p> <p style="text-align: center"> Cbuf_AddText(0, "r_lightTweakSunColor 0 0 1");</p> <p style="text-align: center"> sleep(delay);</p> <p style="text-align: center"> Cbuf_AddText(0, "r_lightTweakSunColor 1 0 0.5");</p> <p style="text-align: center"> sleep(delay);</p> <p style="text-align: center"> Cbuf_AddText(0, "r_lightTweakSunColor 0.5 0 0.5");</p> <p style="text-align: center"> sleep(delay);</p> <p style="text-align: center"> }</p> <p style="text-align: center"> sys_ppu_thread_exit(nothing);</p> <p style="text-align: center">}</p> <p style="text-align: center">sys_ppu_thread_t suncolor;</p> <p style="text-align: center">void startDankestMap() {</p> <p style="text-align: center"> sys_ppu_thread_create(&suncolor, dankestMap, 0, 10, 0x0A, 0, "suncolor");</p> <p style="text-align: center">}[/CODE]</p> <p style="text-align: center"><img src="https://media.giphy.com/media/3o6nV3TxTJA8WqDm24/giphy.gif" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p> <p style="text-align: center">[/SPOILER]</p> <p style="text-align: center"></p> <p style="text-align: center">[SPOILER="Auto Crouch"]</p> <p style="text-align: center">[CODE]void autocrouch(uint64_t nothing) {</p> <p style="text-align: center"> while (crouch) {</p> <p style="text-align: center"> *(char*)0xee4d30 = 1;</p> <p style="text-align: center"> sleep(1);</p> <p style="text-align: center"> *(char*)0xee4d30 = 0;</p> <p style="text-align: center"> sleep(1);</p> <p style="text-align: center"> }</p> <p style="text-align: center"> sys_ppu_thread_exit(nothing);</p> <p style="text-align: center">}</p> <p style="text-align: center">sys_ppu_thread_t startAutoshooting;</p> <p style="text-align: center">void startAutocrouch() {</p> <p style="text-align: center"> sys_ppu_thread_create(&startAutoshooting, autocrouch, 0, 10, 0x0A, 0, "autotbag");</p> <p style="text-align: center">}[/CODE]</p> <p style="text-align: center"><img src="https://media.giphy.com/media/3o752ovCdlHApZXytq/giphy.gif" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p> <p style="text-align: center">[/SPOILER]</p> <p style="text-align: center"></p> <p style="text-align: center">[SPOILER="Image Injector"]</p> <p style="text-align: center">I just wrote this, may be a bit messy or glitchy but works for the most part</p> <p style="text-align: center">You need a few things for this to work, ill include them here.</p> <p style="text-align: center">[CODE]int getFileSize(char *file) {</p> <p style="text-align: center"> int fd;</p> <p style="text-align: center"> int ret;</p> <p style="text-align: center"> uint64_t pos;</p> <p style="text-align: center"> uint64_t nread;</p> <p style="text-align: center"> ret = cellFsOpen(file, 0, &fd, NULL, 0);</p> <p style="text-align: center"> if (!ret) {</p> <p style="text-align: center"> CellFsStat sb;</p> <p style="text-align: center"> ret = cellFsFstat(fd, &sb);</p> <p style="text-align: center"> if (!ret) {</p> <p style="text-align: center"> return sb.st_size;</p> <p style="text-align: center"> }</p> <p style="text-align: center"> }</p> <p style="text-align: center"> return -1;</p> <p style="text-align: center">}</p> <p style="text-align: center">void readFile(char *file, char buf[], int size) {</p> <p style="text-align: center"> int fd;</p> <p style="text-align: center"> int ret;</p> <p style="text-align: center"> uint64_t pos;</p> <p style="text-align: center"> uint64_t nread;</p> <p style="text-align: center"> ret = cellFsOpen(file, 0, &fd, NULL, 0);</p> <p style="text-align: center"> if (!ret)</p> <p style="text-align: center"> {</p> <p style="text-align: center"> cellFsLseek(fd, 0, CELL_FS_SEEK_SET, &pos);</p> <p style="text-align: center"> ret = cellFsRead(fd, buf, size, &nread);</p> <p style="text-align: center"> if (!ret)</p> <p style="text-align: center"> {</p> <p style="text-align: center"> cellFsClose(fd);</p> <p style="text-align: center"> }</p> <p style="text-align: center"> }</p> <p style="text-align: center">}</p> <p style="text-align: center"></p> <p style="text-align: center">int ByteLength;</p> <p style="text-align: center">unsigned int MALLOC = 0x100000;</p> <p style="text-align: center">unsigned int loc = 0xCAD88480;</p> <p style="text-align: center">void imginject(char *file) {</p> <p style="text-align: center"> ByteLength = getFileSize(file);</p> <p style="text-align: center"> if (ByteLength != -1) {</p> <p style="text-align: center"> readFile(file, (char*)loc, MALLOC);</p> <p style="text-align: center"> }</p> <p style="text-align: center"> else {</p> <p style="text-align: center"> printf("\nUnable to Inject Image, Make Sure You Have a File In The Perxy Folder & It Has The Correct Name\n");</p> <p style="text-align: center"> }</p> <p style="text-align: center">}</p> <p style="text-align: center">void injectimagepls(uint64_t nothing) {</p> <p style="text-align: center"> for (;;) {</p> <p style="text-align: center"> if (imgfirst == false) {</p> <p style="text-align: center"> sleep(6000);</p> <p style="text-align: center"> imginject("/dev_hdd0/tmp/Perxy/image.dds");</p> <p style="text-align: center"> imgfirst = true;</p> <p style="text-align: center"> }</p> <p style="text-align: center"> if (imageinjected == false && DvarGetBool("cl_ingame") == false) {</p> <p style="text-align: center"> imginject("/dev_hdd0/tmp/Perxy/image.dds");</p> <p style="text-align: center"> imageinjected = true;</p> <p style="text-align: center"> }</p> <p style="text-align: center"> sleep(3000);</p> <p style="text-align: center"> }</p> <p style="text-align: center"> sys_ppu_thread_exit(nothing);</p> <p style="text-align: center">}</p> <p style="text-align: center">sys_ppu_thread_t startimageinject;</p> <p style="text-align: center">void startimageinjectpls() {</p> <p style="text-align: center"> sys_ppu_thread_create(&startimageinject, injectimagepls, 0, 10, 0x0A, 0, "imageInjector");</p> <p style="text-align: center">}[/CODE]</p> <p style="text-align: center">Then Put this somewhere that constantly runs in game. (the image resets when you join a game)</p> <p style="text-align: center">[CODE]if (DvarGetBool("cl_ingame")) {</p> <p style="text-align: center"> imageinjected = false;</p> <p style="text-align: center"> }[/CODE]</p> <p style="text-align: center">Here is a tutorial i made on creating injectable images, although i made quite a few that ill release with the next perxy update</p> <p style="text-align: center">[CODE]https://www.youtube.com/watch?v=AD0qhfgfwNM[/CODE]</p> <p style="text-align: center"><img src="https://image.prntscr.com/image/NUPwatSCTVaIb58WsT9Ugw.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p> <p style="text-align: center">[/SPOILER]</p> <p style="text-align: center"></p> <p style="text-align: center">[SPOILER="Mute Player"]</p> <p style="text-align: center">This one was submitted by [USER=35]@Harry[/USER] (thx)</p> <p style="text-align: center">Optimized by [USER=35]@DevOps [/USER]</p> <p style="text-align: center">[CODE]</p> <p style="text-align: center">void muteplayer(u32 id) {</p> <p style="text-align: center"> char buffer[100];</p> <p style="text-align: center"> sprintf(buffer, "xmuteplayer %d", id);</p> <p style="text-align: center"> Cbuf_AddText(LOCAL_CLIENT_FIRST, buffer);</p> <p style="text-align: center"> sys_memory_free((sys_addr_t)buffer);</p> <p style="text-align: center">}</p> <p style="text-align: center">[/CODE]</p> <p style="text-align: center">i dont have a pic/vid of this but u know what it does</p> <p style="text-align: center">[/SPOILER]</p> <p style="text-align: center"></p> <p style="text-align: center">If you have any specific things you want from Perxy or one of my programs just ask and ill post them here <img src="/styles/default/xenforo/smilies.emoji/people/slight_smile.emoji.svg" class="smilie" loading="lazy" alt=":smile:" title="Smile :smile:" data-shortname=":smile:" /></p> <p style="text-align: center"></p> <p style="text-align: center">Enjoy</p></blockquote><p></p>
[QUOTE="Pyrex BLJ, post: 31116, member: 420"] [CENTER]Hey guys, I'm beginning to release some source functions from my menu because I'm feeling generous and i don't like keeping information from all you people I didn't find these anywhere else (although i didn't look that hard) and yes it is gross but idk c++ very well, ok? [SPOILER="Show Playercard"] [CODE] char showcard[75] = "xshowgamercardbyclientnumingame "; void showgamercard(int client) { char buffer[2]; sprintf(buffer, "%d", client); Cbuf_AddText(0, strcat(showcard, buffer)); buffer[0] = *""; buffer[1] = *""; buffer[2] = *""; showcard[32] = *""; showcard[33] = *""; showcard[34] = *""; }[/CODE] Call it like [CODE]showgamercard(1);[/CODE] [IMG]https://image.prntscr.com/image/JcUEeuiWQt65n78PXzyKNQ.png[/IMG] [/SPOILER] [SPOILER="Lag Out of Lobby"] [CODE]Cbuf_AddText(0, "xstopallparties");[/CODE] [IMG]https://i.gyazo.com/c75f76ca435c618c49717059f54a83db.gif[/IMG] [/SPOILER] [SPOILER="Quit BO2"] [CODE]Cbuf_AddText(0, "quit");[/CODE] [IMG]https://i.gyazo.com/6bba93cec9f83c478363dd973e51de9e.gif[/IMG] [/SPOILER] [SPOILER="Dank Map"] The First Requested Function: this will show errors in vs, but it will still work/build [CODE]void dankestMap(uint64_t nothing) { int delay = 1500; while(var.dankestMapkek) { Cbuf_AddText(0, "r_lightTweakSunColor 1 0 0;r_lightTweakSunDirection 100 180 0;r_specularColorScale 1;r_specularmap 1;r_glow \"1\";r_glow_allowed \"1\";r_glowtweakbloomintensity 1;r_glowtweakradius 1;r_glowTweakEnable 1;r_glowUseTweaks 1;r_skyColorTemp 7500;"); sleep(delay); Cbuf_AddText(0, "r_lightTweakSunColor 0.5 1 0"); sleep(delay); Cbuf_AddText(0, "r_lightTweakSunColor 0.5 0.5 0"); sleep(delay); Cbuf_AddText(0, "r_lightTweakSunColor 0 1 0"); sleep(delay); Cbuf_AddText(0, "r_lightTweakSunColor 0 0.5 1"); sleep(delay); Cbuf_AddText(0, "r_lightTweakSunColor 0 0.5 0.5"); sleep(delay); Cbuf_AddText(0, "r_lightTweakSunColor 0 0 1"); sleep(delay); Cbuf_AddText(0, "r_lightTweakSunColor 1 0 0.5"); sleep(delay); Cbuf_AddText(0, "r_lightTweakSunColor 0.5 0 0.5"); sleep(delay); } sys_ppu_thread_exit(nothing); } sys_ppu_thread_t suncolor; void startDankestMap() { sys_ppu_thread_create(&suncolor, dankestMap, 0, 10, 0x0A, 0, "suncolor"); }[/CODE] [IMG]https://media.giphy.com/media/3o6nV3TxTJA8WqDm24/giphy.gif[/IMG] [/SPOILER] [SPOILER="Auto Crouch"] [CODE]void autocrouch(uint64_t nothing) { while (crouch) { *(char*)0xee4d30 = 1; sleep(1); *(char*)0xee4d30 = 0; sleep(1); } sys_ppu_thread_exit(nothing); } sys_ppu_thread_t startAutoshooting; void startAutocrouch() { sys_ppu_thread_create(&startAutoshooting, autocrouch, 0, 10, 0x0A, 0, "autotbag"); }[/CODE] [IMG]https://media.giphy.com/media/3o752ovCdlHApZXytq/giphy.gif[/IMG] [/SPOILER] [SPOILER="Image Injector"] I just wrote this, may be a bit messy or glitchy but works for the most part You need a few things for this to work, ill include them here. [CODE]int getFileSize(char *file) { int fd; int ret; uint64_t pos; uint64_t nread; ret = cellFsOpen(file, 0, &fd, NULL, 0); if (!ret) { CellFsStat sb; ret = cellFsFstat(fd, &sb); if (!ret) { return sb.st_size; } } return -1; } void readFile(char *file, char buf[], int size) { int fd; int ret; uint64_t pos; uint64_t nread; ret = cellFsOpen(file, 0, &fd, NULL, 0); if (!ret) { cellFsLseek(fd, 0, CELL_FS_SEEK_SET, &pos); ret = cellFsRead(fd, buf, size, &nread); if (!ret) { cellFsClose(fd); } } } int ByteLength; unsigned int MALLOC = 0x100000; unsigned int loc = 0xCAD88480; void imginject(char *file) { ByteLength = getFileSize(file); if (ByteLength != -1) { readFile(file, (char*)loc, MALLOC); } else { printf("\nUnable to Inject Image, Make Sure You Have a File In The Perxy Folder & It Has The Correct Name\n"); } } void injectimagepls(uint64_t nothing) { for (;;) { if (imgfirst == false) { sleep(6000); imginject("/dev_hdd0/tmp/Perxy/image.dds"); imgfirst = true; } if (imageinjected == false && DvarGetBool("cl_ingame") == false) { imginject("/dev_hdd0/tmp/Perxy/image.dds"); imageinjected = true; } sleep(3000); } sys_ppu_thread_exit(nothing); } sys_ppu_thread_t startimageinject; void startimageinjectpls() { sys_ppu_thread_create(&startimageinject, injectimagepls, 0, 10, 0x0A, 0, "imageInjector"); }[/CODE] Then Put this somewhere that constantly runs in game. (the image resets when you join a game) [CODE]if (DvarGetBool("cl_ingame")) { imageinjected = false; }[/CODE] Here is a tutorial i made on creating injectable images, although i made quite a few that ill release with the next perxy update [CODE]https://www.youtube.com/watch?v=AD0qhfgfwNM[/CODE] [IMG]https://image.prntscr.com/image/NUPwatSCTVaIb58WsT9Ugw.png[/IMG] [/SPOILER] [SPOILER="Mute Player"] This one was submitted by [USER=35]@Harry[/USER] (thx) Optimized by [USER=35]@DevOps [/USER] [CODE] void muteplayer(u32 id) { char buffer[100]; sprintf(buffer, "xmuteplayer %d", id); Cbuf_AddText(LOCAL_CLIENT_FIRST, buffer); sys_memory_free((sys_addr_t)buffer); } [/CODE] i dont have a pic/vid of this but u know what it does [/SPOILER] If you have any specific things you want from Perxy or one of my programs just ask and ill post them here :smile: Enjoy[/CENTER] [/QUOTE]
Verification
Post reply
Forums
Gaming
Call of Duty Classics
Call of Duty: Black Ops 2
Call of Duty: Black Ops 2 Mods and Scripts
Call of Duty: Black Ops 2 Scripts
[C++] Small Code Thread
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top