- added experimental (so far) support for SourceMod chat triggers
- added ReplyToCommand() for replying to triggers nicely --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40899
This commit is contained in:
@@ -233,28 +233,6 @@ static cell_t IsSoundPrecached(IPluginContext *pContext, const cell_t *params)
|
||||
return enginesound->IsSoundPrecached(sample) ? 1 : 0;
|
||||
}
|
||||
|
||||
static cell_t FakeClientCommand(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
CPlayer *pPlayer = g_Players.GetPlayerByIndex(params[1]);
|
||||
|
||||
if (!pPlayer)
|
||||
{
|
||||
return pContext->ThrowNativeError("Player %d is not a valid player", params[1]);
|
||||
}
|
||||
|
||||
if (!pPlayer->IsConnected())
|
||||
{
|
||||
return pContext->ThrowNativeError("Player %d is not connected", params[1]);
|
||||
}
|
||||
|
||||
char buffer[256];
|
||||
g_SourceMod.FormatString(buffer, sizeof(buffer), pContext, params, 2);
|
||||
|
||||
serverpluginhelpers->ClientCommand(pPlayer->GetEdict(), buffer);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell_t smn_CreateDialog(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
KeyValues *pKV;
|
||||
@@ -354,7 +332,6 @@ REGISTER_NATIVES(halflifeNatives)
|
||||
{"IsGenericPrecached", IsGenericPrecached},
|
||||
{"PrecacheSound", PrecacheSound},
|
||||
{"IsSoundPrecached", IsSoundPrecached},
|
||||
{"FakeClientCommand", FakeClientCommand},
|
||||
{"CreateDialog", smn_CreateDialog},
|
||||
{"PrintToChat", PrintToChat},
|
||||
{"PrintCenterText", PrintCenterText},
|
||||
|
||||
Reference in New Issue
Block a user