MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / DefineCommand

Method DefineCommand

core/logic_bridge.cpp:759–774  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

757}
758
759void
760CoreProviderImpl::DefineCommand(const char *name, const char *help, const CommandFunc &callback)
761{
762 char *new_name = sm_strdup(name);
763 char *new_help = sm_strdup(help);
764 int flags = 0;
765
766 auto ignore_callback = [] (DISPATCH_ARGS) -> void {
767 };
768
769 ConCommand *cmd = new ConCommand(new_name, ignore_callback, new_help, flags);
770 ke::RefPtr<CommandHook> hook = AddCommandHook(cmd, callback);
771
772 ke::RefPtr<CommandImpl> impl = new CommandImpl(cmd, hook);
773 commands_.push_back(impl);
774}
775
776void CoreProviderImpl::FormatSourceBinaryName(const char *basename, char *buffer, size_t maxlength)
777{

Callers 4

OnSourceModStartupMethod · 0.80
OnSourceModStartupMethod · 0.80

Calls 2

sm_strdupFunction · 0.85
push_backMethod · 0.80

Tested by

no test coverage detected