[req] Day/night Change

Submit your code requests, and if you are good at coding come help others with their requests.
Post Reply
kahn
Loyal fan
Posts: 203
Joined: Thu Oct 07, 2004 1:20 am

Post by kahn »

i duno if any 1 else noticed this but in privet servers the time of day does not seam to change how can this be fixed thx
diuuude
Outpost bitch
Posts: 592
Joined: Wed Dec 28, 2005 11:57 pm

Post by diuuude »

kahn wrote: i duno if any 1 else noticed this but in privet servers the time of day does not seam to change how can this be fixed thx
make a code that checks the time, then send the proper msg to client...
<a href='http://www.technohell.net' target='_blank'><b><span style='color:red'>>>> Helbreath Ressources Website Here <<<</span></b></a><br>C++ Sources, Tools, Server Files, Help on Forum, C++ Snippets, Toplist... Updated often, come visit us !
snoopy81
Loyal fan
Posts: 338
Joined: Mon Jul 12, 2004 7:13 pm

Post by snoopy81 »

The Day/Night does not change because of a wrong variable type.

Open game.h, find:
BOOL m_cDayOrNight;
Replace with:

Code: Select all

char  m_cDayOrNight;
That's all folks...
_\_ _<br> / , \__/ . \ Admin of Equilibrium Project<br> II\ \___ . O<br> III \_/ \ _ / <a href='http://www.equiprojet.com' target='_blank'>http://www.equiprojet.com</a><br> II I¯I
Dax
&lt;3 bd long time
Posts: 785
Joined: Mon Apr 18, 2005 3:19 pm

Post by Dax »

snoopy81 wrote: The Day/Night does not change because of a wrong variable type.

Open game.h, find:
BOOL  m_cDayOrNight;
Replace with:

Code: Select all

char  m_cDayOrNight;
That's all folks...
Nice pickup snoopy.
Reppin' 127.0.0.1!!!<br><br><img src='http://img502.imageshack.us/img502/1348/sig4daxbn2.jpg' border='0' alt='user posted image' /><br><br>I contend that we are both atheists. I just believe in one fewer god than you do. <br>When you understand why you dismiss all the other possible gods, you will <br>understand why I dismiss yours.<br>~ <b>Stephen Roberts</b>
locobans
Outpost Junkie
Posts: 2264
Joined: Tue Jul 13, 2004 3:51 am
Location: Behind You
Contact:

Post by locobans »

Lolz
QUOTE (ADDKiD @ Dec 1 2006, 4:01 PM) <br>You guys make me laugh alot, half the shit I say, is bullshit...<br><br><img src='http://img485.imageshack.us/img485/492/banssig1ng.gif' border='0' alt='user posted image' /><br><br><b>I see no changes at all, wake up in the morning and ask myself...<br>Is life worth living? Should I blast myself?</b><br><br><b><a href='http://2paclegacy.com' target='_blank'>2PacLegacy.com</a></b>
kahn
Loyal fan
Posts: 203
Joined: Thu Oct 07, 2004 1:20 am

Post by kahn »

haha thx guys
diuuude
Outpost bitch
Posts: 592
Joined: Wed Dec 28, 2005 11:57 pm

Post by diuuude »

snoopy81 wrote: The Day/Night does not change because of a wrong variable type.

Open game.h, find:
BOOL m_cDayOrNight;
Replace with:

Code: Select all

char  m_cDayOrNight;
That's all folks...
it seems so easy when you say it... thank you ;)
<a href='http://www.technohell.net' target='_blank'><b><span style='color:red'>>>> Helbreath Ressources Website Here <<<</span></b></a><br>C++ Sources, Tools, Server Files, Help on Forum, C++ Snippets, Toplist... Updated often, come visit us !
juggalo2
Spamtastic
Posts: 1144
Joined: Sun Jul 17, 2005 5:28 pm

Post by juggalo2 »

snoopy kick ass +1
<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>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
snoopy81
Loyal fan
Posts: 338
Joined: Mon Jul 12, 2004 7:13 pm

Post by snoopy81 »

Code: Select all

  if (memcmp(cp,"/time ", 6) == 0)      // m_iAdminLevelTime
  {	AdminOrder_Time(iClientH, cp, dwMsgSize - 21);
    return;
  }

Code: Select all

void CGame::AdminOrder_Time(int iClientH, char * pData, DWORD dwMsgSize)
{	// Time command By ACiDx Last edit on Sept,06,04
	//SNOOPY removed! it's a global variable 
	// BOOL m_bManualTime;
	char   seps[] = "= \t\n";
	char   * token, cBuff[256]; 
	class  CStrTok * pStrTok;
	int i;
  if ((dwMsgSize)	<= 0) return;
  if (m_pClientList[iClientH] == NULL) return;
  if (m_pClientList[iClientH]->m_iAdminUserLevel < m_iAdminLevelTime) {
  	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) 
  {	if (token[0] == '2') 
  	{	m_cDayOrNight = (char) 2;  
    wsprintf(G_cTxt, "GM Order(%-10s): Forces night mode", m_pClientList[iClientH]->m_cCharName);
    bSendMsgToLS(MSGID_GAMEMASTERLOG, iClientH, FALSE, G_cTxt);
    m_bManualTime = TRUE;
  	}else if (token[0] == '1') 
  	{	m_cDayOrNight = (char) 1;
    wsprintf(G_cTxt, "GM Order(%-10s): Forces day mode", m_pClientList[iClientH]->m_cCharName);
    bSendMsgToLS(MSGID_GAMEMASTERLOG, iClientH, FALSE, G_cTxt);
    m_bManualTime = TRUE;
  	}else if (token[0] == '0')  	
  	{	bSendMsgToLS(MSGID_GAMEMASTERLOG, iClientH, FALSE, G_cTxt);
    wsprintf(G_cTxt, "GM Order(%-10s): Disable force time mode", m_pClientList[iClientH]->m_cCharName);  	
    m_bManualTime = FALSE;    
    CheckDayOrNightMode();
  	}
  for (i = 1; i < DEF_MAXCLIENTS; i++) 
  if ((m_pClientList[i] != NULL) && (m_pClientList[i]->m_bIsInitComplete == TRUE)) {
  	if ((m_pClientList[i]->m_cMapIndex >= 0) && 
    (m_pMapList[m_pClientList[i]->m_cMapIndex] != NULL) &&
    (m_pMapList[m_pClientList[i]->m_cMapIndex]->m_bIsFixedDayMode == FALSE))
    SendNotifyMsg(NULL, i, DEF_NOTIFY_TIMECHANGE, m_cDayOrNight, NULL, NULL, NULL);	
  }
	}
	delete pStrTok;
}
And here's the fixed admin command.
_\_ _<br> / , \__/ . \ Admin of Equilibrium Project<br> II\ \___ . O<br> III \_/ \ _ / <a href='http://www.equiprojet.com' target='_blank'>http://www.equiprojet.com</a><br> II I¯I
kahn
Loyal fan
Posts: 203
Joined: Thu Oct 07, 2004 1:20 am

Post by kahn »

thank u
Post Reply