Raised This Month: $ Target: $400
 0% 

[TF2] Can't kick bots!


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Benoist3012
Veteran Member
Join Date: Mar 2014
Location: CWave::ForceFinish()
Old 06-26-2016 , 04:32   Re: [TF2] Can't kick bots!
Reply With Quote #2

Since it's your first plugin, I recommand you to start with the new sourcemod syntax, not the old one, because some new functions from sourcemod are only available in the new sourcemod syntax 1.7+ (https://wiki.alliedmods.net/SourcePa...itional_Syntax)
If I remember correctly, if you wanna kick a bot you have to decrease the bot quota by 1.

Code:
Handle g_hBotQuota; public void OnPluginStart() { g_hBotQuota = FindConVar("tf_bot_quota"); } public void RandomFunction() { int iBotCount = GetConVarInt(g_hBotQuota);//Get the current bot count. iBotCount--;//Decrease it by 1 (--) SetConVarInt(g_hBotQuota,iBotCount);//Set the new bot count. //Kick the bot. }

Also I don't know if you are going to use your array somewhere else. But if you do, you should make it like that:
Code:
#define TF_MAX_CLASS 9 #define MAX_TEAMS 4 int g_iPlayer[MAX_TEAMS][TF_MAX_CLASS+1];

so in your function you just have to do this:
Code:
int team = 3;//Blue team if(IsFakeClient(g_iPlayer[team][view_as<int>(TFClass_Scout)])) //do stuff here;
The enum of class can be found here: https://sm.alliedmods.net/new-api/tf2/TFClassType

Final note: it's fine to use an array if you are looking for bot's class often in the code, otherwise it's a waste of memory. You are also assuming with this array that the class limit is 1 for both team, that you can't have 2 blue bots scouts.
__________________

Last edited by Benoist3012; 06-26-2016 at 04:35.
Benoist3012 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 21:34.


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