[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&#58;&#58;AutoClearMap&#40;&#41;
&#123;

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

for &#40;i = 0; i < DEF_MAXMAPS; i++&#41; &#123; //Enum all maps
if &#40;m_pMapList&#91;i&#93; != NULL&#41; &#123; //Is allocated map
m_x = m_pMapList&#91;i&#93;->m_sSizeX;
m_y = m_pMapList&#91;i&#93;->m_sSizeY;
for&#40;j = 1; j < m_x; j++&#41; &#123;
for&#40;k = 1; k < m_y; k++&#41;&#123;
m_pMapList&#91;m_pClientList&#91;i&#93;->m_cMapIndex&#93;->GetOwner&#40;&sOwner, &cOwnerType, j, k&#41;;
if &#40;sOwner == NULL || cOwnerType != DEF_OWNERTYPE_PLAYER&#41; &#123;
m_pMapList&#91;i&#93;->CleanTile&#40;j, k, dwItemDeleteDelay&#41;;
&#125;
&#125;
&#125;
&#125;
&#125;

PutLogList&#40;"&#40;!!!&#41; AutoClearMap Executed!"&#41;;

//Update last clean time
dwItemCleanLastTime = GetTickCount&#40;&#41;;
&#125; 

Code: Select all

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

HGserver.exe - 2 error&#40;s&#41;, 5 warning&#40;s&#41;
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 &#40;&#40;m_pClientList&#91;iClientH&#93;->m_pItemList&#91;sItemIndex&#93;->m_sItemEffectType == DEF_ITEMEFFECTTYPE_ALTERITEMDROP&#41; && 
 &nbsp;&#40;m_pClientList&#91;iClientH&#93;->m_pItemList&#91;sItemIndex&#93;->m_wCurLifeSpan == 0&#41;&#41; &#123;
 &nbsp; delete m_pClientList&#91;iClientH&#93;->m_pItemList&#91;sItemIndex&#93;;
 &nbsp; m_pClientList&#91;iClientH&#93;->m_pItemList&#91;sItemIndex&#93; = NULL;
 &nbsp;&#125;
 else &#123;
 &nbsp;//Update item time *NEW*
 &nbsp;m_pClientList&#91;iClientH&#93;->m_pItemList&#91;sItemIndex&#93;->m_dwItemTime = GetTickCount&#40;&#41;;

 &nbsp;m_pMapList&#91; m_pClientList&#91;iClientH&#93;->m_cMapIndex &#93;->bSetItem&#40;m_pClientList&#91;iClientH&#93;->m_sX, 
 &nbsp; m_pClientList&#91;iClientH&#93;->m_sY, 
 &nbsp; m_pClientList&#91;iClientH&#93;->m_pItemList&#91;sItemIndex&#93;&#41;;
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