Ulysses Stuff > Releases

[ULX] [UPDATED/FIXED] Impersonate ~ Impersonate a player in chat!

(1/2) > >>

Tomzen:
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:

--- Code: ---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
--- End code ---

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.

Bite That Apple:
Reminds me of ulx cexec

Tomzen:

--- Quote from: Bite That Apple on May 06, 2015, 09:41:33 PM ---Reminds me of ulx cexec

--- End quote ---

Pretty much what it is, but I was bored, and this makes it easier to troll my friends :)

Timmy:
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.

Tomzen:

--- Quote from: Timmy on May 06, 2015, 10:30:58 PM ---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.

--- End quote ---

Thanks, forgot about that. Updated.

Navigation

[0] Message Index

[#] Next page

Go to full version