Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
49 lines (45 sloc) 1.43 KB
#pragma semicolon 1
#define DEBUG
#define PLUGIN_AUTHOR "northeaster"
#define PLUGIN_VERSION "1.0"
#include <sourcemod>
#include <steamworks>
#include <basecomm>
#include <discord_steamworks>
#include <calladmin>
#pragma newdecls required
public Plugin myinfo =
{
name = "",
author = PLUGIN_AUTHOR,
description = "",
version = PLUGIN_VERSION,
url = "https://forum.sourceturk.net/"
};
public void OnPluginStart()
{
webhook = CreateConVar("dc_rapor_log", "https://discordapp.com/api/webhooks/...", "Discord webhook");
AutoExecConfig(true, "dc_rapor_log");
LoadTranslations("dc_rapor.phrases");
}
public void CallAdmin_OnReportPost(int client, int target, const char[] reason)
{
char sReason[(REASON_MAX_LENGTH + 1) * 2], clientAuth[21], clientName[(MAX_NAME_LENGTH + 1) * 2];
strcopy(sReason, sizeof(sReason), reason);
if (client == REPORTER_CONSOLE)
{
strcopy(clientName, sizeof(clientName), "Sunucu");
strcopy(clientAuth, sizeof(clientAuth), "Konsol");
}
else
{
GetClientAuthId(client, AuthId_Steam2, clientAuth, sizeof(clientAuth));
GetClientName(client, clientName, sizeof(clientName));
}
char targetAuth[21], targetName[(MAX_NAME_LENGTH + 1) * 2];
GetClientAuthId(target, AuthId_Steam2, targetAuth, sizeof(targetAuth));
GetClientName(target, targetName, sizeof(targetName));
char mesaj[256];
Format(mesaj, sizeof(mesaj), "%t", "RAPOR GELDI", clientName, clientAuth, targetName, targetAuth, sReason);
SendToDiscord(mesaj);
}
You can’t perform that action at this time.