I jeszcze jedno pytanie. Jak złapać moment przełączania się pomiędzy graczami w momencie gdy nie żyjemy oraz moment przełączania trybu oglądania (zza pleców, itd.)? Tutaj próbowałem z eventami "spec_target_updated" i "spec_mode_updated" ale też nic.
Dodam, że wszystko co tutaj napisałem, sprawdzałem na botach, więc może to jest powodem?
Kod który testowałem
#pragma semicolon 1
#include <sourcemod>
#define PLUGIN_VERSION "0.1"
public Plugin:myinfo = {
name = "Test",
author = "Sebul",
description = "Test",
version = PLUGIN_VERSION,
url = "http://www.amxx.pl"
};
public OnPluginStart() {
HookEvent("spec_target_updated", EventSpecTarget);
HookEvent("spec_mode_updated", EventSpecMode);
HookEvent("buymenu_open", EventBuymenuOpen);
HookEvent("buymenu_close", EventBuymenuClose);
}
public EventSpecTarget(Handle:event, const String:name[], bool:dontBroadcast) {
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if(client == 1) {
LogMessage("Target");
}
}
public EventSpecMode(Handle:event, const String:name[], bool:dontBroadcast) {
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if(client == 1) {
LogMessage("Mode");
}
}
public EventBuymenuOpen(Handle:event, const String:name[], bool:dontBroadcast) {
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if(client == 1) {
LogMessage("Buy open");
}
}
public EventBuymenuClose(Handle:event, const String:name[], bool:dontBroadcast) {
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if(client == 1) {
LogMessage("Buy close");
}
}


Dodatki SourceMod















