Ola,
Estou batendo cabeça a dias com um codigo que estou adaptando e nao esta dando certo, se alguem conseguir me dar uma ajuda agradeceria.
esta dando um problema a tentar executar uma açao dando a mesangem no debug "valor era muito grande ou muito pequeno para um byte não atribuído"
Segue o codigo
private static void ByteWrite(IntPtr address, byte[] bytes)
{
int lpNumberOfBytesWritten = 2;
Player.WriteProcessMemory((int) Proc.Handle, address, bytes, bytes.Length, ref lpNumberOfBytesWritten);
}
public static void UsarItem(int Slot)
{
Player.ByteWrite(new IntPtr(7875792), new byte[32]
{
(byte) 36,
(byte) 0,
(byte) 0,
(byte) 0,
(byte) 115,
(byte) 3,
Player.ClientID[0],
Player.ClientID[1],
(byte) 0,
(byte) 0,
(byte) 0,
(byte) 0,
(byte) 1,
(byte) 0,
(byte) 0,
(byte) 0,
Convert.ToByte(Slot),
(byte) 0,
(byte) 0,
(byte) 0,
(byte) 0,
(byte) 0,
(byte) 0,
(byte) 0,
(byte) 0,
(byte) 0,
(byte) 0,
(byte) 0,
Player.IntToArrayByte(Player.Loc.X)[0],
Player.IntToArrayByte(Player.Loc.X)[1],
Player.IntToArrayByte(Player.Loc.Y)[0],
Player.IntToArrayByte(Player.Loc.Y)[1]
});
Player.SendPacket((byte) 36);
Thread.Sleep(100);
a acao funciona normalmente com algumas call com ID menores, mas se o ID for maior acaba dando esse erro, sera que consigo adaptar com um Byte maior?