View Single Post
Vit_amin
Senior Member
Join Date: Dec 2015
Location: Russian Federation
Old 02-01-2024 , 13:26   Re: [CS:S] Stop bots from going knife at the start of a round
Reply With Quote #5

Quote:
Originally Posted by Xeller_2 View Post
So, i'm trying to stop bots from going knife at the start of a round, because that creates problems when playing on aim and fy maps, this is my first sourcemod coding experience and this is what i have so far, it does not even work:

#include <sourcemod>
#include <cstrike>
#include <sdktools_functions>

public Plugin myinfo =
{
name = "BotSwitchPrimary",
author = "Xeller",
description = "Switches fakeclients to primary weapon on round start",
version = "1.0",
};

public void OnPluginStart()
{
HookEvent("player_spawn", EventSpawn);
}

public void EventSpawn(Event event, const char[] name, bool bdb)
{
int client = GetEventInt(event, "userid");

if (IsFakeClient(client))
{
new weapon = GetPlayerWeaponSlot(client, 1);
SetEntPropEnt(client, Prop_Send, "m_hActiveWeapon", weapon)
}
}

If anyone knows how to do it properly i would greatly appreciate the help.
I may writing private plugin, if interesting, welcome to PM
Vit_amin is offline