Простой пример скрипта, считаем количество прыжков и убийств за раунд.
Код
#include <sourcemod>
new Jumps[MAXPLAYERS+1], Kills[MAXPLAYERS+1];
public OnPluginStart()
{
HookEvent("player_spawn", player_spawn);
HookEvent("player_jump", player_jump);
HookEvent("player_death", player_death);
HookEvent("round_end", round_end, EventHookMode_PostNoCopy);
}
public player_spawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
Jumps[client] = 0;
Kills[client] = 0;
}
public player_jump(Handle:event, const String:name[], bool:dontBroadcast)
{
Jumps[GetClientOfUserId(GetEventInt(event, "userid"))] += 1;
}
public player_death(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "attacker"));
if (client > 0 && GetClientTeam(client) != GetClientTeam(GetClientOfUserId(GetEventInt(event, "userid"))))
{
Kills[client] += 1;
}
}
public round_end(Handle:event, const String:name[], bool:dontBroadcast)
{
for (new i = 1; i <= MaxClients; i++)
{
if (IsClientInGame(i)) PrintToChat(i, "Вы прыгнули раз: %d, убили врагов: %d", Jumps[i], Kills[i]);
}
}