[src]Ek Announcer only for Players

Codes already submitted by people of the forums.
Post Reply
cris002
just visiting
Posts: 5
Joined: Thu Sep 07, 2006 11:47 am

Post by cris002 »

Simple
Find on game.cpp
Client Killed Handler
Scroll until u see something along the lines of

Code: Select all

	memcpy(KilledMessage1, cAttackerName, strlen(cAttackerName));
	strcat(KilledMessage1, " killed ");
	strcat(KilledMessage1, m_pClientList[iClientH]->m_cCharName);
Then Replace with

Code: Select all

  
	if (cAttackerType == DEF_OWNERTYPE_PLAYER) {
	memcpy(KilledMessage1, cAttackerName, strlen(cAttackerName));
	strcat(KilledMessage1, " killed ");
	strcat(KilledMessage1, m_pClientList[iClientH]->m_cCharName);
	}
Im pretty sure thats how it works, i might have missed something :) tell me if i have xD

And yes, i am only a basic coder...so dont keep calling me noob, cos i know i am :)
Dax
<3 bd long time
Posts: 785
Joined: Mon Apr 18, 2005 3:19 pm

Post by Dax »

cris002 wrote: Simple
Find on game.cpp
Client Killed Handler
Scroll until u see something along the lines of

Code: Select all

	memcpy(KilledMessage1, cAttackerName, strlen(cAttackerName));
	strcat(KilledMessage1, " killed ");
	strcat(KilledMessage1, m_pClientList[iClientH]->m_cCharName);
Then Replace with

Code: Select all

  
	if (cAttackerType == DEF_OWNERTYPE_PLAYER) {
	memcpy(KilledMessage1, cAttackerName, strlen(cAttackerName));
	strcat(KilledMessage1, " killed ");
	strcat(KilledMessage1, m_pClientList[iClientH]->m_cCharName);
	}
Im pretty sure thats how it works, i might have missed something :) tell me if i have xD

And yes, i am only a basic coder...so dont keep calling me noob, cos i know i am :)
Looks good.

But whats wrong with using:

Code: Select all

if (cAttackerType == DEF_OWNERTYPE_PLAYER) wsprintf(KilledMessage1, "%s killed %s", cAttackerName, m_pClientList[iClientH]->m_cCharName);
Reppin' 127.0.0.1!!!<br><br><img src='http://img502.imageshack.us/img502/1348/sig4daxbn2.jpg' border='0' alt='user posted image' /><br><br>I contend that we are both atheists. I just believe in one fewer god than you do. <br>When you understand why you dismiss all the other possible gods, you will <br>understand why I dismiss yours.<br>~ <b>Stephen Roberts</b>
bone-you
Spamtastic
Posts: 1310
Joined: Wed Mar 16, 2005 3:12 am

Post by bone-you »

In all truth wsprintf is bad practice :P

Code: Select all

HRESULT StringCbPrintf(
    LPTSTR pszDest,
    size_t cbDest,
    LPCTSTR pszFormat,
     ...
);
:P
<img src='http://www.helbreathx.net/sig/sig.jpeg' border='0' alt='user posted image' /><br><a href='http://mafia.cheats4us.org/index.php?x=231030' target='_blank'>#1 on Mafia :D</a><br><!--QuoteBegin-Slipknight+--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Slipknight)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->100mb Internet, burstable too 10GB oc192<br>his speed can go up too 10gbs<br>...<br>Yes my car can have a top speed of 1000mph<!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd--><br>^^ I wonder where the retard went to.
Dax
&lt;3 bd long time
Posts: 785
Joined: Mon Apr 18, 2005 3:19 pm

Post by Dax »

bone-you wrote: In all truth wsprintf is bad practice :P

Code: Select all

HRESULT StringCbPrintf(
    LPTSTR pszDest,
    size_t cbDest,
    LPCTSTR pszFormat,
     ...
);
:P
So calling the 3 other functions is cleaner?
Reppin' 127.0.0.1!!!<br><br><img src='http://img502.imageshack.us/img502/1348/sig4daxbn2.jpg' border='0' alt='user posted image' /><br><br>I contend that we are both atheists. I just believe in one fewer god than you do. <br>When you understand why you dismiss all the other possible gods, you will <br>understand why I dismiss yours.<br>~ <b>Stephen Roberts</b>
bone-you
Spamtastic
Posts: 1310
Joined: Wed Mar 16, 2005 3:12 am

Post by bone-you »

Dax wrote:
bone-you wrote: In all truth wsprintf is bad practice :P

Code: Select all

HRESULT StringCbPrintf(
    LPTSTR pszDest,
    size_t cbDest,
    LPCTSTR pszFormat,
     ...
);
:P
So calling the 3 other functions is cleaner?
safer*

wsprint can lead to buffer errors as what happens with me so often with zbot :( receiving packets of such great unknown length or by chance an error.

That version makes sure it doesn't exceed cbDest bytes making SURE it doesn't overflow :P
<img src='http://www.helbreathx.net/sig/sig.jpeg' border='0' alt='user posted image' /><br><a href='http://mafia.cheats4us.org/index.php?x=231030' target='_blank'>#1 on Mafia :D</a><br><!--QuoteBegin-Slipknight+--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Slipknight)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->100mb Internet, burstable too 10GB oc192<br>his speed can go up too 10gbs<br>...<br>Yes my car can have a top speed of 1000mph<!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd--><br>^^ I wonder where the retard went to.
Dax
&lt;3 bd long time
Posts: 785
Joined: Mon Apr 18, 2005 3:19 pm

Post by Dax »

bone-you wrote:
Dax wrote:
bone-you wrote: In all truth wsprintf is bad practice :P

Code: Select all

HRESULT StringCbPrintf(
    LPTSTR pszDest,
    size_t cbDest,
    LPCTSTR pszFormat,
     ...
);
:P
So calling the 3 other functions is cleaner?
safer*

wsprint can lead to buffer errors as what happens with me so often with zbot :( receiving packets of such great unknown length or by chance an error.

That version makes sure it doesn't exceed cbDest bytes making SURE it doesn't overflow :P
But with my use of it aslong as the buffer has enough bytes for " killed " +20 more for char names how could it overflow? That chance error you speak of?


[EDIT] Because i've never seen any error from wsprintf unless it was an overflow caused by the programmer(not chance).
Reppin' 127.0.0.1!!!<br><br><img src='http://img502.imageshack.us/img502/1348/sig4daxbn2.jpg' border='0' alt='user posted image' /><br><br>I contend that we are both atheists. I just believe in one fewer god than you do. <br>When you understand why you dismiss all the other possible gods, you will <br>understand why I dismiss yours.<br>~ <b>Stephen Roberts</b>
bone-you
Spamtastic
Posts: 1310
Joined: Wed Mar 16, 2005 3:12 am

Post by bone-you »

Dax wrote:
bone-you wrote:
Dax wrote: So calling the 3 other functions is cleaner?
safer*

wsprint can lead to buffer errors as what happens with me so often with zbot :( receiving packets of such great unknown length or by chance an error.

That version makes sure it doesn't exceed cbDest bytes making SURE it doesn't overflow :P
But with my use of it aslong as the buffer has enough bytes for " killed " +20 more for char names how could it overflow? That chance error you speak of?


[EDIT] Because i've never seen any error from wsprintf unless it was an overflow caused by the programmer(not chance).
You could use plenty of clientside edits to rape ANY hg out there if you consider the uses of wsprintf. :P
<img src='http://www.helbreathx.net/sig/sig.jpeg' border='0' alt='user posted image' /><br><a href='http://mafia.cheats4us.org/index.php?x=231030' target='_blank'>#1 on Mafia :D</a><br><!--QuoteBegin-Slipknight+--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Slipknight)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->100mb Internet, burstable too 10GB oc192<br>his speed can go up too 10gbs<br>...<br>Yes my car can have a top speed of 1000mph<!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd--><br>^^ I wonder where the retard went to.
Dax
&lt;3 bd long time
Posts: 785
Joined: Mon Apr 18, 2005 3:19 pm

Post by Dax »

bone-you wrote:
Dax wrote:
bone-you wrote: safer*

wsprint can lead to buffer errors as what happens with me so often with zbot :( receiving packets of such great unknown length or by chance an error.

That version makes sure it doesn't exceed cbDest bytes making SURE it doesn't overflow :P
But with my use of it aslong as the buffer has enough bytes for " killed " +20 more for char names how could it overflow? That chance error you speak of?


[EDIT] Because i've never seen any error from wsprintf unless it was an overflow caused by the programmer(not chance).
You could use plenty of clientside edits to rape ANY hg out there if you consider the uses of wsprintf. :P
Yeah you did open my eyes a lot just then. But my use still can't overflow :P

So in conclusion of this entire topic. I pwn you all.
Reppin' 127.0.0.1!!!<br><br><img src='http://img502.imageshack.us/img502/1348/sig4daxbn2.jpg' border='0' alt='user posted image' /><br><br>I contend that we are both atheists. I just believe in one fewer god than you do. <br>When you understand why you dismiss all the other possible gods, you will <br>understand why I dismiss yours.<br>~ <b>Stephen Roberts</b>
Post Reply