C0nw0nk / Garrys-Mod-Fake-Players

Spoof / Spoofing / fake / faked / faking players counts on servers in Garrys Mod using bots lots of useful features to customize slots to be kept free / open and make the bots look like real players GMod / GarrysMod / Garry's Mod / Garry'sMod has allot of fake servers
http://www.networkflare.com/
18 stars 8 forks source link

The bots do not spawn. #2

Closed Ethorbit closed 8 years ago

Ethorbit commented 8 years ago

I have edited the file to make their team GUEST. They will be guests, and the player count works; HOWEVER, they do not spawn.

Idk if this is an issue or if the addon was made to keep bots from spawning, but I at least want to make the bots look idle so someone doesn't join and find out no one is on, after looking in the entire map.

I need help! If you help me, this is my new favorite script...

C0nw0nk commented 8 years ago

The team to assign bots is what ever teams are available on your game mode.

For example Garry's Mod sandbox has the following Teams to choose from. https://github.com/garrynewman/garrysmod/blob/master/garrysmod/lua/includes/modules/team.lua

It depends on what game mode your running but "GUEST" is not a valid team.

Set the config value to this Team_to_Assign_Bots = false

And I think it will have the desired effect you are after ?

Ethorbit commented 8 years ago

Sorry, I forgot to mention that I tried = false, and like I said, the bots are in the game and everything, yet they are always dead according to ULX. Doing !frespawn * (kills player and respawns them) only shows I died as if the bots do not exist, yet they show on the [TAB] menu and server status. I also tried TEAM_Spectator, Team_Unassigned,etc and same result.

Not sure if these errors matter (I get many errors and the addon source still works properly) but this is what I get on !frespawn *: ` [ERROR] addons/fakeplayers/lua/autorun/server/sv_fakeplayers.lua:403: bad argument #1 to 'SetTeam' (number expected, got nil)

  1. SetTeam - [C]:-1
    1. fn - addons/fakeplayers/lua/autorun/server/sv_fakeplayers.lua:403
    2. unknown - addons/ulib_557962238/lua/ulib/shared/hook.lua:110
      1. Spawn - [C]:-1
      2. call - addons/[ulx]_customcommands_v4.5_510556360/lua/ulx/modules/sh/cc_util.lua:633
      3. __fn - addons/ulib_557962238/lua/ulib/shared/commands.lua:943
      4. unknown - addons/ulib_557962238/lua/ulib/shared/commands.lua:1306
        1. pcall - [C]:-1
        2. pcallError - addons/ulib_557962238/lua/ulib/shared/util.lua:570
        3. fn - addons/ulib_557962238/lua/ulib/server/concommand.lua:67
        4. unknown - addons/ulib_557962238/lua/ulib/shared/hook.lua:110 `
C0nw0nk commented 8 years ago

So the bots are standing there(alive) but yet ULX does not recognize that they are alive is that what you are getting at ?

Ethorbit commented 8 years ago

I'm saying that something in the code prevents the bots from respawning. I tried a script to make them respawn constantly, and literally I see them poof at spawn for a split second in different spawn points (like right after they respawn they're dead again) I need them to be standing there (alive) though

If I remove fakeplayers, reload server, spawn a bot it is no longer always dead.

C0nw0nk commented 8 years ago

Run the code in sandbox (without any other game modes or addons) and see if it works in all my testing they spawn in just fine with Team_to_Assign_Bots = false

You need to eliminate potential external script issues because allot of scripts / addons do not support NextBots nor understand what to do if the player in question is a bot.

Also i will add if they appear and then disapear it means something is using the KillSilent() command on them.

Ethorbit commented 8 years ago

I tried it already, but I'm trying it again my server is restarting now with the new change: Team_to_Assign_Bots = false If it doesn't work, I will try without addons running like you suggested thank you.

Ethorbit commented 8 years ago

They work now I have no clue what happened.

C0nw0nk commented 8 years ago

Was you changing the Team_to_Assign_Bots = Value without restarting the server you should always do restarts when editing non cvar config values.

Ethorbit commented 8 years ago

I always restart when changing stuff in my server. For some reason the bots also do +duck and using HB Controller SWEP (it lets me control bots too) it'll stand up and then when I exit hb controller the bot toggles duck again.

I know it isn't your addon causing this, but any idea how to correct that?

C0nw0nk commented 8 years ago

Try this code :

hook.Add("StartCommand", "StartCommand-Control-Bots", function(ply,cmd) if ply:IsBot() then --Clear movements and state. cmd:ClearMovement() cmd:ClearButtons() end end)

//EDIT : To include If IsBot

Ethorbit commented 8 years ago

You're the best Thank you so much!

Ethorbit commented 8 years ago

They seem to not respawn after death when disabling their controls, but oh well

C0nw0nk commented 8 years ago

The force them to respawn.

timer.Create("Timer-Loop-Respawn-Bots", 1, 0, function()
    --For all bots.
    for p,ply in pairs(player.GetBots()) do
        --If the bot is dead
        if ply:IsBot() and ply:Health() <= 0 then
            --Respawn the bot
            ply:Spawn()
        end
    end
end)
Ethorbit commented 8 years ago

It works perfectly! :+1: https://www.youtube.com/watch?v=hdyQlcnv0nY

vizful commented 4 years ago

mind explaining where to put the code for making them respawn? or post the code and tell me where to put it my bots are in the unassigned category and not spawning in

Ethorbit commented 4 years ago

mind explaining where to put the code for making them respawn? or post the code and tell me where to put it my bots are in the unassigned category and not spawning in

Yes because these posts were made 4 years ago.