Scripting/Server/Functions/GetRemoteCaller
Inside a function that a client started with CallServerFunc: the Player who made the call. Outside a remote call it returns null. Use it instead of trusting a Player argument - the arguments of a remote call are chosen by the client and can be forged.
Syntax
GetRemoteCaller()Returns
Player|null
Example
function onPlayerCommand( player, cmd, params )
{
if ( cmd == "getremotecaller" )
{
local result = GetRemoteCaller();
MessagePlayer( "GetRemoteCaller returned: " + result, player );
}
}This sample was generated from the signature – adapt the values to your gamemode.
Related pages
Section: Constructors for helper objects
Categories: Server functions | Constructors for helper objects