Ulysses
Ulysses Stuff => Releases => Topic started by: Tomzen on May 06, 2015, 09:23:11 PM
-
A simple command using ConCommand, allowing you to impersonate any player you want to (forcing the player to run "say <msg>"
This command does NOT change your name, just forces a player to say whatever you want him/her to, this command should not be used to do anything illegal, or advertise through other players.
This command alerts other admins who you impersonate through chat as well (silently)
SOURCE:
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
USAGE: I recommend using console, or menu to run this command (located in Fun).
Menu: Fun > Impersonate > Player + MSG BEST OPTION
Console: ulx impersonate "<name>" "<msg>" SECOND OPTION
Chat: !imp "<name>" "<msg>" LAST OPTION
INSTALLATION:
Download == Extract the zip and the contents into /addons file (garrysmod/addons/), relaunch map, and its done.
Source == Copy the source code and paste it into a new .lua file in /sh file on ulx (garrysmod/addons/ulx/lua/ulx/modules/sh), relaunch map, and its done.
I am not responsible to any damage or inconvenience caused by this command.
(UPDATED) Fixed poor coding, and command filter.
-
Reminds me of ulx cexec
-
Reminds me of ulx cexec
Pretty much what it is, but I was bored, and this makes it easier to troll my friends :)
-
I never thought about impersonating my friends but now... This is gonna be fun. :3
Also ulx.command can take a 5th argument, true or false. Setting it to true will hide the command in chat.
-
I never thought about impersonating my friends but now... This is gonna be fun. :3
Also ulx.command can take a 5th argument, true or false. Setting it to true will hide the command in chat.
Thanks, forgot about that. Updated.
-
similar to ulx imitate i believe right? by bender's ulx commands
-
similar to ulx imitate i believe right? by bender's ulx commands
Never realised Bender180 released that... wow, I guess I'll have a look :/
-
Never realised Bender180 released that... wow, I guess I'll have a look :/
I dont remember releasing that.... I may have... but i dont remember. None the less good job!
-
Actually you're right. I'm not sure where I got it from then.
-
(FIX) Added command filter, allowing only messages to go through and NOT commands (or anything starting with "!" really)