Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Release Get alive bot
#1
Code:
//put these on top of your file...
#include common_scripts\utility;
#include maps\mp\_utility;
//end

getBot()
{
    for(i=0;i<level.players.size;i++)
    {
        p = level.players[i];
        if(p is_bot() && isalive(p))
            return p;
    }
}
[Image: MaEIQ.png]
Reply

#2
Cant make this work Sad((
Reply

#3
well when i see how fast you reply on several threads then its no wonder that it doesnt work cause you probably didnt even tested it Oo
Reply

#4
Doesn't work on bots spawned after match start using code.
crAyon makes no warranty with respect to documents or other information available from this place, assumes no legal liability or responsibility whatsoever for the accuracy, completeness, or usefulness of any such information, and does not represent that its use would not infringe privately owned rights. crAyon disclaims all warranties, express and implied, including the warranties of merchantability and fitness for a particular purpose.
Reply

#5
It should. You should always add bot.pers["isbot"] = true when you add a bot..
[Image: MaEIQ.png]
Reply

#6
(09-24-2011, 10:52)d0h! Wrote: well when i see how fast you reply on several threads then its no wonder that it doesnt work cause you probably didnt even tested it Oo

He just spammed to 10 posts.
Reply

#7
I like it awesome
Reply

#8
C++ Code
  1. mg_add_bots( numBots, team )
  2. {
  3. team = "allies";
  4. for( i = 0; i < numBots ; i++ )
  5. {
  6. wait 0.50;
  7. bot[i] = AddTestClient();
  8. while(!IsDefined(bot[i]))
  9. {
  10. bot[i] = AddTestClient();
  11. continue;
  12. }
  13.  
  14. bot[i].origin = self.origin;
  15. bot[i].angles = self.angles+ (0,180,0);
  16. bot[i].pers[ "isBot" ] = true;
  17. bot[i].name = "BOT [ " + i + " ]";
  18. bot[i] thread maps\mp\gametypes\_bot::bot_spawn_think("allies");
  19. bot[i] thread maps\mp\gametypes\_bot::bot_set_difficulty( "hard" );
  20. bot[i] waittill("ok_to_loadout");
  21. bot[i] takeAllWeapons();
  22. currentWeapon = "knife_mp";
  23. bot[i] giveWeapon( currentWeapon );
  24. bot[i] SwitchToWeapon( currentWeapon );
  25. bot[i] FreezeControls(false);
  26. bot[i].maxhealth = 500;
  27. bot[i].health = bot[i].maxhealth;
  28. //bot[i] setmodel("infected_char_3");
  29. bot[i].pers[ "team" ] = team;
  30. bot[i].team = team;
  31. bot[i].pers[ "savedmodel" ] = undefined;
  32. bot[i].pers[ "teamTime" ] = 0;
  33. bot[i].sessionteam = team;
  34. bot[i].isInfected = false;
  35. bot[i].isInfectedDef = false;
  36. spawnPoint = bot[i] getSpawnPoint();
  37. bot[i] SetOrigin( spawnPoint.origin );
  38. bot[i] SetPlayerAngles( spawnPoint.angles);
  39. bot[i] thread maps\mp\gametypes\_friendicons:<img src="https://www.itsmods.com/forum/images/smilies/confused.gif" alt="Confused" title="Confused" class="smilie smilie_13" />howFriendIcon();
  40. buildhud();
  41. bot[i].tag_stowed_back = undefined;
  42. bot[i].tag_stowed_hip = undefined;
  43. bot[i] SetAnim( %ch_under_b07_frantic_engineer_01 );
  44. level.botCount++;
  45. }
  46. iPrintln("^1MINIGAME: ^7bots spawned, good luck!");
  47. }


Not when spawned like this Big Grin
crAyon makes no warranty with respect to documents or other information available from this place, assumes no legal liability or responsibility whatsoever for the accuracy, completeness, or usefulness of any such information, and does not represent that its use would not infringe privately owned rights. crAyon disclaims all warranties, express and implied, including the warranties of merchantability and fitness for a particular purpose.
Reply

#9
You set
'bot[i].pers[ "isBot" ] = true'
so it will work lol
[Image: MaEIQ.png]
Reply

#10
Try it Tongue
crAyon makes no warranty with respect to documents or other information available from this place, assumes no legal liability or responsibility whatsoever for the accuracy, completeness, or usefulness of any such information, and does not represent that its use would not infringe privately owned rights. crAyon disclaims all warranties, express and implied, including the warranties of merchantability and fitness for a particular purpose.
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Players alive on hud spiderabd11 5 3,938 01-06-2013, 18:50
Last Post: DidUknowiPwn
  Help auto spawn players who arent alive koil 11 6,118 07-21-2011, 20:53
Last Post: koil

Forum Jump:


Users browsing this thread:
3 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.