1. Śmierć gracza:
HookEvent("player_death", Event_PlayerDeath);
public Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
new userid = GetClientOfUserId(GetEventInt(event, "userid")); // id zabitego
new attacker = GetClientOfUserId(GetEventInt(event, "attacker")); // id atakujacego
new assister = GetClientOfUserId(GetEventInt(event, "assister")); // id asystujacego
new bool:headshot = GetEventBool(event, "headshot"); // czy headshot (1), czy nie (0)
decl String:weapon[64]
GetEventString(event, "weapon", weapon, sizeof(weapon)) // pobieranie nazwy broni do stringu
}
2. Otrzymywanie obrażeń:
HookEvent("player_hurt", Event_PlayerHurt);
public Event_PlayerHurt(Handle:event, const String:name[], bool:dontBroadcast)
{
new userid = GetClientOfUserId(GetEventInt(event, "userid")); // id otrzymujacego obrazenia
new attacker = GetClientOfUserId(GetEventInt(event, "attacker")); // id zadajacego obrazenia
new health = GetEventInt(event, "health"); // ile HP pozostalo ofiarze
new armor = GetEventInt(event, "armor"); // ile armoru pozostalo ofiarze
decl String:weapon[64]
GetEventString(event, "weapon", weapon, sizeof(weapon)) // pobieranie nazwy broni do stringu
new dmg_health = GetEventInt(event, "dmg_health")); // ile HP zadal atak?
new dmg_armor = GetEventInt(event, "dmg_armor")); // ile armoru zabral atak?
new hitgroup = GetEventInt(event, "hitgroup")); // gdzie zostaly zadane obrazenia (hitbox)
}
3. Odrodzenia gracza:
HookEvent("player_spawned", Event_OnPlayerSpawned);
public Event_OnPlayerSpawned(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid")); // id odrodzonego
new bool:inrestart= GetEventBool(event, "inrestart"); // Czy przez restart rundy/gry?
}
4. Zaczęcie podkładania bomby:
HookEvent("bomb_beginplant", Event_BombBeginPlant);
public Event_BombBeginPlant(Handle:event, const String:name[], bool:dontBroadcast)
{
new userid = GetClientOfUserId(GetEventInt(event, "userid")); // id podkladajacego
new site = GetEventInt(event, "site"); // id bobsite na ktorym zostanie podlozona bomba
}
5. Przerwanie podkładania bomby:
HookEvent("bomb_abortplant", Event_BombAbortPlant);
public Event_BombAbortPlant(Handle:event, const String:name[], bool:dontBroadcast)
{
new userid = GetClientOfUserId(GetEventInt(event, "userid")); // id podkladajacego
new site = GetEventInt(event, "site"); // id bobsite na ktorym zostala podlozona bomba
}
6. Bomba podłożona:
HookEvent("bomb_planted", Event_BombPlanted);
public Event_BombPlanted(Handle:event, const String:name[], bool:dontBroadcast)
{
new userid = GetClientOfUserId(GetEventInt(event, "userid")); // id podkladajacego
new site = GetEventInt(event, "site"); // id bobsite na ktorym zostala podlozona bomba
}
7. Bomba rozbrojona:
HookEvent("bomb_defused", Event_BombDefused);
public Event_BombDefused(Handle:event, const String:name[], bool:dontBroadcast)
{
new userid = GetClientOfUserId(GetEventInt(event, "userid")); // id rozbrajajacego
new site = GetEventInt(event, "site"); // id bobsite na ktorym zostala podlozona bomba
}
8. Bomba wybuchła:
HookEvent("bomb_exploded", Event_BombExploded);
HookEvent("bomb_exploded", Event_BombExploded);
public Event_BombExploded(Handle:event, const String:name[], bool:dontBroadcast)
{
new userid = GetClientOfUserId(GetEventInt(event, "userid")); // id podkladajacego
new site = GetEventInt(event, "site"); // id bobsite na ktorym zostala podlozona bomba
}
9. Bomba upuszczona:
HookEvent("bomb_dropped", Event_BombDropped);
public Event_BombDropped(Handle:event, const String:name[], bool:dontBroadcast)
{
new userid = GetClientOfUserId(GetEventInt(event, "userid")); // id upuszczajacego bombe
}
10. Bomba podniesiona:
HookEvent("bomb_pickup", Event_BombPickup);
public Event_BombPickup(Handle:event, const String:name[], bool:dontBroadcast)
{
new userid = GetClientOfUserId(GetEventInt(event, "userid")); // id podnoszacego bombe
}