[src] /checkpoints For Majestic

Codes already submitted by people of the forums.
Post Reply
Pener
Member
Posts: 110
Joined: Fri Feb 27, 2004 3:57 pm
Location: Czech Republic

Post by Pener »

game.h

Code: Select all

void PlayerOrder_CheckPoints(int iClientH, char *pData,DWORD dwMsgSize)

game.cpp

Code: Select all

  if (memcmp(cp, "/checkpoints", 12) == 0) {
  	PlayerOrder_CheckPoints(iClientH,cp, dwMsgSize - 21);
  	return;
  }

and

Code: Select all

void CGame::PlayerOrder_CheckPoints(int iClientH, char *pData,DWORD dwMsgSize)
{
 class  CStrTok * pStrTok;
 short m_iRating;
 char   * token, cName[11], cTargetName[11], cRepMessage[256], cTemp[256], seps[] = "= \t\n", cBuff[256];
 register int i;

	if (m_pClientList[iClientH] == NULL) return;
	ZeroMemory(cTemp, sizeof(cTemp));
	ZeroMemory(cRepMessage, sizeof(cRepMessage));
	if (m_pClientList[iClientH]->m_iAdminUserLevel > -1) {
  wsprintf(cRepMessage, "You have %d majestic points.", m_pClientList[iClientH]->m_iGizonItemUpgradeLeft);
  ShowClientMsg(iClientH, cRepMessage);
	} 
}


any1 need majestic code?:) :blink:
<img src='http://i19.photobucket.com/albums/b153/s00pr/Pener.jpg' border='0' alt='user posted image' /><br><img src='http://i19.photobucket.com/albums/b153/ ... anner3.jpg' border='0' alt='user posted image' />
Windy
Member
Posts: 157
Joined: Tue Nov 18, 2003 8:31 am
Location: wishing I was somewhere else

Post by Windy »

there is a much better way to do that from whats already there even, just make it so that GMs can check other ppls majesty points also like some other check command...hint hint...just change a couple things in it and ur all good, I added one to a server already because before I changed some stuff ppl were still connecting with the map down thing since I wasnt the hoster I couldnt do much about it but anyways its a good thing to have for the ppl out there who get bored and just make their own HG hack and add stuff like majesty points to it...just added protection I guess...and maj points did get bugged at times if u didnt add a bit of code to the HG to fix it...so they had to watch over that also...
<span style='color:blue'>Coding with Evil Intentions....Evil at its Best....</span>
Tafka12
&lt;3 bd long time
Posts: 772
Joined: Wed Dec 28, 2005 6:32 pm

Post by Tafka12 »

put majestic too then :)
<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' />
Shetar
Member
Posts: 148
Joined: Sun Nov 30, 2003 12:57 am

Post by Shetar »

Pener wrote: game.h

Code: Select all

void PlayerOrder_CheckPoints(int iClientH, char *pData,DWORD dwMsgSize)

game.cpp

Code: Select all

  if (memcmp(cp, "/checkpoints", 12) == 0) {
  	PlayerOrder_CheckPoints(iClientH,cp, dwMsgSize - 21);
  	return;
  }

and

Code: Select all

void CGame::PlayerOrder_CheckPoints(int iClientH, char *pData,DWORD dwMsgSize)
{
 class  CStrTok * pStrTok;
 short m_iRating;
 char   * token, cName[11], cTargetName[11], cRepMessage[256], cTemp[256], seps[] = "= \t\n", cBuff[256];
 register int i;

	if (m_pClientList[iClientH] == NULL) return;
	ZeroMemory(cTemp, sizeof(cTemp));
	ZeroMemory(cRepMessage, sizeof(cRepMessage));
	if (m_pClientList[iClientH]->m_iAdminUserLevel > -1) {
  wsprintf(cRepMessage, "You have %d majestic points.", m_pClientList[iClientH]->m_iGizonItemUpgradeLeft);
  ShowClientMsg(iClientH, cRepMessage);
	} 
}


any1 need majestic code?:) :blink:
You defined alot of unnecessary values. Let's improve it:

Code: Select all

  if (memcmp(cp, "/showmajestic", 13) == 0) {
  	PlayerOrder_CheckPoints(iClientH);
  	return;
  }
&

Code: Select all

void CGame::PlayerOrder_CheckPoints(int iClientH)
{
 char cMsg[50];
 
	if (m_pClientList[iClientH] == NULL) return;
	ZeroMemory(cMsg, sizeof(cMsg));
	wsprintf(cMsg, "You have %d majestic point(s).", m_pClientList[iClientH]->m_iGizonItemUpgradeLeft);
  	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, cMsg
}
Should work.
Helbreath II Project Manager & All round Developer. <br><i>(Don't worry, we're not dead)</i>
Post Reply