General > Developers Corner

LUA error

<< < (2/3) > >>

Aaron113:

--- Quote from: XxLMM13xX on May 06, 2015, 08:52:20 AM ---well what would this be used for? why would you need to talk in someone else?

--- End quote ---
Purely for fun... I used to do it all the time with cexec.  Mainly just to give people the rusty bullet hole achievement.

Tomzen:
Yeah, looking back, I now see I'm a complete idiot haha:


--- Code: ---function ulx.impersonate( calling_ply, target_plys, msg )

for k,v in pairs( target_plys ) do

v:ConCommand( "say " .. msg ..  "" )

end
ulx.fancyLogAdmin( calling_ply, true, "#A impersonated #T", target_plys )
end


local impersonate = ulx.command( CATEGORY_NAME, "ulx impersonate", ulx.impersonate, "!imp" )
impersonate:addParam{ type=ULib.cmds.PlayersArg }
impersonate:addParam{ type=ULib.cmds.StringArg, hint="string", ULib.cmds.takeRestOfLine }
impersonate:addParam{ type=ULib.cmds.BoolArg, invisible=true }
impersonate:defaultAccess( ULib.ACCESS_SUPERADMIN )
impersonate:help( "Impersonates a player." )
--- End code ---

JamminR:
Heh.
Using multiple targets.
] ulx impersonate !^ "The cake is a lie"
] say "no it's not!"

Tomzen:
heheh, just added that incase I feel like doing so :P

JamminR:

--- Quote from: Tomzen on May 06, 2015, 08:53:55 PM ---heheh, just added that incase I feel like doing so :P

--- End quote ---
Don't need to add anything. Our target object PlayerArgs would already allow for it.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version