[req] Auto Clearmap

Codes already submitted by people of the forums.
juggalo2
Spamtastic
Posts: 1144
Joined: Sun Jul 17, 2005 5:28 pm

Post by juggalo2 »

this code is usless for a serious server cua wtf hapopens if ur huinting hc and u kill it and the item drop just as it clear map now i know alot of ppl will be mad.

but good code

p.s shoudl amke it so u put on ever item drop so ti has a timer when it clears
<img src='http://lifeplaysu420.com/unknow/nightsign.png' border='0' alt='user posted image' /><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>Wanna make money for surfing the net sing up at <br><a href='http://www.cashfiesta.com/php/join.php? ... yprivitera' target='_blank'>cash fiesta</a><br>its all free hey why ntot make money while fucking around on the computer<br><br><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
KLKS
Loyal fan
Posts: 218
Joined: Sun Feb 22, 2004 2:32 pm

Post by KLKS »

juggalo2 maybe u should look at my code before u comment :)
if a hc dies and items drop and autoclean is called, the items wont be deleted cos its < 5 mins :P.

autoclean code runs every 10minutes and removes items on ground longer than 5 minutes. i plan to make it configurable from a config file
Aryes
Member
Posts: 114
Joined: Tue Aug 31, 2004 10:14 pm
Location: Brazil

Post by Aryes »

What people is not understanding is that the item will be deleted from the tile, 5 mins after IT WAS DROPPED ON THE GROUND, and not 5 mins after the last time the tile was cleaned. ;)

Very useful code by the way.
====<span style='color:red'><br>Aryes</span><br>====<br><br>HB United: www.hbuonline.net:<br><br><img src="http://hbtop50.com/button.php?u=hbkhispano" alt="Helbreath Top 50 - Helbreath Silver" border="0" /><br><img src="http://hbtop50.com/button.php?u=dcom" alt="Helbreath Top 50 - Helbreath Silver" border="0" /><br><img src="http://hbtop50.com/button.php?u=tinchocba" alt="Helbreath Top 50 - Helbreath Silver" border="0" /><br><img src="http://hbtop50.com/button.php?u=rafha_bernn" alt="Helbreath Top 50 - Helbreath Silver" border="0" /><br><img src="http://hbtop50.com/button.php?u=HB-Tere" alt="Helbreath Top 50 - Helbreath Silver" border="0" /><br><img src="http://hbtop50.com/button.php?u=Kiruku" alt="Helbreath Top 50 - Helbreath Silver" border="0" />
Treax2
Loyal fan
Posts: 281
Joined: Fri Mar 04, 2005 5:05 pm
Location: Estonia
Contact:

Post by Treax2 »

Wow that i like ... against new code to coleltion but i am gonna add to that code ... enable and disable command ... coz if ur makeing hide and seek or some item drop events then u can put /autoclearemap 0 and it wont work anymore ...
Tafka12
&lt;3 bd long time
Posts: 772
Joined: Wed Dec 28, 2005 6:32 pm

Post by Tafka12 »

People, you had pointless fight.. What if someone drops Hyper Slayer and it's gone... Don't put it in your source if you need five minutes to do a small click.
to KLKS - Great code, added in my HG :lol:
<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' />
locobans
Outpost Junkie
Posts: 2264
Joined: Tue Jul 13, 2004 3:51 am
Location: Behind You
Contact:

Post by locobans »

Nice code KLKS ^_^
QUOTE (ADDKiD @ Dec 1 2006, 4:01 PM) <br>You guys make me laugh alot, half the shit I say, is bullshit...<br><br><img src='http://img485.imageshack.us/img485/492/banssig1ng.gif' border='0' alt='user posted image' /><br><br><b>I see no changes at all, wake up in the morning and ask myself...<br>Is life worth living? Should I blast myself?</b><br><br><b><a href='http://2paclegacy.com' target='_blank'>2PacLegacy.com</a></b>
KLKS
Loyal fan
Posts: 218
Joined: Sun Feb 22, 2004 2:32 pm

Post by KLKS »

i like the idea, /enableautocleanmap to turn on and off autoclean.
juggalo2
Spamtastic
Posts: 1144
Joined: Sun Jul 17, 2005 5:28 pm

Post by juggalo2 »

is it me or have anyone esle go this to work
<img src='http://lifeplaysu420.com/unknow/nightsign.png' border='0' alt='user posted image' /><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>Wanna make money for surfing the net sing up at <br><a href='http://www.cashfiesta.com/php/join.php? ... yprivitera' target='_blank'>cash fiesta</a><br>its all free hey why ntot make money while fucking around on the computer<br><br><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
KLKS
Loyal fan
Posts: 218
Joined: Sun Feb 22, 2004 2:32 pm

Post by KLKS »

untested code, so i'm hoping someone has managed to test it and tell me if it works or not :P
SlammeR
Loyal fan
Posts: 219
Joined: Fri Nov 04, 2005 1:52 am
Location: Brazil

Post by SlammeR »

Added The Code In To Sources Then used Shetar Suggestions and the Result...

Code: Select all

void CGame::AutoClearMap()
{

int i, k, j, m_y, m_x;
short sOwner;
char cOwnerType;

for (i = 0; i < DEF_MAXMAPS; i++) { //Enum all maps
if (m_pMapList[i] != NULL) { //Is allocated map
m_x = m_pMapList[i]->m_sSizeX;
m_y = m_pMapList[i]->m_sSizeY;
for(j = 1; j < m_x; j++) {
for(k = 1; k < m_y; k++){
m_pMapList[m_pClientList[i]->m_cMapIndex]->GetOwner(&sOwner, &cOwnerType, j, k);
if (sOwner == NULL || cOwnerType != DEF_OWNERTYPE_PLAYER) {
m_pMapList[i]->CleanTile(j, k, dwItemDeleteDelay);
}
}
}
}
}

PutLogList("(!!!) AutoClearMap Executed!");

//Update last clean time
dwItemCleanLastTime = GetTickCount();
} 

Code: Select all

--------------------Configuration: HGserver - Win32 Debug--------------------
Compiling...
Game.cpp
C:\Documents and Settings\SlammeR\Desktop\2.24b Sources\Game.cpp(2011) : warning C4305: '=' : truncation from 'const int' to 'char'
C:\Documents and Settings\SlammeR\Desktop\2.24b Sources\Game.cpp(2011) : warning C4309: '=' : truncation of constant value
C:\Documents and Settings\SlammeR\Desktop\2.24b Sources\Game.cpp(8755) : warning C4305: '=' : truncation from 'const int' to 'short'
C:\Documents and Settings\SlammeR\Desktop\2.24b Sources\Game.cpp(8755) : warning C4309: '=' : truncation of constant value
C:\Documents and Settings\SlammeR\Desktop\2.24b Sources\Game.cpp(23800) : warning C4700: local variable 'cMapIndex' used without having been initialized
Linking...
Game.obj : error LNK2001: unresolved external symbol "public: void __thiscall CMap::RestoreStrikePoints(void)" (?RestoreStrikePoints@CMap@@QAEXXZ)
Debug/HGserver.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

HGserver.exe - 2 error(s), 5 warning(s)
halp...
OWNED!<br><img src='http://img50.imageshack.us/img50/1386/p ... 3vsqn2.gif' border='0' alt='user posted image' /><br><br><img src="http://hbtop50.com/button.php?u=hbuonline" alt="Helbreath Top 50 - Keepin' it real." border="0" /><br><a href='http://www.hbuonline.net' target='_blank'>Helbreath United</a>
locobans
Outpost Junkie
Posts: 2264
Joined: Tue Jul 13, 2004 3:51 am
Location: Behind You
Contact:

Post by locobans »

IT seems...you don't have the erm...

RestoreStrikePoints

Definied in map.cpp under CMap class.
QUOTE (ADDKiD @ Dec 1 2006, 4:01 PM) <br>You guys make me laugh alot, half the shit I say, is bullshit...<br><br><img src='http://img485.imageshack.us/img485/492/banssig1ng.gif' border='0' alt='user posted image' /><br><br><b>I see no changes at all, wake up in the morning and ask myself...<br>Is life worth living? Should I blast myself?</b><br><br><b><a href='http://2paclegacy.com' target='_blank'>2PacLegacy.com</a></b>
MiNiFooBoo
noob
Posts: 10
Joined: Sun May 07, 2006 9:18 pm

Post by MiNiFooBoo »

I can add it all with no problems, but as soon as I try to add this part I get like 102 errors >.<

Code: Select all

in DropItemHandler add

 if ((m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sItemEffectType == DEF_ITEMEFFECTTYPE_ALTERITEMDROP) && 
  (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_wCurLifeSpan == 0)) {
   delete m_pClientList[iClientH]->m_pItemList[sItemIndex];
   m_pClientList[iClientH]->m_pItemList[sItemIndex] = NULL;
  }
 else {
  //Update item time *NEW*
  m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_dwItemTime = GetTickCount();

  m_pMapList[ m_pClientList[iClientH]->m_cMapIndex ]->bSetItem(m_pClientList[iClientH]->m_sX, 
   m_pClientList[iClientH]->m_sY, 
   m_pClientList[iClientH]->m_pItemList[sItemIndex]);
tiidik
noob
Posts: 12
Joined: Wed Mar 22, 2006 12:17 pm

Post by tiidik »

else function must end with }
MiNiFooBoo
noob
Posts: 10
Joined: Sun May 07, 2006 9:18 pm

Post by MiNiFooBoo »

Okay so I added it all and made it compile, but it don't work >.<
Pollof
noob
Posts: 15
Joined: Sat Jan 14, 2006 5:51 pm

Post by Pollof »

What is the "Class"... example:

<!--QuoteBegin-"KLKS"+--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td>QUOTE ("KLKS")</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->in "class CGame" add[/quote]
Post Reply