Problem

Submit your code requests, and if you are good at coding come help others with their requests.
Post Reply
Kiruku
Loyal fan
Posts: 268
Joined: Wed Feb 22, 2006 12:00 pm
Contact:

Post by Kiruku »

Image
please help me :/ its for a Upgrade command u type command the item what should be upgraded break and down from ur feets is the upgraded item.. now i have this problem (I copy from hbsh3 hgserver source what cyrus gaved me with this upgrade commands only other commands not in... so i change hgserver to a better one with everything fixed now i got this error)


if ((memcmp(cItemName,"MagicGem(DEF)",14) == 0) && (ipoints >= 10) && (ipoints - 10 >= 0)) {
ItemDepleteHandler(iClientH, i, TRUE);
<img src='http://lichtdrache.lima-city.de/helbrea ... aramba.gif' border='0' alt='user posted image' />
Tafka12
&lt;3 bd long time
Posts: 772
Joined: Wed Dec 28, 2005 6:32 pm

Post by Tafka12 »

iClientH must stay
i must stay

TRUE? idk :D
<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' />
Kiruku
Loyal fan
Posts: 268
Joined: Wed Feb 22, 2006 12:00 pm
Contact:

Post by Kiruku »

lol but with other things the deplete handler works ... but if u really want

Code: Select all

void CGame::ItemDepleteHandler(int iClientH, short sItemIndex, BOOL bIsUseItemResult, BOOL bIsItemUsed)
{
	if (m_pClientList[iClientH] == NULL) return;
	if (m_pClientList[iClientH]->m_bIsInitComplete == FALSE) return;
	if ((sItemIndex < 0) || (sItemIndex >= DEF_MAXITEMS)) return;
	if (m_pClientList[iClientH]->m_pItemList[sItemIndex] == NULL) return;
	if ((bIsItemUsed == 1) || 
  (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_cItemType == DEF_ITEMTYPE_CONSUME) || 
  (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_cItemType == DEF_ITEMTYPE_EAT) ||
  (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_cItemType == DEF_ITEMTYPE_USE_DEPLETE) || 
  (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_cItemType == DEF_ITEMTYPE_USE_DEPLETE_DEST) ||
  (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_cItemType == DEF_ITEMTYPE_MATERIAL) || 
  (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sIDnum == 380) ||
  (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sIDnum == 381) ||
  (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sIDnum == 382)) {
  _bItemLog(DEF_ITEMLOG_DEPLETE, iClientH, -1, m_pClientList[iClientH]->m_pItemList[sItemIndex], FALSE);
	}
	else if ((m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sIDnum == 247) ||
  (m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sIDnum == 248)) {
  _bItemLog(DEF_ITEMLOG_DEPLETE, iClientH, -1, m_pClientList[iClientH]->m_pItemList[sItemIndex], FALSE);	
	}
	ReleaseItemHandler(iClientH, sItemIndex, TRUE);
	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_ITEMDEPLETED_ERASEITEM, sItemIndex, (int)bIsUseItemResult, NULL, NULL);
	delete m_pClientList[iClientH]->m_pItemList[sItemIndex];
	m_pClientList[iClientH]->m_pItemList[sItemIndex] = NULL;
	m_pClientList[iClientH]->m_bIsItemEquipped[sItemIndex] = FALSE;
	m_pClientList[iClientH]->m_cArrowIndex = _iGetArrowItemIndex(iClientH);
	iCalcTotalWeight(iClientH);
}
<img src='http://lichtdrache.lima-city.de/helbrea ... aramba.gif' border='0' alt='user posted image' />
Kiruku
Loyal fan
Posts: 268
Joined: Wed Feb 22, 2006 12:00 pm
Contact:

Post by Kiruku »

iClientH must stay ?????????????? what u mean with that? i dont know what this 3 parameters mean i dont know whats wrong (if i replace my item deplete handler with the one from hbsh3 i got same 9 errors again and 1 more....)
<img src='http://lichtdrache.lima-city.de/helbrea ... aramba.gif' border='0' alt='user posted image' />
Drazz
Regular
Posts: 52
Joined: Mon Dec 08, 2003 4:10 pm
Contact:

Post by Drazz »

Kiruku wrote: iClientH must stay ?????????????? what u mean with that? i dont know what this 3 parameters mean i dont know whats wrong (if i replace my item deplete handler with the one from hbsh3 i got same 9 errors again and 1 more....)

Code: Select all

void CGame::ItemDepleteHandler(int iClientH, short sItemIndex, BOOL bIsUseItemResult, BOOL bIsItemUsed)
Mmmm I can see 4 parameters in your code (instead of 3)
<img src='http://drazzt.iespana.es/Drazzt/logo2.jpg' border='0' alt='user posted image' />
Kiruku
Loyal fan
Posts: 268
Joined: Wed Feb 22, 2006 12:00 pm
Contact:

Post by Kiruku »

and what to fix and how to fix?


HEEEELLLPPPPP plz :/
<img src='http://lichtdrache.lima-city.de/helbrea ... aramba.gif' border='0' alt='user posted image' />
Tafka12
&lt;3 bd long time
Posts: 772
Joined: Wed Dec 28, 2005 6:32 pm

Post by Tafka12 »

ItemDepleteHandler(iClientH, i, TRUE);

hmm here is 3 parameters but why cant it take.. idk
<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' />
juggalo2
Spamtastic
Posts: 1144
Joined: Sun Jul 17, 2005 5:28 pm

Post by juggalo2 »

lol i see 4>

here why

void CGame::ItemDepleteHandler()int iClientH, short sItemIndex, BOOL bIsUseItemResult, BOOL bIsItemUsed

ok now u got
ItemDepleteHandler(iClientH, i, TRUE);
this one is only doing
int iClientH, short sItemIndex, BOOL bIsUseItemResult
~ the TRUE ->bIsUseItemResult
~~~~~~~~~~~~~~~~~~~~~~~~~~~
ItemDepleteHandler(iClientH, i, TRUE, TRUE);
this one dose all 4
int iClientH, short sItemIndex, BOOL bIsUseItemResult, BOOL bIsItemUsed


:P:)
<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>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kiruku
Loyal fan
Posts: 268
Joined: Wed Feb 22, 2006 12:00 pm
Contact:

Post by Kiruku »

ok every error fixed but i got 3 warnings

Code: Select all

G:\Helbreath\Sources\ChaosHGServ\Game.cpp(58750) : warning C4101: 'iItemID' : unreferenced local variable
G:\Helbreath\Sources\ChaosHGServ\Game.cpp(58799) : warning C4101: 'iItemID' : unreferenced local variable
G:\Helbreath\Sources\ChaosHGServ\Game.cpp(58848) : warning C4101: 'iItemID' : unreferenced local variable
here is one of it in code

Code: Select all

void CGame::PlayerOrder_DmgGem(int iClientH) {
{
int i;
char buff [100];




int iItemID;




char cItemName[20];
int ipoints;
if (m_pClientList[iClientH] == NULL) return;
ipoints=0;
for (i = 0; i < DEF_MAXITEMS; i++) {
 if ((m_pClientList[iClientH]->m_pItemList[i] != NULL) && (memcmp(m_pClientList[iClientH]->m_pItemList[i]->m_cName, "MagicGem(DMG)", 13) == 0)) {
  ZeroMemory(cItemName,sizeof(cItemName));
  memcpy(cItemName,m_pClientList[iClientH]->m_pItemList[i]->m_cName,strlen(m_pClientList[iClientH]->m_pItemList[i]->m_cName));
  wsprintf(buff,"(!) %s depletes %s",m_pClientList[iClientH]->m_cCharName,cItemName);
  ipoints = m_pClientList[iClientH]->m_iGizonItemUpgradeLeft;
  PutLogList(buff);
  if (ipoints < 10) return; 
  if ((memcmp(cItemName,"MagicGem(DMG)",14) == 0) && (ipoints >= 10) && (ipoints - 10 >= 0)) {
   ItemDepleteHandler(iClientH, i, TRUE, TRUE); 
   ipoints -= 10;  
   DropItemID(iClientH,938,m_pClientList[iClientH]->m_sX,m_pClientList[iClientH]->m_sY); 
   m_pClientList[iClientH]->m_iGizonItemUpgradeLeft = ipoints; 
   wsprintf(buff," Majestic upgrade decreased 10 points");
   ShowRepNotice(iClientH,buff); 
   return;
   }
  if ((memcmp(cItemName,"MagicGem(DMG)+1",15) == 0) && (ipoints >= 20) && (ipoints - 20 >= 0)) { 
   ItemDepleteHandler(iClientH, i, TRUE, TRUE); 
   ipoints -= 20;
   DropItemID(iClientH,939,m_pClientList[iClientH]->m_sX,m_pClientList[iClientH]->m_sY);
   m_pClientList[iClientH]->m_iGizonItemUpgradeLeft = ipoints;
   wsprintf(buff," Majestic upgrade decreased 20 points");
   ShowRepNotice(iClientH,buff);
   return;
  }
  if ((memcmp(cItemName,"MagicGem(DMG)+2",15) == 0) && (ipoints >= 30) && (ipoints - 30 >= 0)) { 
   ItemDepleteHandler(iClientH, i, TRUE, TRUE); 
   ipoints -= 30;
   DropItemID(iClientH,940,m_pClientList[iClientH]->m_sX,m_pClientList[iClientH]->m_sY);
   m_pClientList[iClientH]->m_iGizonItemUpgradeLeft = ipoints;
   wsprintf(buff," Majestic upgrade decreased 30 points");
   ShowRepNotice(iClientH,buff);
   return;
  }
 }
}
}
}
i think it has something to do with the ItemDepleteHandler because before life gaved me his fix they wasnt there
<img src='http://lichtdrache.lima-city.de/helbrea ... aramba.gif' border='0' alt='user posted image' />
Kiruku
Loyal fan
Posts: 268
Joined: Wed Feb 22, 2006 12:00 pm
Contact:

Post by Kiruku »

plz help me fix this warnings...
<img src='http://lichtdrache.lima-city.de/helbrea ... aramba.gif' border='0' alt='user posted image' />
BlueChristmas
Loyal fan
Posts: 216
Joined: Wed Apr 19, 2006 12:19 am

Post by BlueChristmas »

Kiruku wrote: plz help me fix this warnings...
easy fix but i forgot where i put my c++ stuff -.-
<img src='http://img114.imageshack.us/img114/8618 ... 2dy3lx.jpg' border='0' alt='user posted image' />
Kiruku
Loyal fan
Posts: 268
Joined: Wed Feb 22, 2006 12:00 pm
Contact:

Post by Kiruku »

why u dont use the comp search ? ctrl+f on explorer then u should find it :D
<img src='http://lichtdrache.lima-city.de/helbrea ... aramba.gif' border='0' alt='user posted image' />
Post Reply