#include <sdktools_functions>
public Plugin:myinfo =
{
name = "GivePistol",
author = "LeadBit",
description = "Give pistol P250 on spawn",
version = "1.0",
url = "www.xxx.ru"
}
public OnPluginStart()
{
HookEvent("player_spawn", Ev_PlayerSpawn);
}
public Action:Ev_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
new slot = GetPlayerWeaponSlot(client, 1);
new team = GetClientTeam(client);
if (team == 2)
{
if (slot != -1) CS_DropWeapon(client, slot, true, false);
GivePlayerItem(client, "weapon_deagle");
}
else if (team == 3)
{
if (slot != -1) CS_DropWeapon(client, slot, true, false);
GivePlayerItem(client, "weapon_deagle");
}
}