←  Pytania

AMXX.pl: Support AMX Mod X i SourceMod

»

Hookowanie śmierci

  • +
  • -
knopers666 - zdjęcie knopers666 26.02.2013

Witam chciałbym tak użyć hooku "player_death", żeby wywołał funkcje dopiero jak attacker zabije osoby.Np. Gracz zabije 3 osoby dostaje premie kredytów w czymś tak.
Odpowiedz

  • +
  • -
knopers666 - zdjęcie knopers666 03.03.2013

Dobra znalazłem rozwiązanie tylko coś nie chce działać :/
/* Plugin Template generated by Pawn Studio */
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
public Plugin:myinfo =
{
name = "Premium rpg",
author = "Knopers",
description = "Plugin dla johna",
version = "1.0",
url = "heavycraft.pl"
}
public OnPluginStart()
{
PrintToServer("[KNOPERS]Plugin gotowy do pracy");
HookEvent("round_start", RoundStart, EventHookMode_Post)
}
public Action:RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
CreateTimer(1.00, GivePoint, _, TIMER_REPEAT);
}
public Action:GivePoint(Handle:timer, any:client)
{
new frag = GetClientFrags(client);
if ( (IsClientInGame(client)) && (IsPlayerAlive(client) && GetClientTeam(client) >= 1) && frag != 0 )
    {
  GivePlayerItem(client, "weapon_hegrenade");
    }
else
{
  PrintToServer("");
    }
}
Odpowiedz