brings back the olden days lolTafka12 wrote: OT: Marley you got so cute avatar![]()
[Src]->Custom Votes
-.-"
defined on netmessages.h

when i answer the question it dc me and i get this on hg window... i dont know what it can be cuz its declared ;( help plz
defined on netmessages.h
Code: Select all
#define MSGID_VOTE 0x00000B85

when i answer the question it dc me and i get this on hg window... i dont know what it can be cuz its declared ;( help plz

OWNED!<br><img src='http://img50.imageshack.us/img50/1386/p ... 3vsqn2.gif' border='0' alt='user posted image' /><br><br><img src="http://hbtop50.com/button.php?u=hbuonline" alt="Helbreath Top 50 - Keepin' it real." border="0" /><br><a href='http://www.hbuonline.net' target='_blank'>Helbreath United</a>
your sending the wrong message, it doesn't match up, i suggest re looking over your codesSlammeR wrote: -.-"
defined on netmessages.hCode: Select all
#define MSGID_VOTE 0x00000B85
when i answer the question it dc me and i get this on hg window... i dont know what it can be cuz its declared ;( help plz![]()
Im success added it.
But it has one problem..... Client didint pop up the vote window.
But it show results. Results always 0 and 0.
But it has one problem..... Client didint pop up the vote window.
But it show results. Results always 0 and 0.
Old Helbreath Nemesis Player<br><img src='http://img232.imageshack.us/img232/9784/dshakedqc5.jpg' border='0' alt='user posted image' /><br><img src='http://img232.imageshack.us/img232/6475 ... barqj0.jpg' border='0' alt='user posted image' /><br><a href='index.php?showtopic=7107&hl=' target='_blank'>MainServer Hexing Tutorial</a><br><a href='index.php?showtopic=7663&hl=x-mas' target='_blank'>My Files</a>
-
- Loyal fan
- Posts: 391
- Joined: Sat Mar 26, 2005 12:41 am
Client messages must be defined as the same as HG server netmessages.
if your client dosnt popup with the dialog, means the client eather dosnt know what to do with the vote message it resaved basicly becouse it has a diffrent dif ans HG*, or you could of put the Case in the wrong spot.
if your client dosnt popup with the dialog, means the client eather dosnt know what to do with the vote message it resaved basicly becouse it has a diffrent dif ans HG*, or you could of put the Case in the wrong spot.
<img src='http://freewebs.com/trickro/70s.png' border='0' alt='user posted image' /><img src='http://freewebs.com/trickro/70s2.jpg' border='0' alt='user posted image' />
lol topic is old as hell. The problem was there was no case for it so it went to the default which reports as unknown.
<img src='http://www.helbreathx.net/sig/sig.jpeg' border='0' alt='user posted image' /><br><a href='http://mafia.cheats4us.org/index.php?x=231030' target='_blank'>#1 on Mafia
</a><br><!--QuoteBegin-Slipknight+--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Slipknight)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->100mb Internet, burstable too 10GB oc192<br>his speed can go up too 10gbs<br>...<br>Yes my car can have a top speed of 1000mph<!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd--><br>^^ I wonder where the retard went to.

Did anyone had a problem when it shows the results it goes...
-8565966 and -8565960 ???
-8565966 and -8565960 ???
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>
-
- Loyal fan
- Posts: 391
- Joined: Sat Mar 26, 2005 12:41 am
hmmm loco, aaa could be message problem.. i would thinkg soo..
<img src='http://freewebs.com/trickro/70s.png' border='0' alt='user posted image' /><img src='http://freewebs.com/trickro/70s2.jpg' border='0' alt='user posted image' />
loco, is that a dereferencing mistake you made? accidentally taking a pointer address instead of the value.
and for Slammers thing.
double check that your putting the handler for the right place (from the correct server) i did something like that with a message from the client, i put the handler in the for from some log server place.
and for Slammers thing.
double check that your putting the handler for the right place (from the correct server) i did something like that with a message from the client, i put the handler in the for from some log server place.
-><-
/**************Vote Begin**********/
void CGame::AdminVote(int iClientH, char * pData, DWORD dwMsgSize)
{
//timer
DWORD dwTime;
char cTxt[1024];
ZeroMemory(cTxt, sizeof(cTxt));
char seps[] = "= \t\n";
char * token, cBuff[256], dM[50], dA[20], dA2[20];
class CStrTok * pStrTok;
dwTime = timeGetTime();
strcpy(dM, "0");
strcpy(dA, "0");
strcpy(dA2, "0");
if (m_pClientList[iClientH] == NULL) return;
if(bVote == TRUE) {
wsprintf(cTxt, "Vote Already in Progress");
ShowClientMsg(iClientH,cTxt);
return;
}
if (m_pClientList[iClientH]->m_iAdminUserLevel <= 0) {
// check admin level
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_ADMINUSERLEVELLOW, NULL, NULL, NULL, NULL);
return;
}
if (m_pClientList[iClientH] == NULL) return;
if ((dwMsgSize) <= 0) return;
ZeroMemory(cBuff, sizeof(cBuff));
memcpy(cBuff, pData, dwMsgSize);
pStrTok = new class CStrTok(cBuff, seps);
token = pStrTok->pGet();
/*token = pStrTok->pGet();
if (token != NULL) {
ZeroMemory(cMapName, sizeof(cMapName));
strcpy(cMapName, token);*/
/*token = pStrTok->pGet();
if (token != NULL) {
cMapName = atoi(token);
}*/
token = pStrTok->pGet();
if (token != NULL) {
strcpy(dM, token);
}
token = pStrTok->pGet();
if (token != NULL) {
strcpy(dA, token);
}
token = pStrTok->pGet();
if (token != NULL) {
strcpy(dA2, token);
}
//crusade apoc stuff...
if(strcmp("crusade", dM) == 0) {
strcpy(dM, "C");
strcpy(m_cVAnswer1, "Yes");
strcpy(m_cVAnswer2, "No");
}
if(strcmp("apocalypse", dM) == 0) {
strcpy(dM, "A");
strcpy(m_cVAnswer1, "Yes");
strcpy(m_cVAnswer2, "No");
}
if(strcmp("event", dM) == 0) {
strcpy(dM, "E");
strcpy(m_cVAnswer1, "Yes");
strcpy(m_cVAnswer2, "No");
}
else {
strcpy(m_cVotemsg, dM);
strcpy(m_cVAnswer1, dA);
strcpy(m_cVAnswer2, dA2);
}
int i;
for (i = 0; i < DEF_MAXCLIENTS; i++) {
//if(m_pClientList == NULL) return;
SendNotifyMsg(NULL, i, DEF_NOTIFY_VOTE, NULL, NULL, NULL, NULL);
bVote = TRUE;
GM_VOTE = iClientH;
m_dwWaitV = dwTime;
//VoteTime();
}
}
/**********Incomeing Votes*********/
void CGame::VoteHandler(int iClientH, char * pData, DWORD dwMsgSize)
{
char * cp;
int * ip;
int m_iAnswer = 0;
if (m_pClientList[iClientH] == NULL) return;
cp = (char *)(pData + DEF_INDEX2_MSGTYPE + 2);
ip = (int *)cp;
m_iAnswer = *ip;
cp += 4;
//add the votes
if(bVote == FALSE) return;
if(m_pClientList[iClientH]->m_iAdminUserLevel > 0)
{
if(m_iAnswer == 1) m_VResult1 += 2;
if(m_iAnswer == 2) m_VResult2 += 2;
}
else {
if(m_iAnswer == 1) m_VResult1 += 1;
if(m_iAnswer == 2) m_VResult2 += 1;
}
}
case MSGID_VOTE: // Voting by marleythe9
if(bVote == FALSE) break;
VoteHandler(iClientH, pData, dwMsgSize);
break;
switch (wMsgType) {
//*******notify clients vote started*******//
case DEF_NOTIFY_VOTE:
//vote question
memcpy(cp, m_cVotemsg, 50);
cp += 50;
//vote answers
memcpy(cp, m_cVAnswer1, 20);
cp += 20;
memcpy(cp, m_cVAnswer2, 20);
cp += 20;
iRet = m_pClientList[iToH]->m_pXSock->iSendMsg(cData, 6 + 90 + 1);
break;
/*********************************************************************************************************************
** BOOL CGame::VoteTime() marleythe9 **
** description :: Ends the Voting **
*********************************************************************************************************************/
void CGame::VoteTime()
{
int m_ivote = 0;
//m_dwWaitV
DWORD dwTime = timeGetTime();
if ((dwTime - m_dwWaitV) > 1000*60) {
m_ivote = 1;
m_dwWaitV = dwTime;
}
//-------------message------------//
char cTxt[1024];
if(bVote == TRUE) {
if(m_ivote == 1) {
//if(GM_VOTE == NULL) return;
if(m_VResult1 > m_VResult2) {
wsprintf(cTxt, "Results Answer1: %d Answer2: %d", m_VResult1, m_VResult2);
ShowClientMsg(GM_VOTE,cTxt);
}
if(m_VResult1 < m_VResult2) {
wsprintf(cTxt, "Results Answer1: %d Answer2: %d", m_VResult1, m_VResult2);
ShowClientMsg(GM_VOTE, cTxt);
}
if(m_VResult1 == m_VResult2) {
wsprintf(cTxt, "Results Answer1: %d Answer2: %d", m_VResult1, m_VResult2);
ShowClientMsg(GM_VOTE,cTxt);
}
//reset everything back to nothing.
strcpy(m_cVotemsg, "0");
strcpy(m_cVAnswer1, "0");
strcpy(m_cVAnswer2, "0");
m_VResult1 = 0;
m_VResult2 = 0;
bVote = FALSE;
GM_VOTE = NULL;
return;
}
if(m_ivote == 1) {
wsprintf(cTxt, "Error???");
ShowClientMsg(GM_VOTE,cTxt);
return;
}
}
//-------------------end vote handler------------//
}
NetMessage.h
#define DEF_NOTIFY_VOTE 0x0B84
#define MSGID_VOTE 0x0FA40005
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>
Client Part
//Voting Started
void CGame::NotifyMsg_Vote(char * pData)
{char * cp;
int * ip;
int i;
DWORD dwTime = timeGetTime();
if(bVote == TRUE) return;
ZeroMemory(cVotemsg, sizeof(cVotemsg));
ZeroMemory(cVanswer1, sizeof(cVanswer1));
ZeroMemory(cVanswer2, sizeof(cVanswer2));
cp = (char *)(pData + DEF_INDEX2_MSGTYPE + 2);
//strcpy(cVotemsg, cp);
memcpy(cVotemsg, cp, 50);
cp += 50;
memcpy(cVanswer1, cp, 20);
cp += 20;
memcpy(cVanswer2, cp, 20);
cp += 20;
if(((strlen(cVotemsg) > 0) && cVanswer1 > 0) && cVanswer2 > 0) bVote = TRUE;
if(bVote == FALSE) return;
if (m_bIsDialogEnabled[54] == TRUE) return;
m_dwVOTEC = dwTime;
PlaySound('E', 6, 0);
EnableDialogBox(54, NULL, NULL, NULL);
}
//------------vote dlg------------//
void CGame::DrawDialogBox_Vote(short msX, short msY)//54
{
short sX, sY, szX,szY;
char cTxt[120];
char cTxt2[120];
int nickheight=16;
DWORD dwTime = timeGetTime();
BOOL bFlag = FALSE;
COLORREF tmpColor;
sX = m_stDialogBoxInfo[54].sX;
sY = m_stDialogBoxInfo[54].sY;
szX = m_stDialogBoxInfo[54].sSizeX;
szY = m_stDialogBoxInfo[54].sSizeY;
//main dialog
DrawNewDialogBox(DEF_SPRID_INTERFACE_ND_GAME2, sX, sY, 6);
if(strcmp("C", cVotemsg) == 0) { PutString_SprFont(sX+90,sY+15,VOTE_CRUSADE,1,1,8); bFlag = TRUE; }
if(strcmp("A", cVotemsg) == 0) { PutString_SprFont(sX+90,sY+15,VOTE_APOC,1,1,8); bFlag = TRUE; }
if(strcmp("E", cVotemsg) == 0) { PutString_SprFont(sX+90,sY+15,VOTE_HELD,1,1,8); bFlag = TRUE; }
if(bFlag == TRUE) {
wsprintf(cTxt, "%s", VOTE_YES);
wsprintf(cTxt2, "%s", VOTE_NO);
}
else {
PutString_SprFont(sX+90,sY+15,cVotemsg,1,1,8);
wsprintf(cTxt, "%s", cVanswer1);
wsprintf(cTxt2, "%s", cVanswer2);
}
//buttons
if ((msX>sX+80) && (msX<sX+80+(strlen(cTxt) * 5)) && (msY>sY+25+14) && (msY<sY+45+14)) {
PutString(sX+80,sY+25+14,cTxt,RGB(255,255,255));
}
else {
PutString(sX+80,sY+25+14,cTxt,RGB(0,0,0));
}
if ((msX>sX+140) && (msX<sX+140+(strlen(cTxt2) * 5)) && (msY>sY+25+14) && (msY<sY+45+14)) {
PutString(sX+140,sY+25+14,cTxt2,RGB(255,255,255));
}
else {
PutString(sX+140,sY+25+14,cTxt2,RGB(0,0,0));
}
//------------timer------//
if(bVote == TRUE) {
if ((dwTime - m_dwVOTEC) > 1000*30) {
bVote = FALSE;
//disable dialog
if (m_bIsDialogEnabled[54] == TRUE) {
DisableDialogBox(54);
//end
}
m_dwVOTEC = dwTime;
}
}
}
//------------click vote dialog-----------//
void CGame::DlgBoxClick_Vote(short msX, short msY) // 54 - marley
{
short sX, sY, szX,szY;
int tmp,i;
char cTxt[100];
int m_iAnswer;
sX = m_stDialogBoxInfo[54].sX;
sY = m_stDialogBoxInfo[54].sY;
szX = m_stDialogBoxInfo[54].sSizeX;
szY = m_stDialogBoxInfo[54].sSizeY;
if(bVote == TRUE) {
if ((msX>sX+80) && (msX<sX+80+(strlen(cVanswer1) * 5)+14) && (msY>sY+25+14) && (msY<sY+45+14)) {
m_iAnswer = 1;
bVote = FALSE;
bSendCommand(MSGID_VOTE, NULL, NULL, m_iAnswer, NULL, NULL, NULL);
DisableDialogBox(54);
PlaySound('E', 14, 5);
}
if ((msX>sX+140) && (msX<sX+140+(strlen(cVanswer2) * 5)) && (msY>sY+25+14) && (msY<sY+45+14)) {
m_iAnswer = 2;
bVote = FALSE;
bSendCommand(MSGID_VOTE, NULL, NULL, m_iAnswer, NULL, NULL, NULL);
DisableDialogBox(54);
PlaySound('E', 14, 5);
}
}
}
switch (dwMsgID) {
// Voting by marleythe9
case MSGID_VOTE: // 0x0FA40005
dwp = (DWORD *)(cMsg + DEF_INDEX4_MSGID);
*dwp = dwMsgID;
wp = (WORD *)(cMsg + DEF_INDEX2_MSGTYPE);
*wp = NULL;
cp = (char *)(cMsg + DEF_INDEX2_MSGTYPE + 2);
ip = (int *)cp;
*ip = iV1;
cp += 4;
iRet = m_pGSock->iSendMsg(cMsg, 10);
break;
switch (wEventType) {
// Voting by marleythe9
case DEF_NOTIFY_VOTE: //0x0B84
NotifyMsg_Vote(pData);
break;
#define DEF_NOTIFY_VOTE 0x0B84
#define MSGID_VOTE 0x0FA40005
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>