Всем привет..
Подскажите, как сделать, чтобы функция Event_OnPlayerSpawn работала со 2-го раунда?
Подскажите, как сделать, чтобы функция Event_OnPlayerSpawn работала со 2-го раунда?
PHP:
#include <sourcemod>
#include <sdktools>
#include <cstrike>
public Plugin:myinfo =
{
name = "VIP",
author = "SzYma",
description = "",
version = "1.0.2",
url = "http://3Mod.pl/"
};
public OnPluginStart()
{
HookEvent("player_spawn", Event_OnPlayerSpawn);
}
public Event_OnPlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
new team = GetClientTeam(client);
new money = GetEntProp(client, Prop_Send, "m_iAccount");
if (client > 0 && IsPlayerAlive(client))
{
if (IsPlayerGenericAdmin(client))
{
SetEntityHealth(client, 105); //hp
SetEntProp(client, Prop_Send, "m_ArmorValue", 100, 4); //armor
SetEntProp(client, Prop_Send, "m_bHasHelmet", 1); //helm
SetEntProp(client, Prop_Send, "m_iAccount", money + 500); //200$ plus
GivePlayerItem(client, "weapon_smokegrenade"); //smoke
GivePlayerItem(client, "weapon_flashbang"); //flash
GivePlayerItem(client, "weapon_hegrenade"); //grenade
GivePlayerItem(client, "weapon_flashbang"); //flash
if(team == CS_TEAM_CT)
{
GivePlayerItem(client, "item_defuser"); //kombinerki
}
}
}
}
/*
@param client id
return bool
*/
bool:IsPlayerGenericAdmin(client)
{
return CheckCommandAccess(client, "generic_admin", ADMFLAG_GENERIC, false);
}
Последнее редактирование: