Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Natives etc #138

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions scripting/include/stac_api.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
forward void StacGenEvent_Fwd(int Cl, char[] steamid, char[] eventmsg, char[] hostname, char[] hostipandport, char[] demoname, int demotick);
18 changes: 18 additions & 0 deletions scripting/stac.sp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ public Plugin myinfo =

/********** SUBPLUGINS **********/

Handle StacGenEvent_Fwd;

// globals
#include "stac/stac_globals.sp"
// misc funcs used around the plugin
Expand Down Expand Up @@ -161,6 +163,22 @@ public void OnPluginStart()

// jaypatch
OnPluginStart_jaypatch();

//
StacGenEvent_Fwd = CreateGlobalForward
(
"StacGenEvent_Fwd",
ET_Ignore,
/* int Cl */ Param_Cell,
/* char[] steamid */ Param_String,
/* char[] eventmsg */ Param_String,
/* char[] host */ Param_String,
/* char[] hostipandport */ Param_String,
/* char[] demoname */ Param_String,
/* int demotick */ Param_Cell
);


}

public void OnPluginEnd()
Expand Down
13 changes: 10 additions & 3 deletions scripting/stac/stac_stocks.sp
Original file line number Diff line number Diff line change
Expand Up @@ -694,17 +694,17 @@ public void OnLibraryAdded(const char[] name)
}
}

/********** DETECTIONS & DISCORD **********/
/********** DETECTIONS && DISCORD && API **********/

void StacGeneralPlayerNotify(int userid, const char[] format, any ...)
{
StacLogDemo();

if (!DISCORD)
/*if (!DISCORD)
{
return;
}

*/
static char generalTemplate[2048] = \
"{ \"embeds\": \
[{ \"title\": \"StAC Detection!\", \"color\": 16738740, \"fields\":\
Expand Down Expand Up @@ -745,6 +745,13 @@ void StacGeneralPlayerNotify(int userid, const char[] format, any ...)
{
steamid = "N/A";
}
Call_StartForward(StacGenEvent_Fwd);

// forward void StacGenEvent_Fwd(int Cl, char[] steamid, char[] eventmsg, char[] hostname, char[] hostipandport, char[] demoname, int demotick);

Call_Finish();

// Stac_OnGeneralNotify(
Format
(
msg,
Expand Down