OPK

Posts 16–24 of 24 · Page 2 of 2
Quote Originally Posted by Jhem View Post
This part is your problem.
Code:
void OPK_ON()
{
if (GetAsyncKeyState(VK_NUMPAD3))
{
OPKVal = OPKVal = 1;  
}
}
void OPK_OFF()
{
if (GetAsyncKeyState(VK_NUMPAD6))
{
OPKVal = OPKVal = 0;  
}
}

void OPK()
{
if (OPKVal == 1)
{
for(int i = 0; i < 32; i++)
if ( pBase->m_pGlobalPlayers[i] - pBase->m_pLocalPlayer )
{
pBase->m_pGlobalPlayers[i]->X = OPKSaveX;
pBase->m_pGlobalPlayers[i]->Y = OPKSaveY;
pBase->m_pGlobalPlayers[i]->Z = OPKSaveZ;
}
}

void OPKSAVESPOT()
{
if (GetAsyncKeyState(VK_F5))
for(int i = 0; i < 32; i++)
{
OPKSaveX = pBase->m_pLocalPlayer->X;
OPKSaveY = pBase->m_pLocalPlayer->Y;
OPKSaveZ = pBase->m_pLocalPlayer->Z;
}
}
}
Why? Think about it.
Fixed
Code:
void OPKSave()
{
if (GetAsyncKeyState(VK_F5))
{
pBase->m_pGlobalPlayers[i]->X = OPKSaveX;
pBase->m_pGlobalPlayers[i]->Y = OPKSaveY;
pBase->m_pGlobalPlayers[i]->Z = OPKSaveZ;
}
}

void OPK()
{
if (OPKVal == 1))
{
for(int i = 0; i < 32; i++)
{
OPKSaveX = pBase->m_pLocalPlayer->X;
OPKSaveY = pBase->m_pLocalPlayer->Y;
OPKSaveZ = pBase->m_pLocalPlayer->Z;
}
}
}
I think this code won't work, becuse OPKSave don't have any value for i variable. but i think it will gonna work if i just transfer the for loop from OPK and put it in the OPKSave instead.
Quote Originally Posted by -=meow=- View Post
I think this code won't work, becuse OPKSave don't have any value for i variable. but i think it will gonna work if i just transfer the for loop from OPK and put it in the OPKSave instead.
Opps I forgot about that.
Code:
float posiX,posiY,posiZ;
int OPKVal = 1;

void OPKSave()
{
if (GetAsyncKeyState(VK_F5)&1)
{
posiX = p_Base->pLocal->posx;
posiY = p_Base->pLocal->posy;
posiZ = p_Base->pLocal->posz
}
}

void OPK()
{			
if OPKVal == 1)
{
for(int i = 4; i < 32; i++)
{
CPlayer* pPlayer = p_Base->pGlobal[i];
pPlayer->posx = posiX;
pPlayer->posy = posiY;
pPlayer->posz = posiZ;
}
}
}
Quote Originally Posted by Jhem View Post

Opps I forgot about that.
Code:
float posiX,posiY,posiZ;
int OPKVal = 1;

void OPKSave()
{
if (GetAsyncKeyState(VK_F5)&1)
{
posiX = p_Base->pLocal->posx;
posiY = p_Base->pLocal->posy;
posiZ = p_Base->pLocal->posz
}
}

void OPK()
{			
if OPKVal == 1)
{
for(int i = 4; i < 32; i++)
{
CPlayer* pPlayer = p_Base->pGlobal[i];
pPlayer->posx = posiX;
pPlayer->posy = posiY;
pPlayer->posz = posiZ;
}
}
}
tried this but my char keeps teleporting together with the other char.

so i put back the
Code:
if ( pBase->m_pGlobalPlayers[i] - pBase->m_pLocalPlayer )
Hope it will work now.
Here: A gift for you.
Code:
struct CBase
{
CPlayer* pLocal;
CHAR xUnknown0011[504604];
CPlayer** pGlobal;
};

CBase* p_Base = (CBase*)ADR_PlayerPointer;
Quote Originally Posted by Jhem View Post
Here: A gift for you.
Code:
struct CBase
{
CPlayer* pLocal;
CHAR xUnknown0011[504604];
CPlayer** pGlobal;
};
Here's my CBase
CBase* p_Base = (CBase*)ADR_PlayerPointer;
My CBase:
Code:
struct CBase
{
	CPlayer* m_pLocalPlayer;;//0x0000
		CHAR GlobalPtr[504604];//0x7b31c
	CPlayer** m_pGlobalPlayers;//0x0000
};//size = 0x7b31c(504604)
CBase* pBase = (CBase*)ADR_PlayerPointer;
here's a Video for the outcome, sorry for low quality.


as you can see it work but the problem is, the player is being dragged back to its original position.
Quote Originally Posted by -=meow=- View Post
as you can see it work but the problem is, the player is being dragged back to its original position.
Add Sleep.
Code:
pBase->m_pGlobalPlayers[i]->Z = OPKSaveZ;
Sleep(0);
}
Problem solved! I just added a for loop.
@ @Mayion Please Close this Thread. Thank you.
Posts 16–24 of 24 · Page 2 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us