Removing bots perks and guns to replace them with our choice in mp
-
Here is my attempt at removing bots perks and guns to give them custom loadout, but it seems that "bot" isn't a defined entity like "player" is
Does a bot connects to the game? How do you modify its behaviour?
#include maps\mp\bots\_bot; #include maps\mp\bots\_bot_combat; main() { onbotconnect(); } onbotconnect(){ for ( ;; ){ level waittill( "connected", bot ); bot thread onbotspawned(); } } onbotspawned() { level endon( "game_ended" ); self endon( "disconnect" ); for(;;) { self waittill( "spawned_bot" ); self thread gunsandperksremoval(); self thread runAndMoveFromSpotstoSpots(); wait 0.05; } } gunsandperksremoval() { self takeallweapons(); self clearperks(); self giveweapon("insas_mp+stalker+fastads", 0); self setperk( "specialty_unlimitedsprint" ); }
-
zFast
The "bot" is "player", when you spawn a bot the bot get connected (so in thelevel waittill( "connected",player)
the player can be a bot).Call a method onbotconnect do not change how the game behave. The bot spawn and act like a normal player.
There is no such a thing as "spawn_bot" but there is "spawn_player". You can use that and check if its a bot by looking and the variable
pers["isBot"]
Like this
onbotconnect(){ for ( ;; ) { level waittill( "connected", player); if(isDefined(player.pers["isBot"]) && player.pers["isBot"]) { player thread onbotspawned(); } } }
-
This post is deleted!
-
Sorex hmm okay so far this is what I've got
onplayerconnect(){ for ( ;; ){ level waittill( "connected", player ); player thread unlimitedAmmo(); player thread onplayerspawned(); player thread input(); if(isDefined(player.pers["isBot"]) && player.pers["isBot"]) { player thread onbotspawned(); } } } onbotspawned() { level endon( "game_ended" ); self endon( "disconnect" ); for(;;) { self waittill( "spawned_player" ); self thread gunsandperksremoval(); wait 0.05; } } gunsandperksremoval() { self takeallweapons(); self clearperks(); self giveweapon("insas_mp+stalker+fastads", 0); self setperk( "specialty_unlimitedsprint" ); }
It took the weapon and perks for sure, and it gave unlimited sprints to bots but it didnt give an msmc