You are viewing our Forum Archives. To view or take place in current topics click here.
need help with C#
Posted:

need help with C#Posted:

Bond_Modz
  • Challenger
Status: Offline
Joined: Jun 14, 201113Year Member
Posts: 185
Reputation Power: 7
Status: Offline
Joined: Jun 14, 201113Year Member
Posts: 185
Reputation Power: 7
Ok, so I goot all the coding to add bots to ghosts tu7, but i dont know how to add it to a button. Can someone please help? i tried this already


private void button29_Click(object sender, EventArgs e)
{
void AddBot(){
char buffer[0x1000];
int clientIndex;
int (*AddBotz)() = (int(__cdecl*)())0x824BD4E0;
void (*SV_ECC)(void*cl, const char*s, int clientOK, int) = (void(__cdecl*)(void*,const char*,int,int))0x824BA730;
clientIndex = AddBotz();
sprintf(buffer, "lui 60 %i %i, irand(1, 3), value);
SV_ECC((void*)client_s(clientIndex), buffer, 1, 0);
Sleep(100);
sprintf(buffer, "lui 5 1 %i", value);
SV_ECC((void*)client_s(clientIndex), buffer, 1, 0);
Sleep(50);
}
}
}

but it gives me 63 different errors... I am very new to C#.
#2. Posted:
ZZ9_x_iHaXoRZz
  • Rated Awesome
Status: Offline
Joined: Mar 11, 201113Year Member
Posts: 4,436
Reputation Power: 8964
Status: Offline
Joined: Mar 11, 201113Year Member
Posts: 4,436
Reputation Power: 8964
Show me the error bro and i see if i can help you.

Edit
I see your problem bro, you added a void to the button, the void is what you should be calling and looking at your coding it's in C++
#3. Posted:
Bond_Modz
  • Challenger
Status: Offline
Joined: Jun 14, 201113Year Member
Posts: 185
Reputation Power: 7
Status: Offline
Joined: Jun 14, 201113Year Member
Posts: 185
Reputation Power: 7
ZZ9_x_iHaXoRZz wrote Show me the error bro and i see if i can help you.

Edit
I see your problem bro, you added a void to the button, the void is what you should be calling and looking at your coding it's in C++

How would I make it C#? I need this very badly ;)
#4. Posted:
Bond_Modz
  • Challenger
Status: Offline
Joined: Jun 14, 201113Year Member
Posts: 185
Reputation Power: 7
Status: Offline
Joined: Jun 14, 201113Year Member
Posts: 185
Reputation Power: 7
I converted it and got this:

private void AddBot()
{
string buffer = new string(new char[0x1000]);
int clientIndex;
//C++ TO C# CONVERTER TODO TASK: This delegate declaration (converted from the original function pointer) must be moved outside of this method:
private delegate int AddBotzDelegate();
AddBotzDelegate AddBotz;
AddBotz = ((int)(__cdecl)())0x824BD4E0;
//C++ TO C# CONVERTER TODO TASK: This delegate declaration (converted from the original function pointer) must be moved outside of this method:
private delegate void SV_ECCDelegate(object cl, string s, int clientOK, int NamelessParameter4);
SV_ECCDelegate SV_ECC;
SV_ECC = (void(__cdecl)(object*,const sbyte*,int,int))0x824BA730;
clientIndex = AddBotz();
sprintf(buffer, "lui 60 %i %i, irand(1, 3), value); SV_ECC((void*)client_s(clientIndex), buffer, 1, 0); Sleep(100); sprintf(buffer, "lui 5 1 % i", value); SV_ECC((void*)client_s(clientIndex), buffer, 1, 0); Sleep(50); }


I used a C++ to C# Converter, but do not know where to add it at. How do I tie this to a button also??
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.