Код
#pragma semicolon 1
#include <sourcemod>
#include <sdktools_functions>
public Plugin:myinfo =
{
name = "smoke2",
author = "wS (World-Source.Ru)",
version = "1.1"
};
new g_MyHe[MAXPLAYERS + 1];
public OnPluginStart()
{
HookEvent("player_spawn", player_spawn);
HookEvent("smokegrenade_detonate", smokegrenade_detonate);
}
public player_spawn(Handle:event, const String:name[], bool:dontBroadcast)
{
g_MyHe[GetClientOfUserId(GetEventInt(event, "userid"))] = 0;
}
public smokegrenade_detonate(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if (client > 0
&& g_MyHe[client] < 1
&& GetUserFlagBits(client) & ADMFLAG_RESERVATION
&& IsPlayerAlive(client)
&& GetEntProp(client, Prop_Send, "m_iAmmo", _, 13) < 1)
{
g_MyHe[client]++;
GivePlayerItem(client, "weapon_smokegrenade");
}
}
как сделать для дымовухи? не работает почему то!