[TF2] Can't kick bots!
Hi! I'm making a plugin that manages the bots on a server in highlander mode.
First of all i created a new array. 1 index = 1 class Code:
new Players[18]Then set that every time a player spawn its client id associates to an index public Event_PlayerSpawn(Handle:event,const String:name[],bool:dontBroadcast) Code:
{Players[0] is Blu Scout, 1 is Red Scout, 2 is Blu Soldier, 3 is Red Soldier, 4 is Blu Pyro, etc... (Maybe there is a way a lot easier to do this. But it's my first plugin, i just started 1.5 weeks ago :( ) Now i want that to kick a bot (so only if it is a fake client, else do nothing) through a command in chat / on a menu. I tried a lot of ways but the game does not kick the specified bot. One of the way i tried is: *example for the soldier* Code:
public SoldierMenuHandler(Handle:menu, MenuAction:action, client, param2) But i don't see any message in the console. I just see the bot disappear without any notice. Also, does not get kicked the bot i want everytime. What's wrong? |
Re: [TF2] Can't kick bots!
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:
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:
so in your function you just have to do this: Code:
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. |
| All times are GMT -4. The time now is 21:34. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.