Hello, I have this code down below which imitates players:
function ulx.impersonate( calling_ply, target_plys, msg )
if not msg:find("^!") then -- Allows messages only (not commands)
for k,v in pairs ( target_plys ) do
v:ConCommand("say " .. msg .. "\n") -- Sends the message
end
else
ULib.tsayError( calling_ply, "Do not force players to run commands", true )
end
ulx.fancyLogAdmin( calling_ply, true, "#A impersonated #T", target_plys ) -- For admins (silent)
end
local impersonate = ulx.command( "Tom's Fun", "ulx impersonate", ulx.impersonate, "!imp", true )
impersonate:addParam{ type=ULib.cmds.PlayersArg }
impersonate:addParam{ type=ULib.cmds.StringArg, hint="string" }
impersonate:addParam{ type=ULib.cmds.BoolArg, invisible=true }
impersonate:defaultAccess( ULib.ACCESS_SUPERADMIN )
impersonate:help( "Impersonates a player." ) -- End
I was wondering whether it's possible to make it work on bots for testing for example I'm wanting to test a vote VGUI on DarkRP, but doing / commands on imitate on bots don't work at all, is there anyway around this?
I'd try using Player/Say instead of running a console command on the player.
Sorry, you need to Log In to post a reply to this thread.