Release [C++] Small Code Thread

More codes?


  • Total voters
    38

Pyrex BLJ

im done :)
Messages
605
Reaction score
338
Points
953
lmao, disable the RoF offset skid
Code:
0x1CBF9F8 - 0x00

Game looks for files to be existent, dlc files would be existent, searching with DLC enabled could possibly edited but the "in pre-game" part probably won't happen... Ill look for it
i had a super ghetto version of disabling dlc in pregame but it was def not good enough for a release
 

Harry

Certified Sick ℂunt
Premium Member
Messages
1,263
Reaction score
969
Points
973
i had a super ghetto version of disabling dlc in pregame but it was def not good enough for a release
What about a Cbuf command? That would be too easy I assume.

Also, Add Mute Player to this list (by me):
Code:
char muteplayer[15] = "xmuteplayer ";
void MuteClient(int client) {
    char buffer[2];
    sprintf(buffer, "%d", client);
    Cbuf_AddText(strcat(showcard, buffer));
    buffer[0] = *"";
    buffer[1] = *"";
    buffer[2] = *"";
    muteplayer[13] = *"";
    muteplayer[14] = *"";
    muteplayer[15] = *"";
}
 

Pyrex BLJ

im done :)
Messages
605
Reaction score
338
Points
953
What about a Cbuf command? That would be too easy I assume.

Also, Add Mute Player to this list (by me):
Code:
char muteplayer[15] = "xmuteplayer ";
void MuteClient(int client) {
    char buffer[2];
    sprintf(buffer, "%d", client);
    Cbuf_AddText(strcat(showcard, buffer));
    buffer[0] = *"";
    buffer[1] = *"";
    buffer[2] = *"";
    muteplayer[13] = *"";
    muteplayer[14] = *"";
    muteplayer[15] = *"";
}
it was alot more ghetto than cbuf... added ur func btw
 
Z

Zlink033

Guest
if you wanna disable your DLC's just take the .dat or .edat fils out of the Game File
no, possibility to choose if I want to play with them or not, like supremacy mw2 ^^
lmao, disable the RoF offset skid
Code:
0x1CBF9F8 - 0x00

Game looks for files to be existent, dlc files would be existent, searching with DLC enabled could possibly edited but the "in pre-game" part probably won't happen... Ill look for it
Oh okay thx
 

candy

G59 Terrorist
Staff member
Donator
Messages
1,327
Reaction score
763
Points
973
a0fcb46d36141fa44c20b725c07f2966.jpg
 

big money

Insane-Known Member
Messages
6
Reaction score
1
Points
353
any chance you can post how to do the check box bools or player chams or how to set glow engine text plz?
thanks for any help
 

Harry

Certified Sick ℂunt
Premium Member
Messages
1,263
Reaction score
969
Points
973
any chance you can post how to do the check box bools or player chams or how to set glow engine text plz?
thanks for any help
Player "Chams" are just body colours and can be found here:
You do not have permission to view link Log in or register now.


Check Box bools,
Draw this after drawing your menu's Shaders:
Code:
DrawMenuBooleanText();

Function:
Code:
void DrawMenuBooleanText()
{
    char MMboolBuffer[1000];
    snprintf(MMboolBuffer, sizeof(MMboolBuffer), "%s%s",
        getBool(BOOLEAN),
        getBool(BOOLEAN)
    );
    DrawText(MMboolBuffer, MenuX - (MenuWidth / 2) + 440, TextY, 0, 1, "normalFont", White, align_left);//Menu Text
}

getBool function:
Code:
char* getBool(bool aBool)
{
    if (aBool) return "^2ON\n";
    else return "^1OFF\n";
}


If you wanna do checkboxes, you'll need to draw each line individually and as a shader... If you wanna do just text, then this will do fine
 

DevOps

Well-Known Member
Messages
2
Reaction score
1
Points
203
What about a Cbuf command? That would be too easy I assume.

Also, Add Mute Player to this list (by me):
Code:
char muteplayer[15] = "xmuteplayer ";
void MuteClient(int client) {
    char buffer[2];
    sprintf(buffer, "%d", client);
    Cbuf_AddText(strcat(showcard, buffer));
    buffer[0] = *"";
    buffer[1] = *"";
    buffer[2] = *"";
    muteplayer[13] = *"";
    muteplayer[14] = *"";
    muteplayer[15] = *"";
}

Harry, why would you do it that way? haha


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);
}
 

big money

Insane-Known Member
Messages
6
Reaction score
1
Points
353
thanks, do you know how I can set glow on engine text with this?

Code:
bool(*SetDrawText2DGlowParms)(GfxCmdDrawText2D *cmd, const float *color, const float *glowColor) = (bool(*)(GfxCmdDrawText2D*, const float*, const float*))&SetDrawText2DGlowParms_t;
 
Last edited:

Harry

Certified Sick ℂunt
Premium Member
Messages
1,263
Reaction score
969
Points
973
Harry, why would you do it that way? haha


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);
}
I don't actually do it the way I sent, the buffer size is wrong and doesn't work, my own with a few edits works fine though...
Thought I'd give the c+p (PonyOG/Dezire) a bit of a hiccup with that one :wink:
 

Harry

Certified Sick ℂunt
Premium Member
Messages
1,263
Reaction score
969
Points
973
Harry your making a **** out of yourself Please stop
How am I making a “c*nt out of myself”? Because I don’t sh¡t talk other less knowledgeable developers about how I rewrote Paradise but kept the ugly, unoriginal design, and wrote every function by myself? Kid, all the “friends” you think you most likely work for or with me, or we are close...
When you stop talking up new developers (most of them you have talked up laugh at you by the way, take my good fellow memer @Pyrex BLJ & @PassiveModding) and actually start making functions on you’re own or with minimal help (should go check out the new menu BTW, I thought I couldn’t “even make a scroll bar” (took 5 mins, most of it figuring out where to put it based on scroll * HEIGHT), and then a RGB editor... what have you made? Errrrr.. Nothing?
 
Top