Post: C# Pulling black ops 1 clients
04-12-2016, 05:43 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); ill get right to it im trying to pul black ops 1 clients correctly heres the code

try
{
if (listBoxControl17.ItemCount == 1)
{
listBoxControl17.Items.Add(17);
}
for (uint i = 0; i < 18; i++)
{
listBoxControl17[0, Convert.ToInt32(i)].Value = i;
listBoxControl17[1, Convert.ToInt32(i)].Value = ClientNames(i);

}
error is in red error in vs reads "can not apply indexing with [] to and expression of type listboxcontrol17"
whats a good work around so i can get rid of this error and populate the listbox with clients?
04-12-2016, 08:41 PM #2
Jim Halpert
Bounty hunter
Originally posted by Mudjugger View Post
ill get right to it im trying to pul black ops 1 clients correctly heres the code

try
{
if (listBoxControl17.ItemCount == 1)
{
listBoxControl17.Items.Add(17);
}
for (uint i = 0; i < 18; i++)
{
listBoxControl17[0, Convert.ToInt32(i)].Value = i;
listBoxControl17[1, Convert.ToInt32(i)].Value = ClientNames(i);

}
error is in red error in vs reads "can not apply indexing with [] to and expression of type listboxcontrol17"
whats a good work around so i can get rid of this error and populate the listbox with clients?


Here's some pretty general code that you can use as a reference (this is C++):

    u32 client_name_address = 0x000000;
u32 client_interval = 0x3980;
for(int i = 0; i < 18; ++i) {
ui->listWidget->addItem( ccapi.ReadMemory<std::string>(client_name_address + (i * client_interval), nullptr) );
}
04-14-2016, 01:42 PM #3
Toxic
former staff
Originally posted by Manical
ill get right to it im trying to pul black ops 1 clients correctly heres the code

try
{
if (listBoxControl17.ItemCount == 1)
{
listBoxControl17.Items.Add(17);
}
for (uint i = 0; i < 18; i++)
{
listBoxControl17[0, Convert.ToInt32(i)].Value = i;
listBoxControl17[1, Convert.ToInt32(i)].Value = ClientNames(i);

}
error is in red error in vs reads "can not apply indexing with [] to and expression of type listboxcontrol17"
whats a good work around so i can get rid of this error and populate the listbox with clients?


Moved to Programming Inquires section :p
05-10-2016, 11:31 AM #4
S63
Space Ninja
Originally posted by Manical
ill get right to it im trying to pul black ops 1 clients correctly heres the code

try
{
if (listBoxControl17.ItemCount == 1)
{
listBoxControl17.Items.Add(17);
}
for (uint i = 0; i < 18; i++)
{
listBoxControl17[0, Convert.ToInt32(i)].Value = i;
listBoxControl17[1, Convert.ToInt32(i)].Value = ClientNames(i);

}
error is in red error in vs reads "can not apply indexing with [] to and expression of type listboxcontrol17"
whats a good work around so i can get rid of this error and populate the listbox with clients?



If you want this in c# just use a datagridview....

if (dataGridView1.Rows.Count == 1)
{
dataGridView1.Rows.Add(17);
}

for (int i = 0; i < 18; i++)
{
dataGridView1[0, Convert.ToInt32(i)].Value = i;
dataGridView1[1, Convert.ToInt32(i)].Value = GetClientNames(i);
}

and heres a getclient function if needed:
public static string GetClientNames(int Client)
{
string names = PS3.Extensions.ReadString(Client0Name + ((uint)Client * ClientSize));
return names;
}

Hope this help...

If ive written anything out wrong just let me know and ill fix it Winky Winky
05-10-2016, 01:55 PM #5
Originally posted by ItsJordanModz View Post
If you want this in c# just use a datagridview....

if (dataGridView1.Rows.Count == 1)
{
dataGridView1.Rows.Add(17);
}

for (int i = 0; i < 18; i++)
{
dataGridView1[0, Convert.ToInt32(i)].Value = i;
dataGridView1[1, Convert.ToInt32(i)].Value = GetClientNames(i);
}

and heres a getclient function if needed:
public static string GetClientNames(int Client)
{
string names = PS3.Extensions.ReadString(Client0Name + ((uint)Client * ClientSize));
return names;
}

Hope this help...

If ive written anything out wrong just let me know and ill fix it Winky Winky


Lol i didnt want to use a data gridview as it doesn corrospend to the theme im using it sticks out like a sore thumb cause the theme for my application is dark and the data gridview is white doesnt go together at all
05-11-2016, 12:52 PM #6
Originally posted by Manical
Lol i didnt want to use a data gridview as it doesn corrospend to the theme im using it sticks out like a sore thumb cause the theme for my application is dark and the data gridview is white doesnt go together at all


just change the color of the dataGridView
05-11-2016, 12:54 PM #7
Originally posted by VadRe View Post
just change the color of the dataGridView


That doesnt help either as the background of it still stays white already tryed that way before i even considerd asking for help. that was like the first thing i tryed

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo