teleport proc x:word y:word z:word pushad mov eax, player1 ; player1 is the address mov edx, dword ptr ds:[eax] add edx, dword ptr ofs_new_x mov [edx], word ptr x add edx, 4h mov [edx], word ptr y add edx, 4h mov [edx], word ptr z popad ret teleport endp
void teleport(float x, float y, float z)
{
local = *(cPlayer**)(0x004E4DBC);
local->pos.x = x;
local->pos.y = y;
local->pos.z = z;
}
void ASM_Teleport(float x, float y, float z)//or what ever the data type is
{
_asm
{
mov eax, player1 ; player1 is the address
mov edx, dword ptr ds:[eax]
add edx, dword ptr ofs_new_x
mov [edx], word ptr x
add edx, 4h
mov [edx], word ptr y
add edx, 4h
mov [edx], word ptr z
}
}
mov ebx, dword ptr[eax]
mov ebx, dword ptr ds:[eax]