#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <cstrike>
public OnPluginStart()
{
HookEvent("player_spawn", OnPlayerSpawn);
}
public Action:CS_OnBuyCommand(client, const String:weapon[]) // Запрет покупки
{
PrintToChat(client, "Buying disabled");
return Plugin_Handled;
}
public OnPlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
// Режим бессмертия
SetEntProp(client, Prop_Data, "m_takedamage", 0, 1);
// Отбираем все оружие, кроме ножа
if(GetPlayerWeaponSlot(client, 0) != -1)
RemovePlayerItem(client, GetPlayerWeaponSlot(client, 0));
if(GetPlayerWeaponSlot(client, 1) != -1)
RemovePlayerItem(client, GetPlayerWeaponSlot(client, 1));
if(GetPlayerWeaponSlot(client, 3) != -1)
RemovePlayerItem(client, GetPlayerWeaponSlot(client, 3));
if(GetPlayerWeaponSlot(client, 4) != -1)
RemovePlayerItem(client, GetPlayerWeaponSlot(client, 4));
}