/setrep Code *fixed*

All Helbreath Server Source Discussion here.
Post Reply
Slipknight
Loyal fan
Posts: 423
Joined: Thu Apr 07, 2005 7:53 pm

Post by Slipknight »

/setrep GM command

Code: Select all

void CGame::AdminOrder_SetRep(int iClientH, char *pData, DWORD dwMsgSize)
{
 char   seps[] = "= \t\n";
 char   * token, cBuff[256];
 class  CStrTok * pStrTok;
 char * rep;
 char cNick[20];
 char cRep[5];
 char notice[100];
 int oldrep;
 int i;
 if (m_pClientList[iClientH] == NULL) return;
 if ((dwMsgSize) <= 0) return;
 if (m_pClientList[iClientH]->m_iAdminUserLevel <= 8) {
   SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_ADMINUSERLEVELLOW, NULL, NULL, NULL, NULL);
   return;
 }
 ZeroMemory(cBuff, sizeof(cBuff));
 memcpy(cBuff, pData, dwMsgSize);
 pStrTok = new class CStrTok(cBuff, seps);
 token = pStrTok->pGet();
 token = pStrTok->pGet();
 if (token == NULL) {
   delete pStrTok;
   return;
   } 
   strcpy(cNick, token);
   rep = pStrTok->pGet();
   if (rep == NULL) {
     delete pStrTok;
     return;
   }
   strcpy(cRep, rep);
   for (i = 0; i < DEF_MAXCLIENTS; i++)  {
     if ((m_pClientList[i] != NULL) && (memcmp(m_pClientList[i]->m_cCharName, cNick, strlen(cNick)) == 0)) {
 oldrep = m_pClientList[i]->m_iRating;
       m_pClientList[i]->m_iRating=atoi(cRep);
 wsprintf(notice,"Your Reputation Count has been changed from %d to %d.",oldrep,atoi(cRep));
 ShowRepNotice(iClientH,notice);
     }
   }
   delete pStrTok;
}
Usage

Code: Select all

  if (memcmp(cp, "/setrep ", 7) == 0) {
  	AdminOrder_SetRep(iClientH, cp, dwMsgSize - 21);
  	return;
  }
New Show Notice

Code: Select all

void CGame::ShowRepNotice(int iClientH,char *pMsg)
{
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, pMsg);
}
How too use
1.On GM char say "/setrep (playername) (amount)"
<img src='http://www.bleachportal.net/interactive ... irjjkt.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/Slipknot%20Fan.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/UT2004%20Player.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/AC%20DC%20Fan.png' border='0' alt='user posted image' /><br>
ruberto
Regular
Posts: 64
Joined: Mon May 31, 2004 7:33 pm

Post by ruberto »

hmm strange i copied that crit into my game.cpp but im getting like 18 errors :D
Slipknight
Loyal fan
Posts: 423
Joined: Thu Apr 07, 2005 7:53 pm

Post by Slipknight »

ruberto wrote: hmm strange i copied that crit into my game.cpp but im getting like 18 errors :D
make sure you add

void AdminOrder_SetCrit(int iClientH, char *pData, DWORD dwMsgSize);
void AdminOrder_SetRep(int iClientH, char *pData, DWORD dwMsgSize);

both to your CGame.

oh and I got no errors

0 Errors, 6 Warnings ^^
<img src='http://www.bleachportal.net/interactive ... irjjkt.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/Slipknot%20Fan.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/UT2004%20Player.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/AC%20DC%20Fan.png' border='0' alt='user posted image' /><br>
EvilHit
Loyal fan
Posts: 356
Joined: Sun Jan 16, 2005 3:20 am

Post by EvilHit »

lol
Slipknight
Loyal fan
Posts: 423
Joined: Thu Apr 07, 2005 7:53 pm

Post by Slipknight »

EvilHit wrote: lol
uhm spam?
<img src='http://www.bleachportal.net/interactive ... irjjkt.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/Slipknot%20Fan.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/UT2004%20Player.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/AC%20DC%20Fan.png' border='0' alt='user posted image' /><br>
Slipknight
Loyal fan
Posts: 423
Joined: Thu Apr 07, 2005 7:53 pm

Post by Slipknight »

fixed /setrep command and /setcrit still being worked on.
<img src='http://www.bleachportal.net/interactive ... irjjkt.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/Slipknot%20Fan.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/UT2004%20Player.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/AC%20DC%20Fan.png' border='0' alt='user posted image' /><br>
omar_omiez
Loyal fan
Posts: 235
Joined: Mon Jul 12, 2004 9:36 am

Post by omar_omiez »

set crit is same like set rep, just change the variable names to the crit ones, relating to the super_attack_left.
- Tbone<br><a href="http://cyborg.namedecoder.com"><br><img src="http://cyborg.namedecoder.com/webimages ... ng"<br></a>
omar_omiez
Loyal fan
Posts: 235
Joined: Mon Jul 12, 2004 9:36 am

Post by omar_omiez »

void CGame::AdminOrder_SetCrit(int iClientH, char *pData, DWORD dwMsgSize)
{
char seps[] = "= \t\n";
char * token, cBuff[256];
class CStrTok * pStrTok;
char * crit;
char cNick[20];
char cCrit[5];
char notice[100];
int oldcrit;
int i;
if (m_pClientList[iClientH] == NULL) return;
if ((dwMsgSize) <= 0) return;
if (m_pClientList[iClientH]->m_iAdminUserLevel <= 8) {
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_ADMINUSERLEVELLOW, NULL, NULL, NULL, NULL);
return;
}
ZeroMemory(cBuff, sizeof(cBuff));
memcpy(cBuff, pData, dwMsgSize);
pStrTok = new class CStrTok(cBuff, seps);
token = pStrTok->pGet();
token = pStrTok->pGet();
if (token == NULL) {
delete pStrTok;
return;
}
strcpy(cNick, token);
crit = pStrTok->pGet();
if (crit == NULL) {
delete pStrTok;
return;
}
strcpy(cCrit, crit);
for (i = 0; i < DEF_MAXCLIENTS; i++) {
if ((m_pClientList != NULL) && (memcmp(m_pClientList->m_cCharName, cNick, strlen(cNick)) == 0)) {
oldcrit = m_pClientList->m_iSuperAttackLeft;
m_pClientList->m_iSuperAttackLeft=atoi(cCrit);
wsprintf(notice,"Your Critical Attack Count has been changed from %d to %d.",oldcrit,atoi(cCrit));
ShowRepNotice(iClientH,notice);
}
}
delete pStrTok;
}
- Tbone<br><a href="http://cyborg.namedecoder.com"><br><img src="http://cyborg.namedecoder.com/webimages ... ng"<br></a>
MOG Hackintosh
Loyal fan
Posts: 362
Joined: Sun May 30, 2004 5:34 am

Post by MOG Hackintosh »

I don't think a GM should mess with the reps of players, because after all that is how players evaluate each other, but oh well.
<b>"I think im a hillbilly so pay me for my uber shiz" - Slipknight</b><span style='color:red'><br>yes and the dutch are always celebrating<br>thats holland:<br>"i got a new bicycle!" CHAMPAGNE! :D<br>"new marijuana bar opened" CHAMPAGNE :D <br>"it stopped raining for an hour" CHAMPAGNE! :D <br>"my condom didn't break" CHAMPAGNE! :D <br>"jews moved in next door" CHAMPAGNE! :D<br>"Look! A windmill!" CHAMPAGNE! :D</span>
omar_omiez
Loyal fan
Posts: 235
Joined: Mon Jul 12, 2004 9:36 am

Post by omar_omiez »

MOG Hackintosh wrote: I don't think a GM should mess with the reps of players, because after all that is how players evaluate each other, but oh well.
mog, i agree with u to a certain extent. it sorts of ruins the fun of the game. but on the other hand, with the kloness set items, rep plays a part and as a gm, you can give extra rep as a gift to players who have contributed to the server somewhat, rather then creating items with out of the world stats and let them own other players. thats my point of view at least.
- Tbone<br><a href="http://cyborg.namedecoder.com"><br><img src="http://cyborg.namedecoder.com/webimages ... ng"<br></a>
MOG Hackintosh
Loyal fan
Posts: 362
Joined: Sun May 30, 2004 5:34 am

Post by MOG Hackintosh »

It's like giving them an armour against Kloness stuff, so I see it as pretty much the same. Call me old fashioned, but messing with someone's rep can be just as bad as giving them merien shields.

Not that I wouldn't do it, for the right cash dough-nation, of course.
<b>"I think im a hillbilly so pay me for my uber shiz" - Slipknight</b><span style='color:red'><br>yes and the dutch are always celebrating<br>thats holland:<br>"i got a new bicycle!" CHAMPAGNE! :D<br>"new marijuana bar opened" CHAMPAGNE :D <br>"it stopped raining for an hour" CHAMPAGNE! :D <br>"my condom didn't break" CHAMPAGNE! :D <br>"jews moved in next door" CHAMPAGNE! :D<br>"Look! A windmill!" CHAMPAGNE! :D</span>
omar_omiez
Loyal fan
Posts: 235
Joined: Mon Jul 12, 2004 9:36 am

Post by omar_omiez »

you got a point there, maybe 2.. lol.. but the setcrit is cool right? like before duels and players havent got their full 18 crits and gms can use the command to help them.

question : if gm types /setcrit tbone 18, will tbone be logged out first and have to relog in for the changes to take efect?
- Tbone<br><a href="http://cyborg.namedecoder.com"><br><img src="http://cyborg.namedecoder.com/webimages ... ng"<br></a>
Slipknight
Loyal fan
Posts: 423
Joined: Thu Apr 07, 2005 7:53 pm

Post by Slipknight »

omar_omiez wrote: you got a point there, maybe 2.. lol.. but the setcrit is cool right? like before duels and players havent got their full 18 crits and gms can use the command to help them.

question : if gm types /setcrit tbone 18, will tbone be logged out first and have to relog in for the changes to take efect?
so does that /setcrit work?

And really this /setrep code is just for lazyness and I sometimes hold events for say 10-20 ++ rep.

Also I found its better too just make players be able too rep each other every 30mins like I've done ^^ .
<img src='http://www.bleachportal.net/interactive ... irjjkt.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/Slipknot%20Fan.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/UT2004%20Player.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/AC%20DC%20Fan.png' border='0' alt='user posted image' /><br>
Slipknight
Loyal fan
Posts: 423
Joined: Thu Apr 07, 2005 7:53 pm

Post by Slipknight »

omar_omiez wrote: void CGame::AdminOrder_SetCrit(int iClientH, char *pData, DWORD dwMsgSize)
{
char seps[] = "= \t\n";
char * token, cBuff[256];
class CStrTok * pStrTok;
char * crit;
char cNick[20];
char cCrit[5];
char notice[100];
int oldcrit;
int i;
if (m_pClientList[iClientH] == NULL) return;
if ((dwMsgSize) <= 0) return;
if (m_pClientList[iClientH]->m_iAdminUserLevel <= 8) {
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_ADMINUSERLEVELLOW, NULL, NULL, NULL, NULL);
return;
}
ZeroMemory(cBuff, sizeof(cBuff));
memcpy(cBuff, pData, dwMsgSize);
pStrTok = new class CStrTok(cBuff, seps);
token = pStrTok->pGet();
token = pStrTok->pGet();
if (token == NULL) {
delete pStrTok;
return;
}
strcpy(cNick, token);
crit = pStrTok->pGet();
if (crit == NULL) {
delete pStrTok;
return;
}
strcpy(cCrit, crit);
for (i = 0; i < DEF_MAXCLIENTS; i++) {
if ((m_pClientList != NULL) && (memcmp(m_pClientList->m_cCharName, cNick, strlen(cNick)) == 0)) {
oldcrit = m_pClientList->m_iSuperAttackLeft;
m_pClientList->m_iSuperAttackLeft=atoi(cCrit);
wsprintf(notice,"Your Critical Attack Count has been changed from %d to %d.",oldcrit,atoi(cCrit));
ShowRepNotice(iClientH,notice);
}
}
delete pStrTok;
}

I dont think this will work because I tryed something like that without the new show notice and it would notify the GM that you changed it but it would not effect the player.
<img src='http://www.bleachportal.net/interactive ... irjjkt.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/Slipknot%20Fan.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/UT2004%20Player.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/AC%20DC%20Fan.png' border='0' alt='user posted image' /><br>
Post Reply