This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

[CS:S] Stop bots from going knife at the start of a round


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Xeller_2
New Member
Join Date: Feb 2024
Old 02-01-2024 , 07:43   [CS:S] Stop bots from going knife at the start of a round
Reply With Quote #1

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.
Xeller_2 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:07.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode