HomeUseful information for Helbreath beginnersStatistics overviewSearchMemberlistGalleryRulesRegisterLog in

 

 [CODE] AFK Checker

Go down 
3 posters
AuthorMessage
yAMA


avatar

Silver
Earned after your first post and comment.
10th Anniversary
Earned after being a member for 10 years.

Likes : 4

[CODE] AFK Checker Empty
#1PostSubject: [CODE] AFK Checker   [CODE] AFK Checker 999102/27/2014, 11:46 pm

HGServer
Abrimos el Game.cpp y agregamos al final este codigo:


Code:
Código: void CGame::AFKChecker() { register int i; int sX, sY; DWORD dwTimeNow = timeGetTime(); for (i = 1; i < DEF_MAXCLIENTS; i++) { if (m_pClientList[i] != NULL) { if (   (m_pClientList[i]->m_bIsInitComplete == TRUE)   && ((dwTimeNow - m_pClientList[i]->m_dwAFKCheckTime) > DEF_AFKTIME) && (m_pClientList[i]->m_iHP > 0) && ((m_pClientList[i]->m_iStatus & 0x00000010) == 0) && (iDice(1,5) == 3)) { sX = m_pClientList[i]->m_sX; if (m_pClientList[i]->m_bSkillUsingStatus[19] == TRUE) sY = m_pClientList[i]->m_sY +1; else sY = m_pClientList[i]->m_sY; SendEventToNearClient_TypeB(MSGID_EVENT_COMMON, DEF_COMMONTYPE_MAGIC, m_pClientList[i]->m_cMapIndex , sX, sY, sX, sY, 247, m_pClientList[i]->m_sType);"


En el Game.h buscamos "public:" sin las barritas y abajo agregamos:

En el Game.h buscamos lo siguiente:


Abajo de lo que hemos buscando agregamos:


En el Client.cpp Buscamos:


Y arriba agregamos:


Después buscamos:


Y abajo agregamos:


Buscamos:


Y abajo agregamos:


Despues buscamos:


En la funcion agregamos:


Code:
"Código: m_pClientList[iClientH]->m_dwLastActionTime = m_pClientList[iClientH]->m_dwAFKCheckTime = timeGetTime();"



Buscamos:


Code:
"Código: if (m_iTotalClients > DEF_MAXONESERVERUSERS) { switch (iDice(1,2)) { case 1:   RequestTeleportHandler(iClientH, "2   ", "bisle", -1, -1); break; case 2:   switch (m_pClientList[iClientH]->m_cSide) { case 0: RequestTeleportHandler(iClientH, "2   ", "resurr1", -1, -1); break; case 1: RequestTeleportHandler(iClientH, "2   ", "resurr1", -1, -1); break; case 2: RequestTeleportHandler(iClientH, "2   ", "resurr2", -1, -1); break; } break;"


Arriba de eso agregamos:


Code:
"Código: m_pClientList[iClientH]->m_dwLastActionTime = m_pClientList[iClientH]->m_dwAFKCheckTime = timeGetTime();"


Buscamos:

En la funcion agregamos:


Code:
"Código: m_pClientList[iClientH]->m_dwAFKCheckTime = timeGetTime();"



Buscamos:

En la funcion agregamos:

Code:
"Código: m_pClientList[iClientH]->m_dwLastActionTime = m_pClientList[iClientH]->m_dwAFKCheckTime = timeGetTime();"



Buscamos:

Y en la funcion agregamos:


Code:
"Código: m_pClientList[iClientH]->m_dwLastActionTime = m_pClientList[iClientH]->m_dwAFKCheckTime = timeGetTime();"


Vamos al Client.H

Buscamos este pequeño código BOOL:


Y abajo agregamos:


------CLIENTE--------

Abrimos el Game.cpp y buscamos:


Code:
"Código: case 206: // m_pEffectList[i]->m_mX     = sX; m_pEffectList[i]->m_mY     = sY; m_pEffectList[i]->m_cMaxFrame   = 3; m_pEffectList[i]->m_dwFrameTime = 70; break;"


Abajo del break; agregamos


Code:
"Código: case 247: // AFKChecker m_pEffectList[i]->m_mX     = sX*32; m_pEffectList[i]->m_mY     = sY*32; m_pEffectList[i]->m_cMaxFrame   = 17; m_pEffectList[i]->m_dwFrameTime = 200; m_pEffectList[i]->m_mX3    = sDist; m_pEffectList[i]->m_mY3    = -(((m_sViewPointX / 32) + 10) - dX)*1000; m_pEffectList[i]->m_iV1    = rand()%35; m_pEffectList[i]->m_cFrame = - rand() %12; break;"



Buscamos:


Code:
"Código: case 206: // steams dX  = m_pEffectList[i]->m_mX; dY  = m_pEffectList[i]->m_mY; m_pEffectSpr[139]->PutTransSprite_NoColorKey(dX, dY, (rand() %20), dwTime); break;"



Y abajo agregamos:


Code:
"Código:   case 247: // AFKChecker dX = (m_pEffectList[i]->m_mX) - m_sViewPointX; dY = (m_pEffectList[i]->m_mY) - m_sViewPointY; m_pEffectSpr[85]->PutTransSprite_NoColorKey(dX+50, dY+30, m_pEffectList[i]->m_cFrame, dwTime);                         break;"

Como paso final buscamos esto:


Code:
"Código: case 183: // Inhibition-Casting cTempFrame = m_pEffectList[i]->m_cFrame; dX  = (m_pEffectList[i]->m_dX*32)  - m_sViewPointX; dY  = (m_pEffectList[i]->m_dY*32)  - m_sViewPointY; m_pEffectSpr[95]->PutTransSprite_NoColorKey(dX, dY+40, cTempFrame, dwTime); break;"




Y abajo del break agregamos:


Code:
"Código: case 247: // AFKChecker if (m_pEffectList[i]->m_cFrame >= m_pEffectList[i]->m_cMaxFrame) { delete m_pEffectList[i]; m_pEffectList[i] = NULL; }else if (m_pEffectList[i]->m_iV1 == m_pEffectList[i]->m_cFrame) { PlaySound('M', 45, m_pEffectList[i]->m_mX3, m_pEffectList[i]->m_mY3 ); } break;"
Back to top Go down
Roa


Roa

Diamond 1
Earned by having 144 posts & comments.
10th Anniversary
Earned after being a member for 10 years.
Moderator
Earned by becoming a board moderator.

Likes : 28

[CODE] AFK Checker Empty
#2PostSubject: Re: [CODE] AFK Checker   [CODE] AFK Checker 999103/1/2014, 10:33 pm

Muchas gracias OGNiiZ^  Smile
Back to top Go down
yAMA


avatar

Silver
Earned after your first post and comment.
10th Anniversary
Earned after being a member for 10 years.

Likes : 4

[CODE] AFK Checker Empty
#3PostSubject: Re: [CODE] AFK Checker   [CODE] AFK Checker 999103/1/2014, 10:42 pm

De nada amigo Smile
Back to top Go down
KenZoB


KenZoB

Silver 1
Earned by having 48 posts & comments.
Civilian
Granted to members for high engagement.

Likes : 9

[CODE] AFK Checker Empty
#4PostSubject: Re: [CODE] AFK Checker   [CODE] AFK Checker 9991011/6/2014, 4:49 pm

para la próxima amigo usa la herramienta "Codigo" , asi se entiende mejor lo que postea.
Code:
Ejemplo de como saldria!
Back to top Go down
Roa


Roa

Diamond 1
Earned by having 144 posts & comments.
10th Anniversary
Earned after being a member for 10 years.
Moderator
Earned by becoming a board moderator.

Likes : 28

[CODE] AFK Checker Empty
#5PostSubject: Re: [CODE] AFK Checker   [CODE] AFK Checker 9991011/6/2014, 5:45 pm

KenZoB wrote:
para la próxima amigo usa la herramienta "Codigo" , asi se entiende mejor lo que postea.

Igual también pienso lo mismo, voy a editar el mensaje. Y ahora que me fijo me parece que el código no funciona, faltan muchas partes.

Tema movido a la 
Papelera/Contenedor
Back to top Go down
Sponsored content






[CODE] AFK Checker Empty
#6PostSubject: Re: [CODE] AFK Checker   [CODE] AFK Checker 99910

Back to top Go down
 
[CODE] AFK Checker
Back to top 
Page 1 of 1
 Similar topics
-
» Get IP code
» [CODE] New Status
» [CODE] Fix Windows 8 - 10
» [CODE] MP,HP,SP, EN COLORES
» [CODE] /dkset

Permissions in this forum:You cannot reply to topics in this forum
Join Helbreath :: Development :: Deleted & Closed Posts-
Jump to: