![]() |
| |||||||
| Home | GzP Upload | GzP Arcade | Register | vbBux / vbPlaza | All Albums | FAQ | Donate | Members List | Calendar | Mark Forums Read |
| Gunz Hacks/Bots Discussion Gunz Hacks/Bots Discussion only. No begging. |
![]() |
| | Thread Tools | Display Modes |
| | #1 |
| Registered User | Help with code I tried to do a thing that if you type in game !spam:on it will start spamming random sentences (out of 5 ) But when i inject , and type !spam:on nothing happens :\ Code:
Also I tried to change the last input to a key but it started spamming first spam sentence and froze my computer, here is how that looked like Code: if(GetAsyncKeyState(VK_NEXT))
{
bool spamming = true;
while(spamming = true)
{
int i = rand()%5;
if(i==1)
{
for(int a=0;a<7;++a)
{
ZPostPeerChat("^1Good morning niggaz!",0);
}
}
else if(i==2)
{
for(int a=0;a<7;++a)
{
ZPostPeerChat("^2Pool's closed!",0);
}
}
else if(i==3)
{
for(int a=0;a<7;++a)
{
ZPostPeerChat("^3KingHELLZ Pwnz!",0);
}
}
else if(i==4)
{
for(int a=0;a<7;++a)
{
ZPostPeerChat("^4Jackie Chan's hangs like a horse!",0);
}
}
else
{
for(int a=0;a<7;++a)
{
ZPostPeerChat("^5But Chuck Norrises' is way bigger!",0);
}
}
if(GetAsyncKeyState('O'))
{
spamming = false;
}
}
}
|
| | |
| Sponsored Links |
| |
| | #2 |
| AHHH Selfish jean | Re: Help with code int r=0; // #define GetOneKey(key) if(GetAsyncKeyState(key) & 0x8000) // GetOneKey(VK_NEXT) { r = rand () % 5; switch(r) { case 1: // break; case 2: // break; case 3: // etc.. break; default: //etc } } // also.. use memcmp withlastinput, ... [Only registered and activated users can see links. ] e.g if(memcmp(lastinput(), "Something", 9) == 0) { bBool = !bBool; } then in another thread, or the same thread // if(bBool) // true? { // do stuff } Last edited by hitachihex; 08-21-2008 at 08:24 AM.. |
| | |
| The Following User Says Thank You to hitachihex For This Useful Post: | KingHELLZ (08-21-2008) |
| | #3 |
| Registered User | Re: Help with code Ok I changed my code to this now Code: SPAMS()
{
//Random spam messsage
if(memcmp(LastInput(),"!spam:on",8)==0)
{
while(memcmp(LastInput(),"!spam:off",8)!=0)
{
int r = rand()%5;
switch(r)
{
case 1:
{
for(int a=0;a<2;++a)
{
ZPostPeerChat("^1Good morning niggaz!",0);
Sleep(10);
}
}
case 2:
{
for(int a=0;a<2;++a)
{
ZPostPeerChat("^2Pool's closed!",0);
Sleep(10);
}
}
case 3:
{
for(int a=0;a<2;++a)
{
ZPostPeerChat("^3KingHELLZ Pwnz!",0);
Sleep(10);
}
}
case 4:
{
for(int a=0;a<2;++a)
{
ZPostPeerChat("^4Jackie Chan's hangs like a horse!",0);
Sleep(10);
}
}
default:
{
for(int a=0;a<2;++a)
{
ZPostPeerChat("^5You all are ******s!",0);
Sleep(10);
}
}
}
}
}
//END of random spam message
}
|
| | |
| | #4 |
| AHHH Selfish jean | Re: Help with code while(memcmp(LastInput(),"!spam:off",8)!=0) { that line right there is full of fail, completly remove it, create a global boolean variable, such as bool bSpam = false; once memcmp(lastinput(), "@spam", 5) == 0){ bSpam = !bSpam; } // then in another threa,d or the same thread if(bSpam){ // do whatever you want.. } |
| | |
| The Following User Says Thank You to hitachihex For This Useful Post: | KingHELLZ (08-21-2008) |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |