Ek Commands

Discussion about Helbreath Server Files.
Post Reply
Dshaked
<3 bd long time
Posts: 747
Joined: Tue Oct 11, 2005 6:40 pm

Post by Dshaked »

It is possible make command like this.
/addek (playername) 10
and then
/deleteek (playername) 10 if dont got enough eks, hg tolds it to gm.
I mean this is command for gms, easier way transf eks.
/setek, can set player or gm eks.
Want someone help me make this?
I think this is old idea.
Old Helbreath Nemesis Player<br><img src='http://img232.imageshack.us/img232/9784/dshakedqc5.jpg' border='0' alt='user posted image' /><br><img src='http://img232.imageshack.us/img232/6475 ... barqj0.jpg' border='0' alt='user posted image' /><br><a href='index.php?showtopic=7107&hl=' target='_blank'>MainServer Hexing Tutorial</a><br><a href='index.php?showtopic=7663&hl=x-mas' target='_blank'>My Files</a>
Drajwer
&lt;3 bd long time
Posts: 841
Joined: Fri Dec 10, 2004 3:24 pm

Post by Drajwer »

Code: Select all

	if (memcmp (cp, "/setek ", 7) == 0)
  	{
    AdminOrder_SetEK (iClientH, cp, dwMsgSize - 21);
    return;
  	} 
...

Code: Select all

void
CGame::AdminOrder_SetEK (int iClientH, char *pData, DWORD dwMsgSize)
{
	char seps[] = "= \t\n";
	char *token, cBuff[256];
	class CStrTok *pStrTok;
	char *pk;
	char cNick[20];
	char cPK[5];
	char notice[100];
	int oldpk;
	int i;
	if (m_pClientList[iClientH] == NULL)
  return;
	if ((dwMsgSize) <= 0)
  return;
	if (m_pClientList[iClientH]->m_iAdminUserLevel == 0)
	{
  SendNotifyMsg (NULL, iClientH, DEF_NOTIFY_ADMINUSERLEVELLOW, NULL, NULL,
  	NULL, NULL);
  return;
	}
	ZeroMemory (cBuff, sizeof (cBuff));
	memcpy (cBuff, pData, dwMsgSize);
	pStrTok = new class CStrTok (cBuff, seps);
	token = pStrTok->pGet ();
	token = pStrTok->pGet ();
	if (token == NULL)
	{
  delete pStrTok;
  return;
	}
	strcpy (cNick, token);
	pk = pStrTok->pGet ();
	if (pk == NULL)
	{
  delete pStrTok;
  return;
	}
	strcpy (cPK, pk);
	for (i = 0; i < DEF_MAXCLIENTS; i++)
	{
  if ((m_pClientList[i] != NULL)
  	&& (memcmp (m_pClientList[i]->m_cCharName, cNick, strlen (cNick)) ==
  	0))
  {
  	oldpk = m_pClientList[i]->m_iEnemyKillCount;
  	m_pClientList[i]->m_iEnemyKillCount = atoi (cPK);
  	SendNotifyMsg (NULL, i, DEF_NOTIFY_ENEMYKILLS,
    m_pClientList[i]->m_iEnemyKillCount, NULL, NULL,
    NULL);
  	wsprintf (notice,
    "EK Count has been changed for player %s from %d to %d.",
    m_pClientList[iClientH]->m_cCharName, oldpk, atoi (cPK));
  	ShowNotice (iClientH, notice);
  }
	}
	delete pStrTok;
} 
i think addek and deleteek are useless.
<img src='http://img440.imageshack.us/img440/2627/15pt.jpg' border='0' alt='user posted image' /><br><br>HBPolska characters:<br><br>Hellios 150+ Aresden Hero Mage<br>TheBill 120 Aresden plrider<br>Kill_Me 100 Full-Hero plrider<br>Rockeater 110+ Aresden Plate Mage<br><br><a href='http://www.helbreath.org' target='_blank'>http://www.helbreath.org</a> come and play (250 ppl online)
Dshaked
&lt;3 bd long time
Posts: 747
Joined: Tue Oct 11, 2005 6:40 pm

Post by Dshaked »

Thx
Ok this is enough.
If you got time can you make other cmds?
Old Helbreath Nemesis Player<br><img src='http://img232.imageshack.us/img232/9784/dshakedqc5.jpg' border='0' alt='user posted image' /><br><img src='http://img232.imageshack.us/img232/6475 ... barqj0.jpg' border='0' alt='user posted image' /><br><a href='index.php?showtopic=7107&hl=' target='_blank'>MainServer Hexing Tutorial</a><br><a href='index.php?showtopic=7663&hl=x-mas' target='_blank'>My Files</a>
Tafka12
&lt;3 bd long time
Posts: 772
Joined: Wed Dec 28, 2005 6:32 pm

Post by Tafka12 »

/deleteek would be good for doing EK trade.
/deleteek 500 and you get a zerk wand for it? :)

but for that
change this part:
m_pClientList->m_iEnemyKillCount = atoi (cPK);
to
m_pClientList->m_iEnemyKillCount -= atoi (cPK);

right?
<img src='http://www.hot.ee/carvanho/taavi.png' border='0' alt='user posted image' /><br><br><img src='http://www.hot.ee/carvanho/Elvine.png' border='0' alt='user posted image' /><br><img src='http://www.hot.ee/carvanho/LieroX.png' border='0' alt='user posted image' /><br><img src='http://www.hot.ee/carvanho/Football.png' border='0' alt='user posted image' />
Dshaked
&lt;3 bd long time
Posts: 747
Joined: Tue Oct 11, 2005 6:40 pm

Post by Dshaked »

Tafka, right the /addek works, but if I write /deleteek GM1 1000, and GM1 got only 900 eks, it delete 1000eks, and then I got -100 eks.
I think this need some security check?
Or people can piss gms?
Or tilt characters?
If write deleteek 1000, and guy got only 900, HGserver says, not enough eks?
Old Helbreath Nemesis Player<br><img src='http://img232.imageshack.us/img232/9784/dshakedqc5.jpg' border='0' alt='user posted image' /><br><img src='http://img232.imageshack.us/img232/6475 ... barqj0.jpg' border='0' alt='user posted image' /><br><a href='index.php?showtopic=7107&hl=' target='_blank'>MainServer Hexing Tutorial</a><br><a href='index.php?showtopic=7663&hl=x-mas' target='_blank'>My Files</a>
diuuude
Outpost bitch
Posts: 592
Joined: Wed Dec 28, 2005 11:57 pm

Post by diuuude »

if (ek < 0) ek = 0;


This will remove the negative EKs bug ;)
<a href='http://www.technohell.net' target='_blank'><b><span style='color:red'>>>> Helbreath Ressources Website Here <<<</span></b></a><br>C++ Sources, Tools, Server Files, Help on Forum, C++ Snippets, Toplist... Updated often, come visit us !
Tafka12
&lt;3 bd long time
Posts: 772
Joined: Wed Dec 28, 2005 6:32 pm

Post by Tafka12 »

lol thats it
very simply ;)
<img src='http://www.hot.ee/carvanho/taavi.png' border='0' alt='user posted image' /><br><br><img src='http://www.hot.ee/carvanho/Elvine.png' border='0' alt='user posted image' /><br><img src='http://www.hot.ee/carvanho/LieroX.png' border='0' alt='user posted image' /><br><img src='http://www.hot.ee/carvanho/Football.png' border='0' alt='user posted image' />
Dshaked
&lt;3 bd long time
Posts: 747
Joined: Tue Oct 11, 2005 6:40 pm

Post by Dshaked »

I decleared ek BOOL ek;
And how this can show message, if dont got enough eks?
Old Helbreath Nemesis Player<br><img src='http://img232.imageshack.us/img232/9784/dshakedqc5.jpg' border='0' alt='user posted image' /><br><img src='http://img232.imageshack.us/img232/6475 ... barqj0.jpg' border='0' alt='user posted image' /><br><a href='index.php?showtopic=7107&hl=' target='_blank'>MainServer Hexing Tutorial</a><br><a href='index.php?showtopic=7663&hl=x-mas' target='_blank'>My Files</a>
Drajwer
&lt;3 bd long time
Posts: 841
Joined: Fri Dec 10, 2004 3:24 pm

Post by Drajwer »

lol

Code: Select all

void
CGame::AdminOrder_DelEK (int iClientH, char *pData, DWORD dwMsgSize)
{
char seps[] = "= \t\n";
char *token, cBuff[256];
class CStrTok *pStrTok;
char *pk;
char cNick[20];
char cPK[5];
char notice[100];

int oldpk;
int ek;
int i;
if (m_pClientList[iClientH] == NULL)
 return;
if ((dwMsgSize) <= 0)
 return;
if (m_pClientList[iClientH]->m_iAdminUserLevel == 0)
{
 SendNotifyMsg (NULL, iClientH, DEF_NOTIFY_ADMINUSERLEVELLOW, NULL, NULL,
  NULL, NULL);
 return;
}
ZeroMemory (cBuff, sizeof (cBuff));
memcpy (cBuff, pData, dwMsgSize);
pStrTok = new class CStrTok (cBuff, seps);
token = pStrTok->pGet ();
token = pStrTok->pGet ();
if (token == NULL)
{
 delete pStrTok;
 return;
}
strcpy (cNick, token);
pk = pStrTok->pGet ();
if (pk == NULL)
{
 delete pStrTok;
 return;
}
strcpy (cPK, pk);
for (i = 0; i < DEF_MAXCLIENTS; i++)
{
 if ((m_pClientList[i] != NULL)
  && (memcmp (m_pClientList[i]->m_cCharName, cNick, strlen (cNick)) ==
  0))
 {
  oldpk = m_pClientList[i]->m_iEnemyKillCount;
ek=oldpk-atoi(cPK);
if (ek>0) {
  m_pClientList[i]->m_iEnemyKillCount = ek;
  SendNotifyMsg (NULL, i, DEF_NOTIFY_ENEMYKILLS,
   m_pClientList[i]->m_iEnemyKillCount, NULL, NULL,
   NULL);
  wsprintf (notice,
   "EK Count has been changed for player %s from %d to %d.",
   m_pClientList[iClientH]->m_cCharName, oldpk, atoi (cPK));
  ShowNotice (iClientH, notice);
 }
}
else {
  wsprintf (notice,
   "Cannot delete ek from player %s!",
   m_pClientList[i]->m_cCharName);
  ShowNotice (iClientH, notice);
}
}
delete pStrTok;
} 
<img src='http://img440.imageshack.us/img440/2627/15pt.jpg' border='0' alt='user posted image' /><br><br>HBPolska characters:<br><br>Hellios 150+ Aresden Hero Mage<br>TheBill 120 Aresden plrider<br>Kill_Me 100 Full-Hero plrider<br>Rockeater 110+ Aresden Plate Mage<br><br><a href='http://www.helbreath.org' target='_blank'>http://www.helbreath.org</a> come and play (250 ppl online)
Dshaked
&lt;3 bd long time
Posts: 747
Joined: Tue Oct 11, 2005 6:40 pm

Post by Dshaked »

Oh thx my living angel ^^
Old Helbreath Nemesis Player<br><img src='http://img232.imageshack.us/img232/9784/dshakedqc5.jpg' border='0' alt='user posted image' /><br><img src='http://img232.imageshack.us/img232/6475 ... barqj0.jpg' border='0' alt='user posted image' /><br><a href='index.php?showtopic=7107&hl=' target='_blank'>MainServer Hexing Tutorial</a><br><a href='index.php?showtopic=7663&hl=x-mas' target='_blank'>My Files</a>
Dshaked
&lt;3 bd long time
Posts: 747
Joined: Tue Oct 11, 2005 6:40 pm

Post by Dshaked »

I changed a message too low ek count, now it works, but always when i remove eks, it says too low ek count XD
And when I got 300 eks, and i write /deleteek GM1 300, it wont remove it:D
It shows player ek count is too low like 100 times
Old Helbreath Nemesis Player<br><img src='http://img232.imageshack.us/img232/9784/dshakedqc5.jpg' border='0' alt='user posted image' /><br><img src='http://img232.imageshack.us/img232/6475 ... barqj0.jpg' border='0' alt='user posted image' /><br><a href='index.php?showtopic=7107&hl=' target='_blank'>MainServer Hexing Tutorial</a><br><a href='index.php?showtopic=7663&hl=x-mas' target='_blank'>My Files</a>
Tafka12
&lt;3 bd long time
Posts: 772
Joined: Wed Dec 28, 2005 6:32 pm

Post by Tafka12 »

just add else if where it checks if EK Count is higher than EK you want to remove and then gives a message.
<img src='http://www.hot.ee/carvanho/taavi.png' border='0' alt='user posted image' /><br><br><img src='http://www.hot.ee/carvanho/Elvine.png' border='0' alt='user posted image' /><br><img src='http://www.hot.ee/carvanho/LieroX.png' border='0' alt='user posted image' /><br><img src='http://www.hot.ee/carvanho/Football.png' border='0' alt='user posted image' />
Dshaked
&lt;3 bd long time
Posts: 747
Joined: Tue Oct 11, 2005 6:40 pm

Post by Dshaked »

Im not a coder, im copy paster just now XD
Old Helbreath Nemesis Player<br><img src='http://img232.imageshack.us/img232/9784/dshakedqc5.jpg' border='0' alt='user posted image' /><br><img src='http://img232.imageshack.us/img232/6475 ... barqj0.jpg' border='0' alt='user posted image' /><br><a href='index.php?showtopic=7107&hl=' target='_blank'>MainServer Hexing Tutorial</a><br><a href='index.php?showtopic=7663&hl=x-mas' target='_blank'>My Files</a>
diuuude
Outpost bitch
Posts: 592
Joined: Wed Dec 28, 2005 11:57 pm

Post by diuuude »

if <span style='color:red'>(ek>0)</span> {
m_pClientList->m_iEnemyKillCount = ek;
SendNotifyMsg (NULL, i, DEF_NOTIFY_ENEMYKILLS,
  m_pClientList->m_iEnemyKillCount, NULL, NULL,
  NULL);
wsprintf (notice,
  "EK Count has been changed for player %s from %d to %d.",
  m_pClientList[iClientH]->m_cCharName, oldpk, atoi (cPK));
ShowNotice (iClientH, notice);
}

if <span style='color:red'>(ek>=0)</span> {
m_pClientList->m_iEnemyKillCount = ek;
SendNotifyMsg (NULL, i, DEF_NOTIFY_ENEMYKILLS,
  m_pClientList->m_iEnemyKillCount, NULL, NULL,
  NULL);
wsprintf (notice,
  "EK Count has been changed for player %s from %d to %d.",
  m_pClientList[iClientH]->m_cCharName, oldpk, atoi (cPK));
ShowNotice (iClientH, notice);
}


this will allow you to delete EKs if remaining amount is equal to Zero
<a href='http://www.technohell.net' target='_blank'><b><span style='color:red'>>>> Helbreath Ressources Website Here <<<</span></b></a><br>C++ Sources, Tools, Server Files, Help on Forum, C++ Snippets, Toplist... Updated often, come visit us !
Dshaked
&lt;3 bd long time
Posts: 747
Joined: Tue Oct 11, 2005 6:40 pm

Post by Dshaked »

Nice it works.
Old Helbreath Nemesis Player<br><img src='http://img232.imageshack.us/img232/9784/dshakedqc5.jpg' border='0' alt='user posted image' /><br><img src='http://img232.imageshack.us/img232/6475 ... barqj0.jpg' border='0' alt='user posted image' /><br><a href='index.php?showtopic=7107&hl=' target='_blank'>MainServer Hexing Tutorial</a><br><a href='index.php?showtopic=7663&hl=x-mas' target='_blank'>My Files</a>
Post Reply