Raised This Month: $51 Target: $400
 12% 

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


Post New Thread Reply   
 
Thread Tools Display Modes
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
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 02-01-2024 , 08:46   Re: [CS:S] Stop bots from going knife at the start of a round
Reply With Quote #2

One trick would be, drop knife and "kill" it.
__________________
Do not Private Message @me
Bacardi is offline
Xeller_2
New Member
Join Date: Feb 2024
Old 02-01-2024 , 08:58   Re: [CS:S] Stop bots from going knife at the start of a round
Reply With Quote #3

Quote:
Originally Posted by Bacardi View Post
One trick would be, drop knife and "kill" it.
How is that done exactly?
Xeller_2 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 02-01-2024 , 12:33   Re: [CS:S] Stop bots from going knife at the start of a round
Reply With Quote #4

https://sm.alliedmods.net/new-api/cstrike/CS_DropWeapon


Edit
Here is example, if you want player to use another weapon for example
https://forums.alliedmods.net/showpo...76&postcount=8
__________________
Do not Private Message @me

Last edited by Bacardi; 02-01-2024 at 12:41.
Bacardi is offline
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
Reply



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 13:56.


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