Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Crashes

  1. #1
    Senior Member
    Join Date
    May 2006
    Posts
    225

    Crashes

    Im trying to add automated selfkill to my bot, but on 'awaiting gamestate,' the game crashes. Here's the code:

    Code:
    void doSelfKill()
    {
    	int health = cg->snap->ps.stats[STAT_HEALTH];
    	bool kill = false;
    
    	if( health < ffs_selfkilllevel.value && health >= 0 )
    	{
    		kill = true;
    
    		if( ffs_selfkill.value == 1 && kill)
    		{
    			trap_SendConsoleCommand("kill\n");
    		}
    	}
    	else
    		kill = false;
    }

  2. #2
    Coders chaplex's Avatar
    Join Date
    Apr 2006
    Location
    Croatia / Hrvatska
    Posts
    751

    Re: Crashes

    if (!cg->snap)
    return;
    The DJs took pills to stay awake and play for seven days

  3. #3
    VIP fANAT1C's Avatar
    Join Date
    Sep 2006
    Posts
    1,557

    Re: Crashes

    Quote Originally Posted by BonZ
    Im trying to add automated selfkill to my bot, but on &#39;awaiting gamestate,&#39; the game crashes. Here&#39;s the code:

    Code:
    void doSelfKill()
    {
    	int health = cg->snap->ps.stats[STAT_HEALTH];
    	bool kill = false;
    
    	if( health < ffs_selfkilllevel.value && health >= 0 )
    	{
    		kill = true;
    
    		if( ffs_selfkill.value == 1 && kill)
    		{
    			trap_SendConsoleCommand("kill\n");
    		}
    	}
    	else
    		kill = false;
    }
    Aha, are you coding a new bot?




    Google is your friend
    Before asking any (stupid) questions use the search-option first
    Stupid question = stupid answer
    I do NOT respond to private messages when you ask for hacks.

  4. #4
    Site Admin xHalt's Avatar
    Join Date
    May 2006
    Location
    Belgium
    Posts
    8,183

    Re: Crashes

    Quote Originally Posted by BonZ
    Code:
    	if( health < ffs_selfkilllevel.value && health >= 0 )
    Why the &#39;=&#39;?
    If your health = 0, you&#39;re dead, selfkilling then is absolete. Since there is delay in respons, I wouldn&#39;t even be surprised to see you&#39;re doing a selfkill when just respawned and your health wasn&#39;t set to a higher value yet, though since only the millisecond of reaction time, that prob won&#39;t happen.

  5. #5
    Senior Member
    Join Date
    May 2006
    Posts
    225

    Re: Crashes

    Quote Originally Posted by Firecracker
    Why the &#39;=&#39;?
    If your health = 0, you&#39;re dead, selfkilling then is absolete. Since there is delay in respons, I wouldn&#39;t even be surprised to see you&#39;re doing a selfkill when just respawned and your health wasn&#39;t set to a higher value yet, though since only the millisecond of reaction time, that prob won&#39;t happen.
    True, but by the looks of it, it makes no difference due to the time as you said. Will change it anywayz lol! and are you learning to code firecracker??

    and cheers chaplex but i fixed it last night quickly before i went to bed, i realised i missed that in drawactiveframe, and thats why other snapshot functions werent operating properly, but cheers anywayz

    and @psycho, yeah i managed to pull myself away from FEAR and CoD2 lol, and im just adding stuff in atm

  6. #6
    Veteran Member Austin's Avatar
    Join Date
    Nov 2006
    Posts
    979

    Re: Crashes

    Quote Originally Posted by BonZ
    True, but by the looks of it, it makes no difference due to the time as you said. Will change it anywayz lol! and are you learning to code firecracker??

    and cheers chaplex but i fixed it last night quickly before i went to bed, i realised i missed that in drawactiveframe, and thats why other snapshot functions werent operating properly, but cheers anywayz

    and @psycho, yeah i managed to pull myself away from FEAR and CoD2 lol, and im just adding stuff in atm
    Hehe,looks like we might get another bot in,dont you say?

  7. #7
    Senior Member
    Join Date
    May 2006
    Posts
    225

    Re: Crashes

    lol, one with self kill which annoys the leaked private bot users

  8. #8
    Site Admin xHalt's Avatar
    Join Date
    May 2006
    Location
    Belgium
    Posts
    8,183

    Re: Crashes

    Quote Originally Posted by BonZ
    and are you learning to code firecracker??
    Nope. I know my fair share of coding, 2 bad it&#39;s java coding. Hooking, detours, etc are completely unknown to me.
    But I&#39;ve programmed my share of mastermind, sea battle, remote control software for PDA, Calender/Appointment system for PDA, ...
    => So basically crap... Just didn&#39;t find the time yet to broaden my horizons to C++...

  9. #9
    Veteran Member
    Join Date
    Apr 2006
    Location
    Canada
    Posts
    748

    Re: Crashes

    Quote Originally Posted by Firecracker
    Nope. I know my fair share of coding, 2 bad it&#39;s java coding. Hooking, detours, etc are completely unknown to me.
    But I&#39;ve programmed my share of mastermind, sea battle, remote control software for PDA, Calender/Appointment system for PDA, ...
    => So basically crap... Just didn&#39;t find the time yet to broaden my horizons to C++...
    the transition from java to C++ will probably be very easy for you (hell it&#39;s probably easier java -> C#)
    both are oo languages.. templates and classes
    Code:
    <chaplja|> i'm taking over nixcoders
    <Smileman`> cool

  10. #10
    VIP fANAT1C's Avatar
    Join Date
    Sep 2006
    Posts
    1,557

    Re: Crashes

    Quote Originally Posted by BonZ
    lol, one with self kill which annoys the leaked private bot users
    Works for which mods? :P




    Google is your friend
    Before asking any (stupid) questions use the search-option first
    Stupid question = stupid answer
    I do NOT respond to private messages when you ask for hacks.

Page 1 of 2 12 LastLast

Similar Threads

  1. Internet crashes :(
    By ramm011 in forum Server Setup
    Replies: 5
    Last Post: March 29th, 2010, 02:46
  2. CS crashes
    By heaven23 in forum Counterstrike Source Cheats
    Replies: 0
    Last Post: April 26th, 2009, 09:35
  3. whitelight 4.0.1 crashes
    By bullets in forum WhiteLight
    Replies: 12
    Last Post: January 28th, 2009, 15:58
  4. Do this to get less crashes!
    By »Pwn3r« in forum Guides & Tutorials
    Replies: 10
    Last Post: April 5th, 2008, 14:03

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •