Codes already submitted by people of the forums.
Pener
Member
Posts: 110 Joined: Fri Feb 27, 2004 3:57 pm
Location: Czech Republic
Post
by Pener » Sat Feb 04, 2006 11:51 pm
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:
Windy
Member
Posts: 157 Joined: Tue Nov 18, 2003 8:31 am
Location: wishing I was somewhere else
Post
by Windy » Sun Feb 05, 2006 12:37 am
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
<3 bd long time
Posts: 772 Joined: Wed Dec 28, 2005 6:32 pm
Post
by Tafka12 » Sat Apr 01, 2006 11:08 am
put majestic too then
Shetar
Member
Posts: 148 Joined: Sun Nov 30, 2003 12:57 am
Post
by Shetar » Sat Apr 01, 2006 11:57 am
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>