Advertisement
BaSs_HaXoR

GetClients MW3 (Datagridview C#)

Aug 23rd, 2016
357
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.35 KB | None | 0 0
  1. //SRC: http://www.nextgenupdate.com/forums/modern-warfare-3-questions-inquiries/723221-c-mw3-get-client-names-using-datagridview-help.html
  2. // jwm614 on Nextgenupdate
  3.  
  4. using PS3Lib;
  5. using System;
  6. using System.Text;
  7. public class Form1 {
  8.    
  9.     private static PS3API PS3 = new PS3API();
  10.    
  11. //first add this
  12. private uint NameAddress = 0x0110D694;
  13. public string GetName(int client)
  14.         {
  15.             byte[] buffer = new byte[20];
  16.             GetMemory(NameAddress + 0X3980 * (uint)client, buffer);
  17.             string names = Encoding.ASCII.GetString(buffer);
  18.             names = names.Replace("\0", "");
  19.             return names;
  20.         }
  21.  
  22. //then put in a button/timer
  23. dataGridView1.Enabled = true; dataGridView1.RowCount = 18;
  24.             for (int i = 0; i < 18; i++)
  25.             {
  26.                 dataGridView1.Update();
  27.                 dataGridView1.Rows[i].Cells[0].Value = i;
  28.                 dataGridView1.Rows[i].Cells[1].Value = GetName(i);
  29.                
  30.                
  31.             }
  32.  
  33. /*if you want to change a clients name use this in a menustrip
  34.  
  35. int Client = dataGridView1.CurrentRow.Index;
  36.             string a = Interaction.InputBox("New name: ", "Name Change", GetName(Client), -1, -1);
  37.             byte[] NewName = Encoding.ASCII.GetBytes(a + "\0");
  38.             SetMemory(NameAddress + (uint)Client * 0X3980, NewName);
  39. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement