[Req] GuildMaster more than 1 Char

Submit your code requests, and if you are good at coding come help others with their requests.
Ace
Regular
Posts: 68
Joined: Sat Apr 03, 2004 5:14 am

Post by Ace »

anybody help pls :( :( :huh: :D
lirannn
Regular
Posts: 56
Joined: Fri Sep 08, 2006 7:17 pm

Post by lirannn »

Code: Select all

void CGuild::UserCommand_AddGuildMaster(int iClientH, char * pData, DWORD dwMsgSize)
{
 char   seps[] = "= \t\n";
 char   * token, cTargetName[11], cBuff[256];
 class  CStrTok * pStrTok;
 register int i, m_iGuildGUID;

	if ( G_pGame->m_pClientList[ iClientH ] == NULL) return;
	if ((dwMsgSize)	<= 0) return;

	if ( G_pGame->m_pClientList[ iClientH ]->m_iGuildRank != 0 ) {
  G_pGame->SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_NOGUILDMASTERLEVEL, NULL, NULL, NULL, NULL);
  return;
	}

	ZeroMemory(cTargetName, sizeof(cTargetName));
	ZeroMemory(cBuff, sizeof(cBuff));
	memcpy(cBuff, pData, dwMsgSize);

	pStrTok = new class CStrTok(cBuff, seps);
	token = pStrTok->pGet();
	token = pStrTok->pGet();
    
	if (token != NULL) {
  if (strlen(token) > 10) 
    memcpy(cTargetName, token, 10);
  else memcpy(cTargetName, token, strlen(token));
  
  for (i = 1; i < DEF_MAXCLIENTS; i++) 
  if (( G_pGame->m_pClientList[ i ] != NULL) && (memcmp( G_pGame->m_pClientList[ i ]->m_cCharName, cTargetName, 10) == 0) ) { 

  	if (memcmp( G_pGame->m_pClientList[ iClientH ]->m_cGuildName, G_pGame->m_pClientList[ i ]->m_cGuildName, 20) != 0)  {
    
    G_pGame->SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_CANNOTBANGUILDMAN, NULL, NULL, NULL, NULL);
    delete pStrTok;
    return;
  	}
  	G_pGame->bSendMsgToLS(MSGID_REQUEST_UPDATEGUILDINFO_DELGUILDSMAN, i);
  	SendGuildMsg(i, DEF_NOTIFY_DISMISSGUILDSMAN, NULL, NULL, NULL);
	
  
  	G_pGame->m_pClientList[ i ]->m_iGuildRank = 0; 


      G_pGame->SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_SUCCESSADDGM, NULL, NULL, NULL, NULL);
  	G_pGame->SendNotifyMsg(iClientH, i, DEF_COMMONTYPE_BANGUILD, NULL, NULL, NULL, NULL);
  	G_pGame->SendEventToNearClient_TypeA(i, DEF_OWNERTYPE_PLAYER, MSGID_EVENT_MOTION, DEF_OBJECTNULLACTION, NULL, NULL, NULL);
  
  	delete pStrTok;
  	return;
  }
  G_pGame->SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_PLAYERNOTONGAME, NULL, NULL, NULL, cTargetName);
	}

	delete pStrTok;
	return;
}
(not tested)

based on ban guildsman, you should be able to finish it yourself.
<span style='color:green'>Danny says:u dont know how much u can make from weed ,make any item of clothing. im fucking serious, real good ropes!</span><br><br>Helbreath reborn, be there;)<br>owner of hbr.
Ace
Regular
Posts: 68
Joined: Sat Apr 03, 2004 5:14 am

Post by Ace »

put in Game.cpp rite ? i confuse about CGuild?
lirannn
Regular
Posts: 56
Joined: Fri Sep 08, 2006 7:17 pm

Post by lirannn »

if you add it to cgame change it to CGame.
put it under ban guildsman.
<span style='color:green'>Danny says:u dont know how much u can make from weed ,make any item of clothing. im fucking serious, real good ropes!</span><br><br>Helbreath reborn, be there;)<br>owner of hbr.
Ace
Regular
Posts: 68
Joined: Sat Apr 03, 2004 5:14 am

Post by Ace »

i got 1 error :( :
E:\HelBreath Resources\HG Sources\Game.cpp(36503) : error C2065: 'DEF_NOTIFY_SUCCESSADDGM' : undeclared identifier

Code: Select all

SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_SUCCESSADDGM, NULL, NULL, NULL, NULL);
just add the case ?
Crossfade
Loyal fan
Posts: 354
Joined: Sun Mar 20, 2005 5:55 pm

Post by Crossfade »

Ace wrote: i got 1 error :( :
E:\HelBreath Resources\HG Sources\Game.cpp(36503) : error C2065: 'DEF_NOTIFY_SUCCESSADDGM' : undeclared identifier

Code: Select all

SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_SUCCESSADDGM, NULL, NULL, NULL, NULL);
just add the case ?
-.- its a send notify to client and then back to hg, so it requires a little bit of extra coding
lirannn
Regular
Posts: 56
Joined: Fri Sep 08, 2006 7:17 pm

Post by lirannn »

thats the point.
<span style='color:green'>Danny says:u dont know how much u can make from weed ,make any item of clothing. im fucking serious, real good ropes!</span><br><br>Helbreath reborn, be there;)<br>owner of hbr.
Orkl
Loyal fan
Posts: 376
Joined: Sat Sep 17, 2005 2:31 pm

Post by Orkl »

Ace wrote: i got 1 error :( :
E:\HelBreath Resources\HG Sources\Game.cpp(36503) : error C2065: 'DEF_NOTIFY_SUCCESSADDGM' : undeclared identifier

Code: Select all

SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_SUCCESSADDGM, NULL, NULL, NULL, NULL);
just add the case ?
undeclared identifier = you haven't defined it...

You're trying to send DEF_NOTIFY_SUCCESSADDGM and it has no idea wtf you are on about.. Try definind it and you'll be fine.

<!--QuoteBegin-crazymnig88+--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (crazymnig88)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->by notepad??? it didn't show any code, just show words wif no mean<!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd--><br><!--QuoteBegin-charlie+--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (charlie)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->he'll probably save it as 600pagebook.bmp<br><br>400gb file plzkthnx<!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd-->
Ace
Regular
Posts: 68
Joined: Sat Apr 03, 2004 5:14 am

Post by Ace »

ohh need write code for declare it <_< help plz :( :(
ADDKiD
&lt;3 bd long time
Posts: 967
Joined: Tue Jul 12, 2005 8:07 pm
Location: Washington, USA
Contact:

Post by ADDKiD »

Wouldn't it be something like this...

#define UserCommand_AddGuildMaster
Orkl
Loyal fan
Posts: 376
Joined: Sat Sep 17, 2005 2:31 pm

Post by Orkl »

Ever looked at netmessages.h?

Code: Select all

 #define DEF_NOTIFY_NOTENOUGHGOLD    	0x0B08
 #define DEF_NOTIFY_KILLED      	0x0B09
 #define DEF_NOTIFY_EXP        0x0B0A
 #define DEF_NOTIFY_GUILDDISBANDED    	0x0B0B
 #define DEF_NOTIFY_EVENTMSGSTRING    	0x0B0C
 #define DEF_NOTIFY_CANNOTJOINMOREGUILDSMAN  	0x0B0D
 #define DEF_NOTIFY_NEWGUILDSMAN    	0x0B0E
 #define DEF_NOTIFY_DISMISSGUILDSMAN    0x0B0F
 #define DEF_NOTIFY_MAGICSTUDYSUCCESS    0x0B10
 #define DEF_NOTIFY_MAGICSTUDYFAIL    	0x0B11
 #define DEF_NOTIFY_SKILLTRAINSUCCESS    0x0B12
 #define DEF_NOTIFY_SKILLTRAINFAIL    	0x0B13
 #define DEF_NOTIFY_MP        0x0B14
Just an excerpt..

It needs to be defined there, and also in the client.
<!--QuoteBegin-crazymnig88+--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (crazymnig88)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->by notepad??? it didn't show any code, just show words wif no mean<!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd--><br><!--QuoteBegin-charlie+--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (charlie)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->he'll probably save it as 600pagebook.bmp<br><br>400gb file plzkthnx<!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd-->
ADDKiD
&lt;3 bd long time
Posts: 967
Joined: Tue Jul 12, 2005 8:07 pm
Location: Washington, USA
Contact:

Post by ADDKiD »

Would I use the same Hex Number as "DissMissGuildsMan" or is this not the same as "Ban"....?
Ace
Regular
Posts: 68
Joined: Sat Apr 03, 2004 5:14 am

Post by Ace »

i try put dismissguild hex number and it work :D
lirannn
Regular
Posts: 56
Joined: Fri Sep 08, 2006 7:17 pm

Post by lirannn »

just add a fkin new one
<span style='color:green'>Danny says:u dont know how much u can make from weed ,make any item of clothing. im fucking serious, real good ropes!</span><br><br>Helbreath reborn, be there;)<br>owner of hbr.
tester
Outpost bitch
Posts: 544
Joined: Wed Jan 07, 2004 8:58 pm

Post by tester »

lirannn wrote: just add a fkin new one
Should do the highest hex code + 1 and u should be fine i guess

Cheers tester
I support a woman's right to choose<br><br>- In the Mouth?<br>- In the Ass ?<br>- In the Vagina?<br>- Between the Tits?
Post Reply