Newbie Spellweaver
- Joined
- Dec 26, 2017
- Messages
- 28
- Reaction score
- 0
And the following, I use gunz July 2008, I want to lock the position of the players I have some things here, can someone help me?
but the code is closing the game of the players does anyone know the error?
Second help : I also wanted to teleport players to my position, I have a working command that is / save my position / return my position
the code above I think there is something I can do to teleport players to my position, if someone can help me thank you, I understand little c ++: /
case RC_LOCK_ALL:
{
MUID uidMyChar;
uidMyChar.Low = 0;
pCmd->GetParameter( &uidMyChar.High, 0, MPT_INT, 4 );
if( uidMyChar.High != uidChar.High && *(PBYTE)0x6AB0D4 < 254 ){
bLocked = true;
float* fCurrentPosition = ZCharacter::GetMe()->GetPosition();
fPosition[0] = fCurrentPosition[0];
fPosition[1] = fCurrentPosition[1];
fPosition[2] = fCurrentPosition[2];
GameMsgBox( "Sua posição foi travada." );
}
return true;
break;
};
case RC_UNLOCK_ALL:
{
MUID uidMyChar;
uidMyChar.Low = 0;
pCmd->GetParameter( &uidMyChar.High, 0, MPT_INT, 4 );
if( uidMyChar.High != uidChar.High ){
bLocked = false;
((void(*)( char*, int, int, int ))0x42B860)( "Sua posição foi destravada.", 1, 0, -1 );
}
return true;
break;
};
but the code is closing the game of the players does anyone know the error?
Second help : I also wanted to teleport players to my position, I have a working command that is / save my position / return my position
//TELEPORT
bool bSalvarMinhaPosição = false;
bool bRetornarPosição = false;
float fSavedPosition[3];
float *pPointer, *pResult;
unsigned long MyChar()
{
if((unsigned long *)ZGAME && *(unsigned long *)ZGAME)
return *(unsigned long *)(*(unsigned long *)ZGAME + 0x50);
return 0;
}
float *GetPosition(unsigned long ulZChar)
{
_asm
{
mov ecx, ulZChar
mov eax, dword ptr ds:[ecx + 0x58]
mov ecx, dword ptr ds:[eax + 0x20]
mov edx, dword ptr ds:[eax + 0xC]
mov eax, dword ptr ds:[edx + ecx * 0x4]
mov pResult, eax
}
return pResult;
}
void SetPosition(float *pPosition)
{
pPointer = GetPosition(MyChar());
pPointer[0] = pPosition[0];
pPointer[1] = pPosition[1];
pPointer[2] = pPosition[2];
}
void ChatCmd_SalvarMinhaPosição( char *line, int argc, char *argv[] ){
if( UGradeID > 253 ){
if( !ZGetGame() ){
GameMsgBox( "Use este comando dentro de uma sala." );
return;
}
bSalvarMinhaPosição = !bSalvarMinhaPosição;
if( bSalvarMinhaPosição )
{
memcpy(fSavedPosition, GetPosition(MyChar()), sizeof(fSavedPosition));
ZChatOutput( "Posição : Salva." );
}
}else{
GameMsgBox( "Este comando somento é permitido para pessoas autorizadas." );
}
}
void ChatCmd_RetornarMinhaPosição( char *line, int argc, char *argv[] ){
if( UGradeID > 253 ){
if( !ZGetGame() ){
GameMsgBox( "Use este comando dentro de uma sala." );
return;
}
bRetornarPosição = !bRetornarPosição;
if( bRetornarPosição )
{
SetPosition(fSavedPosition);
ZChatOutput( "Posição : Retornada." );
}
}else{
GameMsgBox( "Este comando somento é permitido para pessoas autorizadas." );
}
}
//END TELEPORT
the code above I think there is something I can do to teleport players to my position, if someone can help me thank you, I understand little c ++: /